How to Install ownCloud on Void Linux

In this tutorial, we will walk you through the steps to install ownCloud on Void Linux. The process is simple and straightforward.

Prerequisites

Before we start, make sure your Void Linux system is up to date:

sudo xbps-install -Su

Step 1: Install Apache

ownCloud is a web-based software, so we need a web server. We will use Apache HTTP server.

sudo xbps-install -S apache

After installing Apache, start and enable the service:

sudo ln -s /etc/sv/httpd /var/service/

Step 2: Install PHP

ownCloud is written in PHP. We will need to install PHP and some required extensions.

sudo xbps-install -S php php-fpm php-curl php-gd php-dom php-zip php-mbstring php-intl php-xml php-json

After installing PHP, start and enable the PHP-FPM service:

sudo ln -s /etc/sv/php-fpm /var/service/

Step 3: Install MySQL

ownCloud uses a MySQL database to store its data. We will need to install MySQL server and client.

sudo xbps-install -S mariadb mariadb-client

After installing MySQL, start and enable the service:

sudo ln -s /etc/sv/mysql /var/service/

Step 4: Create a MySQL Database

Now we need to create a MySQL database for ownCloud. Log in to the MySQL shell:

mysql -u root -p

Create a new database:

mysql> CREATE DATABASE owncloud;

Create a new user and grant all privileges to the ownCloud database:

mysql> CREATE USER 'owncloud'@'localhost' IDENTIFIED BY 'password';
mysql> GRANT ALL ON owncloud.* TO 'owncloud'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> EXIT;

Replace password with a strong password of your choice.

Step 5: Install ownCloud

Now we can install ownCloud. Download the latest version from the official website:

wget https://download.owncloud.org/community/owncloud-x.x.x.tar.bz2

Replace x.x.x with the current version number.

Extract the archive:

tar -xvf owncloud-x.x.x.tar.bz2

Move the extracted directory to the document root of Apache:

sudo mv owncloud /srv/http/htdocs/

Change the ownership of the ownCloud directory to the web server user:

sudo chown -R http:http /srv/http/htdocs/owncloud/

Step 6: Configure ownCloud

We need to configure ownCloud by creating a configuration file. Copy the sample configuration file:

cp /srv/http/htdocs/owncloud/config/config.sample.php /srv/http/htdocs/owncloud/config/config.php

Edit the configuration file:

sudo nano /srv/http/htdocs/owncloud/config/config.php

Replace the default values with your own settings. Set the database name, username and password that you created in Step 4:

'dbname' => 'owncloud',
'dbuser' => 'owncloud',
'dbpassword' => 'password',

Save and close the file.

Step 7: Configure Apache

We need to configure Apache to serve ownCloud. Create a new Apache configuration file:

sudo nano /etc/httpd/conf.d/owncloud.conf

Add the following content:

Alias /owncloud "/srv/http/htdocs/owncloud/"

<Directory /srv/http/htdocs/owncloud/>
  Options +FollowSymlinks
  AllowOverride All

 <IfModule mod_dav.c>
  Dav off
 </IfModule>

  SetEnv HOME /srv/http/htdocs/owncloud
  SetEnv HTTP_HOME /srv/http/htdocs/owncloud

</Directory>

Save and close the file.

Restart Apache:

sudo sv restart httpd

Step 8: Access ownCloud

Now you can access ownCloud from a web browser by visiting the address http://localhost/owncloud/. You will be prompted to create an admin account and choose a data directory.

Congratulations, you have successfully installed ownCloud on Void Linux!

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!