Add “trusted_domains” for your NextCloud instance after installation through snap

NextCloud’s official docs always ask you to find the config.php file for adding another trusted domain for your NextCloud instance. Whilst the “snap” installation is the quickest one out there, it also messes around the default traditionally installed NextCloud file structures, which makes locating the config.php file quite difficult. As an alternative, you can use below commands to add a new trusted domain:

The below command returns the default (position 0) trusted domain:

sudo snap run nextcloud.occ config:system:get trusted_domains 0

And on my LAN it returns a local address:

192.168.0.18

If I try to retrieve the trusted domain on position 1, I type:

sudo snap run nextcloud.occ config:system:get trusted_domains 1

With an empty output, I am confident that I can add a new domain into position 1 using:

sudo snap run nextcloud.occ config:system:set trusted_domains 1 --value=nextcloud.nickxu.tech

And the output is:

System config value trusted_domains => 1 set to string nextcloud.nickxu.tech

To verify, I re-run:

sudo snap run nextcloud.occ config:system:get trusted_domains 1

And voila:

nextcloud.nickxu.tech

 


Posted

in

by

Tags:

Comments

Leave a Reply

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