Nextcloud is a platform for storing and sharing files, which lets you manage personal or business content (such as documents and images) over the Web. Its functionality is similar to Dropbox software or services such as Google Drive, although Nextcloud is entirely open source (AGPL 3.0).
It has encryption features and built-in rule-based file access control.
It is complemented by password policies, brute-force protection, ransomware protection, and more security options. Therefore, by using it on a server in Europe, you can meet the business and legal requirements of the GDPR (General Data Protection Regulation).
In this article, we will explain how to install it using the Snap package management system, so the procedure can be used for any distribution among the Linux images available on Clouding.
Installing Snap
On most Ubuntu or Ubuntu-based distributions, Snap comes preinstalled, although you can install it on other distributions (for Ubuntu, you can click here to skip the installation):
Installing Snap:
# apt update && apt upgrade -y && apt install snapd -y
Installing Snap:
# yum upgrade -y && yum install snapd -y
Next, enable snapd and restart the system:
# systemctl enable --now snapd.socket && ln -s /var/lib/snapd/snap /snap && reboot
Once the system has restarted, you will be able to install packages with it, and you can try installing the test package:
# snap install hello-world
The following output will appear when the installation finishes:
hello-world 6.4 from Canonical✓ installed
Then try running it:
# hello-world
You should get the following output:
Hello World!
Installing Nextcloud
Once Snap is installed on the server, install the Nextcloud package:
# snap install nextcloud
You can check the package installation or updates with:
# snap changes nextcloud
Then install and configure the administrative account for Nextcloud (remember to change the example password):
# nextcloud.manual-install admin contraseñaejemplo
Next, configure/add the domain or record you will use:
# nextcloud.occ config:system:set trusted_domains 1 --value=ejemplo.com
To check the configured domains, you can run the following:
# nextcloud.occ config:system:get trusted_domains
Once the domain is configured and the DNS record pointing to the server has been created, you can obtain the free SSL certificate with Let's Encrypt for Nextcloud:
# nextcloud.enable-https lets-encrypt
Provide the requested information:
In order for Let's Encrypt to verify that you actually own the
domain(s) for which you're requesting a certificate, there are a
number of requirements of which you need to be aware:
1. In order to register with the Let's Encrypt ACME server, you must
agree to the currently-in-effect Subscriber Agreement located here:
https://letsencrypt.org/repository/
By continuing to use this tool you agree to these terms. Please
cancel now if otherwise.
2. You must have the domain name(s) for which you want certificates
pointing at the external IP address of this machine.
3. Both ports 80 and 443 on the external IP address of this machine
must point to this machine (e.g. port forwarding might need to be
setup on your router).
First accept the terms, enter your email, and then specify the domain/record:
Have you met these requirements? (y/n) y
Please enter an email address (for urgent notices or key recovery): email@ejemplo.com
Please enter your domain name(s) (space-separated): ejemplo.com
Attempting to obtain certificates... done
Restarting apache... done
Once completed, you will be able to access Nextcloud directly using a Web browser with the administrative account credentials configured earlier.
We hope this article has helped you. If you still have questions about this or any other issue related to your servers on Clouding, email us at soporte@clouding.io. We're here to help! 😉