Using The Nextcloud External Sites App As The Default App

Using Nextcloud ‘External Sites' app as the default app.

Issue: When trying to set the default app of Nextcloud to the root folder ( via the ‘External Sites' app, the app would add an id ( {id} ) to the end of the url that would cause a conflict with the default app setting in config.php. To eliminate the External Sites app id, the code below was changed below:

Original file at: /var/www/html/nextcloud/apps/external/appinfo/routes.php

$ sudo nano /var/www/html/nextcloud/apps/external/appinfo/routes.php
$this->create('external_index', '/{id}')
$this->create('external_ajax_setsites', 'ajax/setsites.php')

Changed to:

$this->create('external_index', '')
$this->create('external_ajax_setsites', 'ajax/setsites.php')

The only change is the deletion of the ‘/{id}' parameter in the first line.

This creates a default link to

This also creates a redirect from
and alllows the code below to work – Place in the config.php file to work:


$ sudo nano /var/www/html/nextcloud/config/config.php

I added the line before the line with ‘redis' => …

'defaultapp' => 'external',

Note that by doing this, you can still add additional sites to the ‘External Sites' app however, the first site (../?id=1) will be the the site that is set to the default app by using the code snippet above.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.