HowTo: Add a new trusted domain

Problem like this is why I don’t recommended Owncloud/Nextcloud. Keep away and look for other system. Different solutions on different system, and why developer not open it for all domain and let the user blacklist domain on it self is a clue to me. And this is only the start to all the trouble the developer have built in in the system for ordinary people.

On forum how recommended Nextcloud I say no, no, no way. Its a fine idea but for special people. I like Nextcloud but not in the way the developers have put in restrictions that must be forced into the terminal and which solutions are completely different on different systems. The domain response list is just the beginning. Then it’s how big files you can upload and to access dividends through network drives etc.

Yep feel the same way but not only with nextcloud 
 with the whole damn concept of linux. Great idea but poor execution.

Im currently stuggeling to find the location of said config/ folder. My NC is inside a docker and occ seems to be missing.

It seems that linux devs just assume that the user just happens to know where that file is?

pathtoyoufile/config/config.php

the pathtoyourfile seems to be very very variable as i ftlog can not figure out where its supposed to be.

Why isn’t there an easy way to add these trusted domains inside nextcloud? On many pictures posted here i do see a link that supposedly lets you add the domain directly from the webpage. My nextxloud doesn’t have that feature apparently?

Why so complicated?

purrfect thank you!

1 Like

this answer is pure horror.

with at least some kind of knowledge about security you wouldnt recommend to use a ,blacklist" system! no way around whitelists!!!

I get here but not sure if it is written well :confused:

paste in this file config.php this line

  'trusted_domains' =>

array (
0 => ‘yourip’,
1 => ‘yourdomain.example’,
),

My understanding is:

  1. You normally only add node(s) inside your LAN as trusted. So they can access through HTTP.
  2. When you access through HTTPS - SSL encryption from outside, there is no-need to add trusted domain.

Am I correct? Thanks.

No, please see

https://docs.nextcloud.com/server/20/admin_manual/configuration_server/config_sample_php_parameters.html?highlight=trusted_domains#default-parameters

Ich möchte fĂŒr trusted_domains die Datei
/snap/nextcloud/current/htdocs/config/config.php
editieren. Beim Speichern der Datei erscheint:
Cannot save file [Dismiss]

Ich bin root und die Datei ist: - rw-r-r root:root config.php

Hello @Helmut52,

welcome to the community of Nextcloud.

Please use the search function next time.
It would have brought you to the following page:

i am using nextcloud 21 un Centos 8. i did run this command below:

[root@nc1 nextcloud]# sudo -u apache php occ config:system:set trusted_domains 2 --value=mydomain.com
System config value trusted_domains => 2 set to string mydomain.com
[root@nc1 nextcloud]# systemctl restart httpd

but still the same error still persist. to verify it, here is the config.php file !

config|428x500

restarted the apache daemon, problem still persist

Hi there, I am new to nextcloud and still trying to learn as much as I can from linux.

Could someone explain how I can edit nextcloud’s config file on unraid? I managed to do it for editing the ports unraid uses by physically plugging in the boot drive to my laptop and editing the config file there, but would this also work to add nextcloud trusted domains?

Thanks in advance!

Yes, but I am sure there are easier ways to do that. Never used unraid myself but please see Home | Unraid Docs

1 Like

Does anything need to be added to the trusted domains list in order to allow the Android app client to connect to Nextcloud? I have my FQDN and it works fine for the Windows desktop client and from browsers (on Windows or Android) but I cannot get the Android app to connect via the FQDN.

If the desktop is connected using the exact same name, then it’s already in the list, and doesn’t need to be added.
Seems like something wrong with the Nextcloud app on the device, since the browser seems to work there. Edit: Found your thread where you discuss this problem.

1 Like

To find a file (say, config.php) on linux I use:
sudo find / -name config.php

Newbie here. I was able to find the location of the file with “sudo find / -name config.php”. But I can’t open the nextcloud folder to get to the file (authorization issue i guess). What can I do about it?

Hey , i also need help. I am using ngrok to create a url for my local host. once the url is created i added it to the trusted domain but it is still not working.

If you use cPanel, default location is

cPanel > File manager > public_html > config.php

then just click edit in file manager and add IP, domain, subdomain or all together.

 'trusted_domains' =>
  array (
    0 => '192.168.0.29',
    1 => 'cloudamo.com',
  ),

if you installed nextcloud with the Ubuntu server iso 22.4 then the file will be at,
Sudo vim /var/snap/nextcloud/current/nextcloud/config/config.php press ‘insert’ on your keyboard and edit the file, look for ‘trusted domains’ then add your domain. press escape on keyboard then save and quit :wq
You can now log in from your trusted domain.