Snap provides an easy and clean way to install Nextcloud.
Prepare a domain name resolved to the IP address of your server.
| |
Enter your domain in a browser, complete the setup shown on the welcome page, then enable HTTPS:
| |
To change the default Nextcloud ports:
| |
Ignore the following section if you don’t need an Nginx proxy.
Refer to the official reverse-proxy documentation.
To configure the reverse proxy properly, edit config/config.php, usually located under /var/snap/nextcloud/current/nextcloud/config/. Make a backup first and edit this file carefully according to the documentation.
Configure Nginx as described in the Nginx section of the documentation, then add trusted_proxies to Nextcloud’s config.php:
| |
Without this setting, errors may occur when logging in through the Android app.
Run sudo snap restart nextcloud, and everything should be fine.
Not quite yet: everything may look fine, but “An unknown error occurred” can appear when uploading a file larger than 1 MB. This is caused by Nginx’s default upload limit. Add the following setting to /etc/nginx/nginx.conf:
| |
Finally—done.