How to Install ownCloud on Debian

In this tutorial, we will guide you through the process of installing ownCloud on Debian. OwnCloud is an open-source, self-hosted cloud storage platform that allows you to store, manage, and share your files, contacts, and calendar with others.

Prerequisites

Step 1: Install Required Packages

The first step is to update your system packages to ensure you have the latest version. To do this, run the update command:

sudo apt update

Once the update process is complete, install the required packages for ownCloud:

sudo apt install apache2 mariadb-server libapache2-mod-php7.4 openssl php-imagick php7.4-common php7.4-curl php7.4-gd php7.4-imap php7.4-intl php7.4-json php7.4-ldap php7.4-mbstring php7.4-mysql php7.4-pgsql php-smbclient php-ssh2 php7.4-sqlite3 php7.4-xml php7.4-zip php7.4-fpm php-apcu redis-server curl wget zip tar bzip2 unzip

Step 2: Create Database and User

Next, you need to create a database and user for ownCloud. The below mentioned queries will help you in achieving the same:

mysql -u root -p

Enter your MySQL root user password to log in.

CREATE DATABASE owncloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
GRANT ALL PRIVILEGES ON owncloud.* TO 'ownclouduser'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
EXIT;

Change the password to a strong password of your choice.

Step 3: Download ownCloud

You can download the latest version of ownCloud from their official website at https://owncloud.org/download/.

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

Once the download is complete, extract the downloaded archive:

tar xjf owncloud-latest.tar.bz2

Copy the OwnCloud files to /var/www/html/ directory:

sudo cp -r owncloud /var/www/html/

Step 4: Configure Apache

Create a new Apache configuration file for OwnCloud:

sudo nano /etc/apache2/sites-available/owncloud.conf

And add the below content to it.

<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/owncloud/
ServerName example.com

Alias /owncloud "/var/www/html/owncloud/"

<Directory /var/www/html/owncloud/>
Options +FollowSymlinks
AllowOverride All

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

SetEnv HOME /var/www/html/owncloud
SetEnv HTTP_HOME /var/www/html/owncloud

</Directory>
ErrorLog ${APACHE_LOG_DIR}/owncloud_error.log
CustomLog ${APACHE_LOG_DIR}/owncloud_access.log combined
</VirtualHost>

Save and close the file.

Enable the new Apache configuration:

sudo a2ensite owncloud.conf

Reload Apache to apply the changes:

sudo systemctl reload apache2

Step 5: Access OwnCloud

Open your web browser and navigate to http://localhost/owncloud or your server’s IP or domain name/owncloud.

A page like setup-owncloud.png will appear.

Step 6: Set up OwnCloud

Follow the setup wizard to set up your ownCloud instance.

You will be asked to create an administrative user, select a storage directory, configure your database settings, and more. Enter your database name, username, and password that you created in Step 2.

Once the installation is complete, log in to your ownCloud instance.

Conclusion

You have successfully installed and configured OwnCloud on the Debian system. You can start using it as your private cloud file storage application.

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!