This script is made for clean Debian 11 installation on AMD64 CPU architecture.
It will update OS, install neeeded packages, and preconfigure everything to run Nextcloud.
There are Apache (web server), MariaDB (database server), PHP (programming language),
NTP (time synchronization service), and Redis (cache server) used.
Also new service for Nextcloud cron is generated that starts every 5 minutes.
A new user with administrative privileges will be added to the Nextcloud, you will find his credentials after the script runs (the password is randomly generated).
After install You may use Your web browser to access Nextcloud using local IP address.
Both HTTP and HTTPS protocols are enabled by default (localhost certificate is generated).
If you already have a domain you want to use then you can do so by adding it as an argument to the command that runs the script. Remember, however, that the domain must first be set to your server's IP address, and your network devices (routers) must already be properly configured. Otherwise, SSL certificate generation will fail.
To install use this command:
All available script arguments (you may or may not need to add to the startup command):
-lang – support for multiple languages, currently available: pl (Polish). An option left undefined will simply not add system packages and will not pre-configure Nextcloud (the default operating system language will remain).
-mail – the email address of the administrative account.
-dm – the domain you want to use, the script will configure the web server to make the domain point to Nextcloud, add it as a trusted address for NC itself, and configure the SSL (Let's encrypt) certificate service to make a secure httpS connection work. The domain must already be pre-configured i.e. pointing to the IP address where we are providing the service. The router should also already be pre-configured (that is, redirect traffic from outside to port 80 and 443 of the server on which Nextcloud is running).
-nv – the version of Nextcloud we want to use. Versions available are 24, 25, 26, and 27. Older versions have customized PHP installation and configuration to match the NC version. No option selected will install the latest version of the script for the moment.
Be sure to define arguments after the sum sign (=).
Example use of the script with all options:
It was tested with Nextcloud v24-V27.
V 1.6 – 03.08.2023
– New variable that allows installing older version of Nextcloud (users reported problems with NC27).
– The script rename itself after finished work (so installer command always refer to newest version).
– Script is prepared now for few future updates (up to Nextcloud v28).
V 1.5.5 – 12.07.2023
– Better description of variables use on error.
V 1.5.4 – 07.07.2023
– Fixed some logical problem
– Add support for Debian 12
– Add support for Nextcloud Hub 5 (v27)
V 1.5.3 – 15.04.2023
– using older PHP (8.1) version for upgrade process before removing it (Nextcloud do not finish upgrade process on never PHP version)
– check for currently installed Nextcloud version and update it so many times it needs (till version 26) – when upgrading from script version 1.4 or older
V 1.5.2 – 05.04.2023
– twofactor_webauthn app installing and enabling for more security (tested with Yubikey)
V 1.5.1 – 05.04.2023
– upgrading from 1.4 and lower added to the script
V 1.5 – 25.03.2023
– use Nextcloud Hub 4 (v26)
– enable opcache again (it looks it's working fine now)
– use PHP version 8.2
– install ddclient (dynamic DNS client – https://ddclient.net/)
– install miniupnpc ans start it for port 80 and 443 to open ports (it should be unncessary)
– added more variables to use (language, e_mail)
– installer is now creating file with it's version number for future upgrades
– installer detects if older versions of script were used, and in the next release it will upgrade everything (nextcloud included)
V 1.4.3 – 24.02.2023
– allow self-signed certificate config option in nextcloud (it may be needed sometimes)
V 1.4.2 – 10.02.2023
– completely disable opcache because of many segfaults even when JIT is completely disabled
V 1.4.1 – 08.02.2023
– opcache jit cache in php has been disabled because of many segfaults reported
V 1.4 – 31.01.2023
– fixes thanks to "maybe" user from hejto.pl portal (ufw, redis, chmods etc.) Thank You!
V 1.3 – 30.01.2023
– fix PHP 8.1 installing
– more data stored to log for better error handling
V 1.2 – 23.01.2023
– some performance fixes (better support for large files)
V 1.1 – 04.08.2022
– added support for adding domain name as command line argument (with let's ecnrypt support)
– added crontab job for certbot (Let's encrypt) and some more description
V 1.0 – 20.06.2022
– initial version based on private install script (for EL)