# Which config.php is the right one and how to add trusted domains correctly

**URL:** <https://help.nextcloud.com/t/which-config-php-is-the-right-one-and-how-to-add-trusted-domains-correctly/230046>\
**Category:** ℹ️ Support\
**Tags:** snap, trusted\_domains, setup\_warning\
**Created:** [August 9, 2025, 5:41am UTC](https://help.nextcloud.com/t/which-config-php-is-the-right-one-and-how-to-add-trusted-domains-correctly/230046 "2025-08-09T05:41:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eegxeta](https://help.nextcloud.com/letter_avatar/eegxeta/32/6_22734026db12803ebb3e059622ac3534.png) [@Eegxeta](https://help.nextcloud.com/u/Eegxeta)\
**Post date:** [August 9, 2025, 5:41am UTC](https://help.nextcloud.com/t/which-config-php-is-the-right-one-and-how-to-add-trusted-domains-correctly/230046/1 "2025-08-09T05:41:22Z")

</div>

So I’ve installed Nextcloud using the snap that comes with the Ubuntu server install ISO and I want to be able to access it over a Netbird network however it gives this error:

Nextcloud  
Access through untrusted domain  
Please contact your administrator. If you are an administrator, edit the “trusted\_domains” setting in config/config.php like the example in config.sample.php.

Further information how to configure this can be found in the documentation.

So I dug into the documentation found the right section and used locate to find config.php. There was two different files with that name.

/snap/nextcloud/49338/htdocs/config/config.php  
/var/snap/nexcloud/49338/nextcloud/config/config.php

So I used nano to try and modify both. The one under /snap couldn’t be modified, but while the one under /var had the right section it didn’t look like what the documentation’s example.

This is what it looks like:

‘trusted\_domains’ =\>  
array (  
0 =\> ‘10.0.0.50’,  
),

I’ve tried pretty much everything I can think of. Can anyone help with this?

---

<div class="post-metadata">

**Author:** ![scubamuc](https://help.nextcloud.com/user_avatar/help.nextcloud.com/scubamuc/32/63165_2.png) [@scubamuc](https://help.nextcloud.com/u/scubamuc)\
**Post date:** [August 9, 2025, 5:56am UTC](https://help.nextcloud.com/t/which-config-php-is-the-right-one-and-how-to-add-trusted-domains-correctly/230046/2 "2025-08-09T05:56:57Z")

</div>

Hello @Eegxeta,

welcome to the Nextcloud community! 🤝 and thanks for supporting the snap

> [@Eegxeta](#):
>
> So I dug into the documentation found the right section and used locate to find config.php. There was two different files with that name.
> 
> /snap/nextcloud/49338/htdocs/config/config.php  
> /var/snap/nexcloud/49338/nextcloud/config/config.php

which documentation was that? see [https://github.com/nextcloud-snap/nextcloud-snap](https://github.com/nextcloud-snap/nextcloud-snap) and [Nextcloud snap wiki](https://github.com/nextcloud-snap/nextcloud-snap/wiki) and [Nextcloud latest admin manual](https://docs.nextcloud.com/server/latest/admin_manual/installation/source_installation.html#installing-via-snap-packages) for official documentation and you’ll find some [how-to’s](https://help.nextcloud.com/tags/c/how-to-faqs/9/snap/l/top?ascending=false&order=views) here in the forum:

> [@How to install Nextcloud snap](https://help.nextcloud.com/t/how-to-install-nextcloud-snap/216058):
>
> [How to install Nextcloud snap](https://help.nextcloud.com/t/how-to-install-nextcloud-snap/216058)[How to configure Nextcloud snap](https://help.nextcloud.com/t/how-to-configure-nextcloud-snap/216036)[How to manage Lets Encrypt for Nextcloud snap](https://help.nextcloud.com/t/how-to-manage-lets-encrypt-for-nextcloud-snap/216069)[How to manage setup warnings in Nextcloud snap](https://help.nextcloud.com/t/how-to-manage-setup-warnings-in-nextcloud-snap/216054)[Nextcloud snap wiki and support](https://help.nextcloud.com/t/nextcloud-snap-wiki-and-support/197783) You have decided to set up Nextcloud snap as a safe home for your data, that’s great! Thanks for supporting Nextcloud snap. handshake Nextcloud snap is a community driven installation method and is designed to be easy to install and simple to maintain. The ideal Nextcloud snap is an “install and forget” …

and especially:

> [@How to edit config.php for Nextcloud snap](https://help.nextcloud.com/t/how-to-edit-config-php-for-nextcloud-snap/218564):
>
> Edit config.php for Nextcloud snap [PHP configuration options](https://github.com/nextcloud-snap/nextcloud-snap/wiki/Configure-config.php) Some Nextcloud snap settings may need to be done directly in the config.php configuration file. While the default configurations are mostly fine, you might want to fine tune your Nextcloud snap instance. Nextcloud snap offers different configuration methods. While some folks prefer editing the configuration file using their favourite editor like nano, vim or UI texteditors like gedit, kedit etc. the [OCC management console](https://help.nextcloud.com/t/how-to-use-occ-management-console-for-nextcloud-snap/216111/) is a safe a…

> [@How to configure Nextcloud snap](https://help.nextcloud.com/t/how-to-configure-nextcloud-snap/216036):
>
> Nextcloud snap configuration Nextcloud snap configuration[How to install Nextcloud snap](https://help.nextcloud.com/t/how-to-install-nextcloud-snap/216058)[How to configure Nextcloud snap](https://help.nextcloud.com/t/how-to-configure-nextcloud-snap/216036)[How to edit config.php for Nextcloud snap](https://help.nextcloud.com/t/how-to-edit-config-php-for-nextcloud-snap/218564)[How to use OCC management console for Nextcloud snap](https://help.nextcloud.com/t/how-to-use-occ-management-console-for-nextcloud-snap/216111)[How to manage external media and storage for Nextcloud snap](https://help.nextcloud.com/t/how-to-manage-external-media-and-storage-for-nextcloud-snap/216039)[How to manage setup warnings in Nextcloud snap](https://help.nextcloud.com/t/how-to-manage-setup-warnings-in-nextcloud-snap/216054)[Nextcloud snap wiki & support](https://help.nextcloud.com/t/nextcloud-snap-wiki-and-support/197783)HTTPS encryption with Lets Encrypt The only thing we recommend you do up front is enable HTTPS. Nextcloud snap includes a service for automated…

> [@Eegxeta](#):
>
> trusted\_domains’ =\>  
> array (  
> 0 =\> ‘10.0.0.50’,  
> ),
> 
> I’ve tried pretty much everything I can think of. Can anyone help with this?

that looks like an IP-address and not a domain name, try [FQDN](https://github.com/nextcloud-snap/nextcloud-snap/wiki/Hosts-and-FQDN-for-Nextcloud-snap) instead, see [setting trusted domains](https://help.nextcloud.com/t/how-to-edit-config-php-for-nextcloud-snap/218564#p-655465-setting-trusted-domains-3) and [Hosts & FQDN configuration](https://github.com/nextcloud-snap/nextcloud-snap/wiki/Hosts-and-FQDN-for-Nextcloud-snap)

also look at [101: Network, domain and DNS](https://help.nextcloud.com/t/101-network-domain-and-dns/201882) and especially reference to [101: VPN service](https://help.nextcloud.com/t/101-vpn-service/201997) restrictions.

> [@Eegxeta](#):
>
> I want to be able to access it over a Netbird network

please contact the [Netbird](https://netbird.io/) folks for support if you’re facing connectivity issues.

---

<div class="post-metadata">

**Author:** ![Eegxeta](https://help.nextcloud.com/letter_avatar/eegxeta/32/6_22734026db12803ebb3e059622ac3534.png) [@Eegxeta](https://help.nextcloud.com/u/Eegxeta)\
**Post date:** [August 9, 2025, 1:36pm UTC](https://help.nextcloud.com/t/which-config-php-is-the-right-one-and-how-to-add-trusted-domains-correctly/230046/4 "2025-08-09T13:36:07Z")

</div>

Well now I’m more confused about what the issue is.

Ok let me clearly state the problem for starters.

When connecting to the my Nextcloud server over my Netbird VPN I get this:

Nextcloud  
Access through untrusted domain  
Please contact your administrator. If you are an administrator, edit the “trusted\_domains” setting in config/config.php like the example in config.sample.php.

Further information how to configure this can be found in the documentation.

I don’t have a domain. What is the above security measure called and as my server is not publicly accessible how do I turn it off?

I didn’t know there was more than the official admin manual, but this what the snap installed for the config.php for the trusted\_domain.

‘trusted\_domains’ =\>  
array (  
0 =\> ‘10.0.0.50’,  
),

I have not changed this from the base snap install. Although I’m not sure now this is even relevant to my issue anymore.

---

<div class="post-metadata">

**Author:** ![scubamuc](https://help.nextcloud.com/user_avatar/help.nextcloud.com/scubamuc/32/63165_2.png) [@scubamuc](https://help.nextcloud.com/u/scubamuc)\
**Post date:** [August 9, 2025, 6:29pm UTC](https://help.nextcloud.com/t/which-config-php-is-the-right-one-and-how-to-add-trusted-domains-correctly/230046/5 "2025-08-09T18:29:41Z")

</div>

> [@Eegxeta](#):
>
> I don’t have a domain. What is the above security measure called and as my server is not publicly accessible how do I turn it off?

… that’s what is recommended! so you need DNS including some human readable “domain” name connected to your public IPv4 and the server should be publicly available. Nextcloud is a sharing and collaboration service. any publicly available service should have a valid SSL certificate and encrypted on `https://cloud.yourdomain.tld`

the links posted above are in sequence so that you can read them like a manual. and no, if you’ve read the documentation you’ll see that the snap is a community project with own documentation… which is why it was linked above. see [Installation on Linux — Nextcloud latest Administration Manual latest documentation](https://docs.nextcloud.com/server/latest/admin_manual/installation/source_installation.html#installing-via-snap-packages)

> ## Installing via Snap packages
> 
> Nextcloud snap is a community driven installation method and is designed to be easy to install and simple to maintain. The ideal Nextcloud snap is an “install and forget” Nextcloud instance that works on most architectures and updates itself without needing administrative skills. Combining Nextcloud with snapd makes it a perfect fit for IoT or scalable environments. [Snapd](https://snapcraft.io/docs) is a secure and robust technology which the Nextcloud snap team has embraced.
> 
> Most importantly snaps are designed to be secure, sandboxed, containerized applications isolated from the underlying system and from other applications.

maybe this will shed some light:

> [@101: Self-hosting information for beginners](https://help.nextcloud.com/t/101-self-hosting-information-for-beginners/187015):
>
> Self-hosting is managing your own applications and data instead of relying on external services. It offers greater control, privacy, and customization but comes with a steep learning curve. Before diving in, it’s crucial to understand that self-hosting requires technical knowledge and can be time-consuming. recommendations start with a purpose: Identify what you want to achieve through self-hosting (e.g., privacy, control) to stay motivated. start small and gradually scale: Don’t overwhelm you…

---

<div class="post-metadata">

**Author:** ![Eegxeta](https://help.nextcloud.com/letter_avatar/eegxeta/32/6_22734026db12803ebb3e059622ac3534.png) [@Eegxeta](https://help.nextcloud.com/u/Eegxeta)\
**Post date:** [August 10, 2025, 12:07am UTC](https://help.nextcloud.com/t/which-config-php-is-the-right-one-and-how-to-add-trusted-domains-correctly/230046/6 "2025-08-10T00:07:04Z")

</div>

Thanks for the help, but Nextcloud is just too much for what I’m trying to do at the moment. I do want to implement it as some point, but for simply accessing a share on a NAS server it is complete overkill.

---

<div class="post-metadata">

**Author:** ![system](https://help.nextcloud.com/user_avatar/help.nextcloud.com/system/32/29333_2.png) [@system](https://help.nextcloud.com/u/system)\
**Post date:** [August 18, 2025, 12:07am UTC](https://help.nextcloud.com/t/which-config-php-is-the-right-one-and-how-to-add-trusted-domains-correctly/230046/7 "2025-08-18T00:07:06Z")

</div>

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.
