I installed nextcloud using sudo snap install nextcloud on my vps. Now I can connect to it at localhost:80 from the vps itself. If I forward the 80-th port via ssh from my local computer, then I can connect from it too. I want nextcloud to work at nextcloud.mydomain.dmn, so I obviously need to do some configuration, however I don't know how to do that with snap.

There is a readonly /snap/nextcloud/current/ directory with conf/httpd.conf. I can't edit it. It's provided by the following systemd unit:

# cat /etc/systemd/system/snap-nextcloud-2184.mount
Description=Mount unit for nextcloud



It seems there are not nextcloud-related config files in /etc except for systemd units.

2 Answers 2


The Nextcloud snap is as far I can see not using a vhost, so it doesn't serve Nextcloud for specific domains. You should open port 80 and 443 on your VPS and setup DNS so nextcloud.mydomain.dmnpoints to your VPS.

You'll have to configure Nextcloud to trust this new domain, this is described here (https://github.com/nextcloud/nextcloud-snap/wiki/Connecting-the-Nextcloud-Box-to-the-Internet#3-add-your-external-domain-to-nextcloud):

List the domains you're currently using

sudo nextcloud.occ config:system:get trusted_domains

Create a new entry

sudo nextcloud.occ config:system:set trusted_domains 2 --value=nextcloud.mydomain.dmn

Note: replace "your.domain" with the domain name registered at step 1 and replace the number 2 with the actual number where the new entry will be created. For a 3rd entry, you would use the number 3

That's it. Here is some more information about the snap: - https://github.com/nextcloud/nextcloud-snap/wiki/Included-CLI-utilities - https://github.com/nextcloud/nextcloud-snap/wiki/Enabling-HTTPS-(SSL,-TLS)


Nextcloud lauches his own Apache server when installed through snap. By default, it listens on port 80.

(source) You can activate ssl with:

sudo nextcloud.enable-https lets-encrypt

and add your domain to trusted domains in:


(source) You can also change the port:

sudo snap set nextcloud ports.https=444

And serve it behind a proxy.

  • I tried the "serve it behind a proxy" route but it is quite involved and in the end I never got it working properly. Stuff like file uploads still randomly break when the service is put behind nginx.
    – Jeroen
    Sep 28, 2020 at 17:11
  • I am serving it behind a nginx proxy without any problem. (not the snap version) Sep 30, 2020 at 12:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.