Untrusted Domain on Asustor Docker installation


I have been trying on and off for the last couple of months to sort out the “Untrusted Domain” prompt when trying to access my content off of my LAN. My installation is on an Asustor NAS inside of a Docker Container. I was able to access outside of my LAN for a brief period, then lost access after an upgrade.

I’ve read through many posts but always end up sliding down a rabbit hole because I cannot figure out how to edit the Environment Variables. I know how to ssh from a LAN computer, but am lost after that because a “/var/www” directory does not exist. Although I’m familiar with databases and am very computer savvy, I do not know how to administer or edit a database. FWIW, I have included my No IP host name in the config.php and zzconfig.php files with no joy.

My details are as follows.

Steps to reproduce

  1. Access via LAN is successful;
  2. Access remotely is unsuccessful
  3. config.php and zzconfig.php content is:
    ‘trusted_domains’ =>
    array (
    0 => ‘10.xx.xx.xx’,
    1 => ‘xxxx.xxxxx.net:8585’,

ownCloud version:

I don’t use Docker, but I checked my config.php (I don’t have a zzconfig.php and I have no idea why you do.) and I only have two hostames listed, no IPs or ports. Of course, I never access my ownCloud directly via IP, and I only use HTTPS over port 443. That may not be terribly helpful, but it’s all I’ve got for you.

1 Like

HI, don’t use the port in the name.Your router should forward the port to your webserver, your server is listening on that port. So you just go to blah dot com and let the configs do what they are supposed to. (there is never an instance where your hostname includes a port, at least not in dns)

1 Like

Hello @ v3_exceed. Removing the port from my config.php file did not resolve the issue.

I don’t have a problem with my router forwarding to the correct port. The issue is when I hit the site with the designated port #, I get the “untrusted domain” error. Do you know what else I can try?

Hello Geek fellow.

This is my list of trusted domains on one of the instances I have. This is actually my personal one, so i know it works.

Copy and paste this, and then change the urls to be the one you access your cloud instance from. (this is in your config/config.php file

You need to copy it exactly. including the ), at the end… if you dont have 4 urls just remove the ones you do not have from the bottom up…

‘trusted_domains’ =>

array (

0 => ‘cloud.xxxxxxxxxxx.net’,

1 => ‘www.cloud.xxxxxxxxxxx.net’,

2 => ‘cloud.xxxxxxxxxx.ca’,

3 => ‘www.cloud.xxxxxxxxxx.ca’,



Hello again, @v3_exceed

Thank you so much for trying to help me. I’ve pasted the text you shared into my config > config.php file, but still no joy.

I saved but commented out my original content, which is included at the bottom.

	 ‘trusted_domains’ =>
		array (
		0 => ‘xxx.xxxx.net’,
		1 => ‘www.xxx.xxxx.net’,
    ## 'trusted_domains' => 
    ##  array (
    ##    0 => '10.xx.xx.xx',
    ##	1 => 'www.xxxx.xxx.net',
    ##  ),

I restarted my NAS, but that didn’t help either.

Hi Again,

OK, I have been thinking on this for awhile now.

I did have a similar problem when I setup owncloud within my network but tried to access it internally instead of externally.

What I would suggest you do, is create a cname in dns for your owncloud install. I created cloud.techweavers.net for mine.

Then route the dns for your domain cloud.whatever.com to your external IP address.

Now even though you are trying to access it internally to 10.x.x.x you would now try to get to it at cloud.whatever.com

your router should map it to the right port and your instance should show up. I have all my stuff at a co location down town so unless I am setting up a test i don’t use my local connection for serving. then put cloud.whatever.com into your config and it should work… fingers crossed.


If you’re using the official ownCloud’s docker image, setup the proper environment variables in the docker container.
Full list is in https://github.com/owncloud-docker/base/blob/master/ENVIRONMENT.md#environment-variables
In particular, you’ll need to use the OWNCLOUD_TRUSTED_DOMAINS environment variable.


Hello @jvillafanez.

I apologize for not understanding, but I cannot find where to modify the environment variables. Here is a screenshot of my Asustor directory. I’ve researched and read a lot of articles, but found no way to modify the files. I even searched in phpMyAdmin for ,yml files and found nothing.

You can use docker run -e envkey=envvalue .... to setup environment variables inside the container when it starts (docker run | Docker Docs).

If you’re using docker-compose, you can do the same in multiple ways as described in their documentation Ways to set environment variables in Compose | Docker Docs

Note that the environment variables must be set INSIDE the docker container. The options above will do that.

1 Like

None of the suggestions here worked for me. Since I am unfamiliar with database management, all the links were deeply confusing and as clear as mud. I’m sure @jvillafanez’s suggestions were brilliant, but I couldn’t make heads or tails of them because I kept getting errors thrown when running his commands via ssh. I tried changing to the “volume1/Docker” directory but got no joy no matter what I tried.

After about 20+ hours of research, this is what worked for me:

  1. Install PortainerCE (in the Asustor App Store) then open it and create an account
  2. Under “Home” select “Environment,” then select the settings icon at the bottom right next to “Connected.”
  3. Select “Containers” in the left spine
  4. Tick “ownCloud” box then select to open it.
  5. Select “Duplicate/Edit” at the top right of the page
  6. Under “Advanced Container Settings” select “Env
  7. Scroll down to “OWNCLOUD_TRUSTED_DOMAIN
  8. Enter your desired domains separated by a “comma” but no spaces and no port numbers
  9. Scroll up and select “Deploy the container
  10. Enter “Yes” when asked if you want to replace the container.
    (As long as nothing else is modified, no data will be lost. If you change anything else, YMMV, but I tested these instructions several times to ensure they are accurate.)
  11. For good measure, I restarted my NAS to force the changes to apply.



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