2.5 KiB
Setup Nextcloud
Now that we have a vanilla OpenSUSE machine, we can see how easy it is to install Nextcloud. These instructions follow the old school LAMP method, but the other methods such as the AIO container methods will also work. This quick demo does not cover any extra performance tuning or hardening beyond getting an install up and running.
Setup Web Server
This demo will utilize Apache as a web server. It is also possible, and in some cases preferable, to use nginx or caddy to serve Nextcloud.
Here are the steps to install and configure Apache for Nextcloud:
sudo -i
to get root access- Install Apache/PHP:
zypper in -y apache2 apache2-mod_php8 php8-exif php8-gd php8-fpm php8-mysql php8-curl php8-intl php8-zip php8-mbstring php8-zlib php8-openssl php8-fileinfo php8-pcntl php8-posix
Enable apache modules:
- a2enmod php8
- a2enmod rewrite
- a2enmod headers
Enable the apache service: systemctl enable --now apache2
Setup the Database
There are two options for this demo for setting up the database. MariaDB (mysql-flavor) and sqlite. mariadb performs significantly better but sqlite is easier and sufficient for an install demo.
MariaDB
Installing mariadb on OpenSUSE is very easy: zypper in -y mariadb
Start the service: systemctl enable --now mariadb
Now, set a database root password: /usr/bin/mysqladmin -u root password
Next, create the database:
- Start the mysql client:
mysql -u root -p
- Create the nextcloud database:
CREATE DATABASE nextclouddb
- Create/grant the nextcloud user:
GRANT ALL ON nextclouddb.* TO nextcloud@localhost IDENTIFIED BY 'SecurePasswordHere';
- Obviously, change this password. And remember these credentials, since we'll need them in the nextcloud setup.
SQLite
Install sqlite: zypper in -y sqlite3
.
That's it :-).
Install Nextcloud
Install Nextcloud via the PHP installation script:
cd /srv/www/htdocs
wget https://download.nextcloud.com/server/installer/setup-nextcloud.php
- Set the proper ownership of the docroot:
chown -R wwwrun /srv/www/htdocs/
Now run the installer in browser by going to http://<IP>/setup-nextcloud.php
(Replace with your VM's IP.) After picking the path, you'll be prompted to create an admin user and connect to the database that you set up in the previous step.
CONGRATS! You've just installed Nextcloud in Harvester!
Next step: Next Steps