How to Install Nextcloud on Void Linux

Nextcloud is a popular open-source platform for file sharing and collaboration, self-hosting, and data syncing. It offers features like integrated document management, calendar, task management, and more. If you are looking to install Nextcloud on your Void Linux server, this tutorial will guide you through the process.

Prerequisites

Before you start installing Nextcloud, make sure you have the following prerequisites:

Step 1: Update the System

Before you install Nextcloud on your system, make sure that the system is up-to-date. Run the following command to update the system:

xbps-install -Syu

Step 2: Install Required Packages

Nextcloud requires Apache, PHP, and MariaDB to run. To install these packages, run the following command:

xbps-install apache php php-curl php-gd php-json php-mbstring php-mysqlnd php-pdo_mysql mariadb mariadb-client

Step 3: Start MariaDB

Nextcloud uses MariaDB as a database engine. Start MariaDB and enable it to start at system boot:

ln -s /etc/sv/mariadb /var/service/

Step 4: Configure MariaDB

Now that MariaDB is running, you need to configure the root password and create a new database for Nextcloud. Run the following command to configure MariaDB:

mysql_secure_installation

Follow the prompts to set the root password and other security options.

Once you have configured MariaDB, log in to the MariaDB console and create a new database and user for Nextcloud:

mysql -u root -p
CREATE DATABASE nextcloud;
CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextclouduser'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
EXIT;

Step 5: Download and Install Nextcloud

Download the latest Nextcloud release from the official website:

wget https://download.nextcloud.com/server/releases/latest.tar.bz2

Extract the downloaded file to the Apache web root directory, which is "/srv/http/" in Void Linux. Change the ownership of the directory to the Apache user:

tar xjf latest.tar.bz2 -C /srv/http/
chown -R http:http /srv/http/nextcloud/

Step 6: Configure Apache

Create a new virtual host configuration file for Nextcloud:

nano /etc/apache2/vhosts.d/nextcloud.conf

Add the following configuration to the file:

<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot "/srv/http/nextcloud/"
ServerName nextcloud.example.com
<Directory "/srv/http/nextcloud/">
Options +FollowSymlinks
AllowOverride All
Require all granted
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /srv/http/nextcloud
SetEnv HTTP_HOME /srv/http/nextcloud
</Directory>
ErrorLog "/var/log/httpd/nextcloud_error_log"
CustomLog "/var/log/httpd/nextcloud_access_log" combined
</VirtualHost>

Save the configuration file and restart the Apache web server:

sv restart apache

Step 7: Access Nextcloud

Finally, access your Nextcloud installation in your web browser by visiting "http://your-server-ip-address/nextcloud". You should see the Nextcloud setup page.

Follow the instructions to set up your Nextcloud administrator account and configure the database connection.

Congratulations! You have successfully installed Nextcloud on your Void Linux server.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!