Help with trusted domains

Hi there,

I am running Ubuntu 16.04.4 x64 on DigitalOcean. I’ve successfully setup nextcloud and added my domain ‘’ to my droplet. However, I also want to add ‘’ to my trusted domain list. Whenever I try to follow the standard procedure, it seems that I can only choose one of them: either the one without ‘www’ or the one with. Is there a way I can add both of them as trusted domains and get the Let’s Encrypt certificate for both?

Thanks in advance :slight_smile:


For a certificates from let’s encrypt for two full qualified domain names for one web server, you need to use the newly announced and just supported wildcard certificates (like *

These wildcard certificates are supported with certbot 0.22.0.

Regarding your question about trusted domains: actually you only need to add further trusted domains in the config.php of Nextcloud.

  'trusted_domains' =>
  array (
    0 => '',
    1 => '',
    2 => 'localhost',
1 Like

Thank you so much for your help Schmu! You are a great help :slight_smile:

Also, can you please outline the procedure for editing the config.php file? I’m using digitalocean and nextcloud is installed on Ubuntu.

Thank you for the compliment :slight_smile:

Unfortunately I don’t know digitalocean and how you can access your server files. I would assume that you can at least access your config.php file via (S)FTP.
In that case you could do the following:

  • access your server with a (S)FTP client
  • navigate to the nextcloud installation directory (maybe you login directly to that directory)
  • in that nextcloud directory look for the directory “config” and enter that directory
  • there you should see the config.php
  • either edit that file with your ftp client directly if your software allows that or download it
  • either way, make your changes as suggested and save/ re-upload the file
  • reload your website

That should be it.

You don’t have SSH access, right?
With SSH access you could login to your server and edit that file directly on the server with the editors vi or nano (as you prefer).

You are as confused as I was. “trusted_domains” isn’t about domains at all, not in the sense of how you access the nextcloud instance. A better term would be “trusted_name” since what’s looked for is the name of the server instance: or whathaveyou. The point is to defeat header malfeasance so the name of the instance is what’s needed. I expected it to be about the domain that could access it but it doesn’t take domains, not as or as 192.168.0..

Bad form, Nextcloud devs.