Build your Nextcloud Server using one shell script
The initial script (install-nextcloud.sh) will install your self hosted Nextcloud on an AMD64 infrastructure within few minutes fully automated. Your server will be built of:
- Fail2Ban (Nextcloud and SSH jails)
- MariaDB 10.3.8 new
- Nextcloud 13.0.5 new
- NGINX 1.15.2
- OpenSSL 1.1.0h
- PHP 7.2.8 new
- self signed or Let’s Encrypt SSL using the second script
- UFW (22, 80, 443)
The only precondition for the install-nextcloud.sh script is to utilize Ubuntu 18.04 LTS as your on-prem server OS.
On an ARM64 platform NGINX 1.14 will be installed due to NGINX current repository limitations (install-nextcloudARM64.sh) .
At least and optionally only you can request your ssl certificate from Let’s Encrypt by issuing the script called “ssl-certificate.sh”.
Ready to go? Let’s start:
(1) Build your self hosted Nextcloud server
If you are on Ubuntu 18.04 LTS:
sudo -s apt install git -y cd /usr/local/src git clone https://github.com/riegercloud/install-nextcloud.git cd install-nextcloud chmod +x install-nextcloud*.sh ./install-nextcloud.sh
or (on ARM64 platforms)
… be patient
Press ENTER to continue with the MariaDB installation and press ENTER again (without setting a MariaDB root password) if the magenta screen appears (2x). As described you will be asked to set/change the MariaDB root password while running mysql_secure_installation, at this step it is highly recommended to set the root password.
… be patient
Open your browser and call the shown URL from your shell
Nextcloud is already up, optimized and running!
(2) Optionally: Request your ssl certificate from Let’s Encrypt
Before you request your certificate ensure that your web-ports (80+443) are forwared to your server and your dyndns is properly configured to point to your server!
sudo -s cd /usr/local/src/install-nextcloud chmod +x ssl-certificate.sh ./ssl-certificate.sh
You only have to enter your DYNDNSNAME (YOUR.DEDYN.IO).
Then LetsEncrypt will ask you for
- your email adress
Enter email address (used for urgent renewal and security notices) (Enter 'c' to cancel):
- to agree to their Terms of Service
- if you are willing to share your email address with the Electronic Frontier Foundation
Y or N
Wait while your certificates are obtained.
If you receive this message:
Call: https://your.dedyn.io and enjoy your Nextcloud
your server is up and running using a verified certificate from Let’s Encrypt.
Enjoy your personal data in your secured and hardened Nextcloud.
Don’t forget to Backup your Nextcloud
Find more instructions here: Nextcloud Backup and Restore