How to Install OwnCloud in Debian 10

Owncloud is a market-leading online file sharing system that lets you back up and shares your files with ease. If you are not a fan of DropBox or Google Drive, then OwnCloud is a cool alternative.

In this article, we walk you through the installation of OwnCloud in Debian 10.

Step 1: Install LAMP Stack on Debian

Since OwnCloud runs on the browser and the back-end too by storing data on the database, we need to first install the LAMP stack. LAMP is a popular free and open-source hosting stack used by developers for hosting their web applications. It stands for Linux, Apache, MariaDB / MySQL, and PHP.

First, let’s update system repositories.

$ sudo apt update && sudo apt upgrade
Update Debian System Packages

Update Debian System Packages

Next, install the Apache web server and MariaDB database server by running the command.

$ sudo apt install apache2 mariadb-server mariadb-client
Install Apache and MariaDB

Install Apache and MariaDB

After the installation is complete, proceed and install PHP 7.2. At the time of penning down this guide, PHP 7.3 is not yet supported, so our best shot is using PHP 7.2.

So, enable the PHP repository as shown.

$ sudo wget -O /etc/apt/trusted.gpg.d/php.gpg
$ sudo echo "deb $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list

Once you are done creating the repository for PHP, update your system packages & repositories for the new PHP repository to take effect.

$ sudo apt update

Now install PHP and the required dependencies as shown.

$ sudo apt install php7.2 libapache2-mod-php7.2 php7.2-{mysql,intl,curl,json,gd,xml,mb,zip}
Install PHP in Debian

Install PHP in Debian

Once installed, check the PHP version using the command.

$ php -v

Also, verify that the Apache webserver is running by running the command.

$ systemctl status apache2

If Apache is up and running, you should get output similar to the one shown below, indicating that it is ‘active’.

Check Apache Status in Debian

Check Apache Status in Debian

If Apache is not started, start and enable it on boot by running the commands.

$ systemctl start apache2
$ systemctl enable apache2

Step 2: Create a Database for OwnCloud Files

The next step will be to create a database to handle OwnCloud’s files during and after the installation.

Login to the MariaDB server.

$ mysql -u root -p

Once logged in, create a database for OwnCloud.

MariaDB [(none)]> CREATE DATABASE owncloud;

Create a user for the OwnCloud database and grant all privileges to the user.

MariaDB [(none)]> GRANT ALL ON owncloud.* TO 'owncloud_user'@'localhost' IDENTIFIED BY '[email protected]';

Finally, flush privileges and exit.

MariaDB [(none)]> EXIT;
Create OwnCloud Database

Create OwnCloud Database

Step 3: Install OwnCloud in Debian

By default, OwnCloud is not included in Debian 10 repositories. Nevertheless, OwnCloud maintains a repository for each distribution. The repository for Debian 10 has not yet been released, and therefore, we will use the repository of Debian 9.

First, install the PGP signing key.

$ sudo curl | apt-key add -

Once the signing key is installed, go ahead and enable OwnCloud’s repository.

$ sudo echo 'deb /' > /etc/apt/sources.list.d/owncloud.list

Once again update your system to resynchronize the system packages and install Owncloud.

$ sudo apt update
$ sudo apt-get install owncloud-files

Step 4: Configure Apache for OwnCloud

Upon installation, OwnCloud stores its files in the /var/www/owncloud directory. We, therefore, need to configure our web server to serve OwnCloud’s files.

So, create a virtual host file for Owncloud as shown.

$ sudo vim /etc/apache2/sites-available/owncloud.conf

Add the configuration below and save.

Alias / "/var/www/owncloud/"

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

 <IfModule mod_dav.c>
  Dav off

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


To enable the OwnCloud site, just as you would any virtual host run the command:

$ sudo ln -s /etc/apache2/sites-available/owncloud.conf /etc/apache2/sites-enabled/

Next, enable additional Apache modules that are required by OwnCloud and restart the Apache webserver to reload the configuration and effect the changes.

$ sudo a2enmod rewrite mime unique_id
$ sudo systemctl restart apache2

Step 5: Finalizing OwnCloud Installation

To complete OwnCloud setup, browse your server’sIP address as shown below:


The welcome interface will greet you as shown. You will be required to provide the username and password.

Create Owncloud Admin Account

Create Owncloud Admin Account

Next, click on the ‘Storage and database’ and provide the database details such as database user, database name and password.

Add OwnCloud Database Settings

Add OwnCloud Database Settings

Finally, click on ‘Finish Setup’.

Finish OwnCloud Setup

Finish OwnCloud Setup

This takes you to the login page. Enter your username and password and hit ENTER.

Owncloud Admin Login

Owncloud Admin Login

Initially, you will get a pop-up with information about OwnCloud’s Desktop, Android and iOS app that you can install on your devices. This allows you to access your data on the go.

OwnCloud Device Apps

OwnCloud Device Apps

Here’s the dashboard.

OwnCloud Dashboard Window

OwnCloud Dashboard Window

And we have finally come to the end of this tutorial. You can now save and share your files with ease using OwnCloud. Thanks for taking the time.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

James Kiarie

This is James, a certified Linux administrator and a tech enthusiast who loves keeping in touch with emerging trends in the tech world. When I'm not running commands on the terminal, I'm taking listening to some cool music. taking a casual stroll or watching a nice movie.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide
The Complete Linux System Administrator Bundle
Become an Ethical Hacker Bonus Bundle

You may also like...

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.