How To Edit config.php in Nextcloud App

Kudos @ahrnke

Howto Edit config.php in Nextcloud App

Note: Changes in the configuration files are permanently. Even uninstalling the Nextcloud app keeps these changes (as Nextcloud performs a backup to the host directory /var/lib/univention-appcenter/apps/nextcloud/data/integration/config

Manual way

To set parameter which are located in the config.php of the Nextcloud app you need to change into the Docker container and edit the files there.

Step 1: Change into to Docker container

univention-app shell nextcloud

Step 2: Identify the files to edit

The default configuration file of Nextcloud can be found at /var/www/html/config/config.php

Step 3: Edit the file according to your needs

Use a text editor (ie vi) to set the parameters you want.

Shortcut with the occ command of Nextcloud

Instead of doing it manually use the following shortcut.

Step 1

Use the occ command inside of the app to get the current values ie. for “trusted_domains”:

root@ucs:~ # univention-app shell nextcloud sudo -u www-data php /var/www/html/occ config:system:get trusted_domains 
www.multi.ucs
192.168.1.11

Here we see that two values already exist.

Step 2

So lets try to add a third:

root@ucs:~ # univention-app shell nextcloud sudo -u www-data php /var/www/html/occ config:system:set trusted_domains 3 --value multi.ucs
System config value trusted_domains => 3 set to string multi.ucs

Step 3

Verify setting:

root@ucs:~ # univention-app shell nextcloud sudo -u www-data php /var/www/html/occ config:system:get trusted_domains
www.multi.ucs
192.168.1.11
multi.ucs

**Note: ** Further information about the trusted_domain parameter can be found at Nextcloud.

1 Like