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:
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.
* 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 <IP> 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!