How to install Owncloud 10 on Debian 9

owncloud debian 9

Debian Tutorial – Today’s tutorial we will show you how to install Owncloud 10 on Debian 9 Stretch. Owncloud 10 has been released a while ago with so many features and bug fixes. Owncloud is a popular cloud and file sharing appliance that can be easily installed on Linux based server such as Debian. Install Owncloud on Debian 9 is very easy and there are many tutorial describing how to install Owncloud on Debian 9 server.

Owncloud Debian is a great combination that provide a reliable system. If you are running Ubuntu, the following tutorial to install Owncloud 10 on Debian 9 also applicable to Ubuntu 16.04 or Ubuntu 17.04 with some modifications.

Steps to install Owncloud 10 on Debian 9

  • Update System
  • Install LAMP Server on Debian 9
  • Install Owncloud 10
  • Owncloud configuration via web browser

Step 1. Update System

I assume you connect to the Debian 9 Server via SSH or Terminal. Now we need to update our Debian system first prior to the next steps.

apt update && apt upgrade

Step 2. Install LAMP Server on Debian 9

Now we need to install and configure LAMP Server on Debian 9. Please read our previous tutorial to install LAMP Server on Debian 9. Additionally, we need to create a new MySQL database and user

root@debian-vm:/tmp# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.1.23-MariaDB-9+deb9u1 Debian 9.0

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database owncloud;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> create user owncloud@localhost identified by '12345';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> grant all privileges on owncloud.* to owncloud@localhost identified by '12345';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit;

Step 3. Install Owncloud

Install additional packages

We need to install some additional packages required by Owncloud Server

apt install -y apache2 mariadb-server libapache2-mod-php7.0 \
    php7.0-gd php7.0-json php7.0-mysql php7.0-curl \
    php7.0-intl php7.0-mcrypt php-imagick \
    php7.0-zip php7.0-xml php7.0-mbstring

Download Owncloud 10 package. For newer version, please check at:

cd /tmp

Extract Owncloud and change the permission

tar -xvf owncloud-10.0.2.tar.bz2
chown -R www-data:www-data owncloud

It will produce a new directory called owncloud. We need to move this directory to /var/www/html/ directory

mv owncloud /var/www/html/

Configure Apache Web Server

Create a new configuration file under /etc/apache2/sites-available

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

And then paste these lines

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

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

 <IfModule mod_dav.c>
  Dav off

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


Create symlink

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

Additional apache configuration

Execute these commands to enable some modules

a2enmod headers
a2enmod env
a2enmod dir
a2enmod mime

Step 4. Configure Owncloud via web browser

Now open a web browser and type the following address. Don’t forget to change the IP address with your IP address server

And you will see the following Owncloud configuration windows

owncloud web config

Enter the details required on that page and click Finish. You must use the database name and user name we created on the previous step.

Finally, Owncloud 10 on Debian 9 is now ready for use

install owncloud 10 on debian 9

Update: New Owncloud 10.0.3 is now available for Download


  1. I hope you can help. When trying to complete the set-up via the web interface I am not succeeding. I get an error SQLSTATE Connection Refused. I suspect this is because I have not used the correct credentials.

    For the beginner there is a lot of detail here, between Unix log-in names and passwords, MySQL usernames and passwords and then (I assume!) owncloud’s own (admin) username and password. I understand that some of these must be local and hence private.

    It would help no end if you could spell out, field by field, what I should type assuming that I have followed every step above correctly.

    That said, this is the most helpful tutorial I have found so far – just one more fence to jump!

  2. Great tutorial.
    Only blind spot is that in the last step dbuser and password are not recalled.
    I for example did not know that IDENTIFY is the password definition command.
    Why not put user, password & dbname the values in the last screenshot?
    Thanks a lot for your work

2 Trackbacks / Pingbacks

  1. How to enable SSL on Owncloud 10 installed on Debian 9 - Free Linux Tutorials
  2. New Owncloud 10.0.3 is now available for Download

Leave a Reply