Installation on headless server

Hi,
Iā€™m attempting to set up nextcloud on a headless server using Snap. Iā€™ve followed the very useful instructions in this blog post:

so I now have nextcloud running on the server. The only problem is that I canā€™t access the server from my Desktop machine using a browser (see message below).

I can ssh into the server and run nextcloud.occ commands, no problem. I have set up an admin account and moved the data directory to an external SSD, all according to the instructions. I have set the IP of the Desktop machine and my router as trusted domains but quite evidently nextcloud isnā€™t trusting them when I try to reach the server over htpps.

I can reach the server using the lynx browser installed on the server but itā€™s a text-only browser with no javascript. I really donā€™t want to install a desktop environment just in order to finish setting up nextcloud.

Any ideas/suggestions would be most welcome.

Blockquote

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.

Hi @frderek

since the TLS connection is terminated by your webserver, Nextcloud shouldnā€™t have anything to do with it. Can you make sure your trusted_domain block in your configuration is properly formatted? It should look like this:

<?php
$CONFIG = array (
  'instanceid' => 'oc984842984298o',
  'trusted_domains' => 
  array (
    0 => 'your.domain.tld',
  ),
);

Now you say that you have added the IP of your desktop and router there but that is not what this field is for. The trusted_domains works on the server side. Say, you have a server that has IP 123.123.123.123, and a domain points to it: cloud.mydomain.tld. You want Nextcloud to only respond when accessed through the domain, not via the IP directly - so you add your domain to the trusted_domain list but leave the IP out.

In short: put the IP or domain of your server there, not of your clients.

/S

As an alternative you could try out the Nextcloud VM:

Then everything like that will be taken care of automatically.

I really canā€™t thank you enough. Thatā€™s exactly what my config file
looked like. What I hadnā€™t realised was that I needed to access the
server from OUTSIDE my own LAN. Iā€™ve now added the domains to be trusted
from OUTSIDE my LAN and access it via the internet! it works!

1 Like

Glad I could help! :slight_smile: