How to install ownCloud 8 on Debian 8 (Jessie)

What is ownCloud? OwnCloud is a OpenSource file sync and share software that can be hosted on your own server. It provides access to files trough an intuitive web interface and by WEBDAV. There are also native clients for Windows, Linux, MAC and mobile operating systems available that allow easy syncing between folders of your local PC or mobile device and the ownCloud instance on your server. There are many apps and addons available for ownCloud like a PDF viewer, an email client, calendar and a task tracker. The full list of apps can be found here:

This tutorial will show the installation of the latest ownCloud version on Debian 8.

The ownCloud project provdes an offficially maintained community version of its software at the OpenSuSE Build services. I will use this official package for this setup as it provides a more recent version (ownCloud 8 as of today) then the one from the official Debian repository (version 7).

Add the ownCloud Repository

Add the ownCloud repository in the /etc/apt/sources.d/ directory:

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

Install the release key of the official ownCloud repository:

cd /tmp
apt-key add - < Release.key

And run apt-get update to download the list of packages.

apt-get update

Check out available ownCloud packages

Let's check which packages we have for owncloud now:

apt-cache search owncloud

The repository provides many ownCloud apps like PDF viewer, file encryption, a versioning system, etc. beside the ownCloud base package.

Install ownCloud

I will start with the installation of the base package by executing this command as root user on the shell:

apt-get install owncloud

The "owncloud" package will install all required dependencies like apache webserver, php, mysql etc.

Choose "y" to start the installation.

The installation process will ask for a new MySQL root password. Choose a secure password here:

And enter the password a second time:

Add a MySQL database

The next step is to create a MySQL database for owncloud.

Login to MySQL on the commandline by running this command:

mysql --defaults-file=/etc/mysql/debian.cnf

This opens up the MySQL commandline prompt:

Enter the following sql commands to create a database user with the name "owncloud" and and a database of the same name. Replace the word "mysecurepassword" with your own password in the commands.

CREATE USER [email protected] IDENTIFIED BY 'mysecurepassword';
GRANT ALL PRIVILEGES ON owncloud.* TO [email protected];
flush privileges;

Create a data directory for ownCloud to store the uploaded files the file. Choose a directory on your largest disk partition for this. I will use the directory /var/owncloud here.

mkdir /var/owncloud
chown www-data:www-data /var/owncloud
chmod 750 /var/owncloud

When the shell part of the installation is finished, proceed by opening the ownCloud web installer in your browser. The URL is http://[YOURIP]/owncloud. In my case the IP is so I enter in my browser to get the installer:

Enter the desired administrator username and password in the login fields. Please choose a secure password and also a username that is not "admin" or "administrator" might be a good choice to make it less easy for attackers to guess your admin login.

I dont like my private files to be stored in the website root /var/www, so I choose the folder /var/owncloud here.

OwnCloud is using sqlite as storage engine by default. This is not a good choice performace wise, so I will choose MySQL as database backend. We have created a MySQL database above, enter the details of that database now:

  • Username:         owncloud
  • Password:          The password that you have choosen for the database.
  • Database name: owncloud
  • Hostname:         localhost

Then click on the button to finish the installation. You will get greeted with a welcome screen in your language.

Access ownCloud with SSL (https)

The default installation of ownCloud is not secured by SSL. To enable SSL in your webserver, run these commands:

a2enmod ssl
a2ensite default-ssl
service apache2 restart

Now you can access the web interface with https://[YOURIP]/owncloud. You will probably get a SSL warning, this warning should be accepted. To avoid such warnings, get a free officially signed SSL certificate e.g. from Startssl (or in a few months from LetsEncrypt when their free service started).

OwnCloud VMWare Image in ovf/ova format

This tutorials can be downloaded as ready to use image in ovf/ova format by howtoforge subscribers. This format is a vendor neutral VM Format which is supported by VMWare and Virtualbox.

Download of the VM

Login details of the VM


Username: root
Password:  howtoforge

Owncloud login:

Username: howtoforge
Password:  howtoforge

Please change the passwords on first use.

The IP address of the VM is The IP, netmaks and Gateway can be changed in the file /etc/network/interfaces.

Share this page:

12 Comment(s)

Add comment


From: Christopher Shaw

I gave this a try the other week, its good as a basic file sync but the addons available dont currenty work for version 8. I was looking to set up a Google Drive experience where There is a full feature document editor as I only use GDrive for upading certain docs. Apart from the lack of workable addons, its a good and easy to use system Thanks Christopher Shaw

From: Doug

Something is different. Changed only the [email protected]' to [email protected]' and get "MySQL/MariaDB username password not valid. (I suspect something in Apache config is different.) Fresh Jessie install (basic system tools and ssh server), nothing else but owncloud.


From: Noah

Give this man a cookie! Works like a charm :D

From: Doug

Still no luck. Fresh install. Issue commands on a separate machine after SSH into server, and a SU to be root.

MySQL commands all accepted, created the /var/owncloud directory, changed permissions, ......

Still on separate machine I go to http://192.168.1.x/owncloud and enter everything but get "Username and/or password not valid. You need to enter either an existing account or the administrator."

Have tried SQL root / password, putting passwords in quotes (').

Have tried opening a browser on the owncloud server and same error. Using Mac, tried a Windows, Safari, Chrome.

(Long ago I successfully installed version 6 or 7 on Debian 7)

Can you suggest logs to check? or .....

From: doug

OK, its works. I think the administrative login needs to be an existing user on the owncloud server. (duh) With the passwords displayed, failure, with just the dots showing, it worked. Or maybe I just can't read or type :)

From: Waldo

Good article. Works fine in debian 8 template of proxmox 4.

From: Rick


From: Max Gizzmo

Absolut great and fantastic tutorial. Very very nice job!

From: josse34

Thanks, very simple!

Impossible for mine to use owncloud user concerning MySQL, i have to create another user.


How to force HTTPS ?

How to configure MemCache?



From: Bas

Exellent tutorial! Thank you Till Brehm! I'll use this article as my basis for a dutch translation if that's OK.

From: Bertrand

Can we use this tutorial after mounting the "Perfect Server"?

"apt-get install owncloud" dropped to apache :/

From: doughstone

two times i get very easy tutorial from howtoforge sites, first is OpenLDAP installation on Debian Machine, the second is this tutorial. two thumbs up for