In this tutorial, we will be using the easiest possible way to install Nexcloud – snapcraft. Snapcraft is an outstanding tool allowing us to install the software as easy as you may imagine.
Snap will do all the work for you: install php, apache, mysql and all necessary extensions, create db and db user. Everything goes as a single package.
Sound good? Same for me…
To run the install process, use the following command:
sudo snap install nextcloud
Adding admin user and password
sudo nextcloud.manual-install username password
Listing trusted domains:
sudo nextcloud.occ config:system:get trusted_domains
The output will show the following: localhost
Now as we want to configure a domain we should add it to the list of trusted domains:
sudo nextcloud.occ config:system:set trusted_domains 1 --value=yourdomain.com
Run listing command one more time to ensure the domain has been added.
sudo nextcloud.occ config:system:get trusted_domains
Let’s Encrypt SSL certificate
Nextcloud requires a valid SSL certificate to be installed. That is why we will install Let’s Encrypt SSL certificate. Of course, you can install any other SSL certificate or even a self-generated certificate. But in this tutorial, we will use only Let’s Encrypt.
Before you start please ensure that you configured your domain to point the same IP address and ports 80 and 443 are opened.
To check this go to the Networking tab in your lightsail management panel and check if your domain pointing to your IP and line “https 443” present in the list.

Now run a command:
sudo nextcloud.enable-https lets-encrypt
Now type in your web browser the domain you used for installation. It should redirect you from

You should use same username and password you entered for the command:
sudo nextcloud.manual-install
More information can be found here:
https://github.com/nextcloud/nextcloud-snap
That’s all!
Thank you for this easy-to-follow tutorial. I was able to set up an owncloud installation very quickly! Please keep up the good work.
Thank you, Dylan, for your interest! Definitely)
Thank You!!!
Unfortunately, the lets-encrypt no longer issues certificates for amazonaws.com domains.
Really appreciated this tutorial, thank you!
You are welcome!
Thank you for this great tutorial. Unfortunately I receive 403 forbidden after setting up the Letsencrypt certifcate. Any thoughts on this?