Introduction As a storage application Owncloud is the opensource response to well know products. It works like Dropbox, Onedrive and others only you can install the application on your own servers. In this way you can cope with governance and security issues. Without losing functionality for your end users. As of the latest version you can add a lot of functionality to Owncloud with so called apps. Client software is available for Windows, MAC OSx, Linux, Android and iOS. Installation At this time it is common to use the OpenSuse built packages to install Owncloud on Ubuntu. First we need to get the Release key and accept to use it on your server.

sudo apt-key add - < Release.key

Add the Owncloud repository to the sources list of your server

echo 'deb /' | sudo tee -a /etc/apt/sources.list.d/owncloud.list

Now update the package manager and install Owncloud and MySql server

sudo apt-get update
sudo apt-get install owncloud mysql-server


You will be asked for a MySQL root password during installation. Enter the password you desire and write it down. You’ll need it in this How To. We will now configure MySQL server to be more secure.

sudo mysql_install_db
sudo mysql_secure_installation

After the last command the following questions will be asked: It will ask you to change root password, type “n” for no. It will ask you to remove anonymous users, type “y” for yes. It will ask you to disallow remote root logins, type “y” for yes. It will ask you to remove test database and access to it, type “y” for yes. It will ask you to reload privilege tables, type “y” for yes. The MySQL installation is now more secure. Let’s create a database for owncloud. Sign into MySQL as the root user by typing:

mysql -u root -p

Create the database with:


Create a new user and assign privileges to use the  database for ownCloud:

GRANT ALL ON owncloud.* to 'owncloud'@'localhost' IDENTIFIED BY 'desired_owncloud_mysql_user_password';

Exit MySQL


Apache Configuration Owncloud Data directory

In Ubuntu 14.04 a new version of Apache is installed wich has a changed document root. It changed from /var/www to /var/www/html. We need to move the Owncloud stuff to this new location.

sudo mv /var/www/owncloud /var/www/html

Creating an owncloud.conf file

Create a new owncloud config file in the sites-available of apache2.

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

Paste the following in the config file if you use a Name Based Virtual Host ( > change name accordingly)

<VirtualHost *:80>
ServerAdmin admin@localhost
 DocumentRoot /var/www/html/owncloud
ErrorLog ${APACHE_LOG_DIR}/error.log
 CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html/owncloud>
AllowOverride All
 Require all granted

Link the config file to sites-enabled

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

Unlink the default config files from apache

sudo unlink /etc/apache2/sites-enabled/000-default.conf

Restart the apache2 service

sudo service apache2 restart

Configuring the Owncloud through the Web interface

Open your owncloud server in a webbrowser:

You will need to add the correct information and create a new owncloud admin with password.

user: owncloudadmin (you may choose the name you like)
password: xxxxxxxxxx (choose a password you like)
data folder: /var/www/html/owncloud/data
Select the MySQL database
mysql owncloud user: owncloud
mysql owncloud password: [enter the password you created before]
mysql databasename: owncloud
mysql server: localhost

Press Finish Setup and you should have a working Owncloud Server on Ubuntu 14.04