Nextcloud Installation Guide v. 2.1

Content

This Nextcloud installation guide describes the installation, configuration and hardening, monitoring as well as some extension options of Nextcloud on a 24.x LTS (x86-64) or Debian Server 12 (x86-64) server.

The installation is based on the components web server nginx, Let’s Encrypt TLS 1.3, MariaDB 10.11, PHP 8.3 (php-fpm), Redis, crowdsec, ufw, and Netdata, and finally receives an A+ security rating from both Nextcloud and Qualys SSL Labs.

The parameters to be adjusted are marked in red in the article and must be replaced with your specific system values (e.g. your.domain.de or 192.168.2.x).

Would you rather install everything with just a single script? Then use our Nextcloud installation script zero.sh, which is available here.

Further manufacturer information can be found here.

Current installation media for the underlying Linux server can be obtained here:

Ubuntu 24.04.x LTS:Requirements: Download Installation Medium

Debian 12.x: Voraussetzungen: Download Installation Medium

Start the installation and connect to your server via SSH console, e.g.

ssh <user>@<IP-address>

Only Debian Server:

su - apt install -y sudo usermod -aG sudo <Your current user> exit

From here on, it continues again for both server operating systems (Ubuntu and Debian):

Switch to privileged user mode

sudo -s

and first update the system.

apt update && apt upgrade -y

Prepare the server by installing the necessary base software packages:

apt install -y
apt-transport-https bash-completion bzip2 ca-certificates cron curl dialog
dirmngr ffmpeg ghostscript git gpg gnupg gnupg2 htop jq libfile-fcntllock-perl
libfontconfig1 libfuse2 locate lsb-release net-tools rsyslog screen smbclient
socat software-properties-common ssl-cert tree unzip vim wget zip

Enter the future server name in both the hosts file and the hostname file (» codeberg: https://codeberg.org/criegerde/nextcloud/src/branch/master/etc/hosts):

nano /etc/hosts

Adjust the red values to your environment, in the example we assume that the domain is called "your.domain.de":

127.0.0.1 localhost 127.0.1.1 their their.domain.de ::1 their their.domain.de ip6-localhost ip6-loopback [...]

Enter the correct server name in the hostname file and replace the red value with your:

nano /etc/hostname

Summary
This Nextcloud installation guide details the setup, configuration, hardening, monitoring, and extension options for Nextcloud on a 24.x LTS (x86-64) or Debian Server 12 (x86-64). The installation utilizes components such as the nginx web server, Let’s Encrypt TLS 1.3, MariaDB 10.11, PHP 8.3 (php-fpm), Redis, crowdsec, ufw, and Netdata, achieving an A+ security rating from both Nextcloud and Qualys SSL Labs. Key parameters to be adjusted are highlighted in red and should be replaced with specific system values. For a simplified installation, users can utilize the provided Nextcloud installation script, zero.sh. The guide includes steps for connecting to the server via SSH, updating the system, installing necessary software packages, configuring the server name, and ensuring time synchronization. It also covers adding software repositories for the latest package releases. The guide is comprehensive, catering to both Ubuntu and Debian users, and emphasizes security and proper configuration throughout the installation process.