ownCloud is a popular open source enterprise web application used for data synchronization and file sharing. It allows users to easily manage their files, contacts, calendars, to-do lists, and more, making it a great alternative to to the popular Google Drive, Dropbox, iCloud, etc. cloud platforms. ownCloud is a cross-platform application and supports all popular operating systems, but this tutorial was written especially for Ubuntu 16.04. At the time of writing the latest ownCloud version is 10.0.7.
- PHP >= 5.6 (PHP 7.0 or above is recommended), with the following PHP extensions enabled: XML (Expat), curl, PDO, Phar, GD Graphics Library version 2.0.x+, DOM, ctype, JSON, iconv, intl, mcrypt, openssl, bz2, Zlib and Zip.
- Apache Web Server >= 2.0 compiled with mod_rewrite module
- MySQL >= 5.x (MySQL 5.5 or later is recommended), MariaDB 5.5+, PostgreSQL, or SQLite installed on your Linux virtual server.
2. Update the system
As usual before installing any system packages on your server, update the system first:
# sudo apt-get update && apt-get upgrade
3. Install ownCloud
Download the repository key using the wget command and import it with the apt-key command:
# wget -qO- https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04/Release.key | sudo apt-key add - OK
Make sure apt-transport-https is installed as we are going to need it for the next step:
# sudo apt-get install apt-transport-https Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: aspell aspell-en dictionaries-common emacsen-common libaspell15 libexttextcat-2.0-0 libexttextcat-data liblua5.1-0 libyajl2 Use 'apt autoremove' to remove them. The following NEW packages will be installed: apt-transport-https 0 upgraded, 1 newly installed, 0 to remove and 54 not upgraded. Need to get 26.1 kB of archives. After this operation, 215 kB of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 apt-transport-https amd64 1.2.26 [26.1 kB] Fetched 26.1 kB in 0s (60.8 kB/s) Selecting previously unselected package apt-transport-https. (Reading database ... 35616 files and directories currently installed.) Preparing to unpack .../apt-transport-https_1.2.26_amd64.deb ... Unpacking apt-transport-https (1.2.26) ... Setting up apt-transport-https (1.2.26) ...
Create a owncloud.list file in /etc/apt/sources.list.d so we can add the ownCloud repository to the server:
# echo 'deb https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04/ /' | sudo tee /etc/apt/sources.list.d/owncloud.list deb https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04/ /
Now update the system packages again so we can install the ownCloud packages:
# sudo apt-get update Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease Hit:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease Hit:3 http://archive.canonical.com/ubuntu xenial InRelease Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease Ign:5 https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04 InRelease Get:6 https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04 Release [986 B] Get:7 https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04 Release.gpg [481 B] Get:8 https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04 Packages [736 B] Fetched 2203 B in 2s (1030 B/s) Reading package lists... Done
Install ownCloud by executing the following command:
# sudo apt-get install owncloud-files Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: owncloud-files 0 upgraded, 1 newly installed, 0 to remove and 51 not upgraded. Need to get 0 B/35.1 MB of archives. After this operation, 118 MB of additional disk space will be used. Selecting previously unselected package owncloud-files. (Reading database ... 35869 files and directories currently installed.) Preparing to unpack .../owncloud-files_10.0.7-1.1_all.deb ... Unpacking owncloud-files (10.0.7-1.1) ... Setting up owncloud-files (10.0.7-1.1) ...
We can proceed to the next step now.
4. Create a MySQL database for ownCloud
Log into MySQL with the root account:
# mysql -u root -p
Now we will create a MySQL database for ownCloud using the following query:
mysql> CREATE DATABASE owncloud;
Then execute the following query to add a separate user for ownCloud that will interact with the database:
mysql> GRANT ALL PRIVILEGES ON owncloud.* to 'owncloud'@'localhost' IDENTIFIED BY 'enter_username_password_here';
Execute the following command to apply the privileges we set:
mysql> FLUSH PRIVILEGES;
Now we can exit the MySQL session:
5. Configure ownCloud
First make sure the following packages are installed as they are needed by ownCloud:
# sudo apt-get install libapache2-mod-php7.0 \ openssl php-imagick php7.0-common php7.0-curl php7.0-gd \ php7.0-imap php7.0-intl php7.0-json php7.0-ldap php7.0-mbstring \ php7.0-mcrypt php7.0-mysql php7.0-pgsql php-smbclient php-ssh2 \ php7.0-sqlite3 php7.0-xml php7.0-zip
6. Configure Apache to server ownCloud
Now we will have to setup the Apache configuration so it can serve the ownCloud directory, add the following contents below to the /etc/apache2/sites-available/owncloud.conf file with nano or your favorite editor:
# sudo nano /etc/apache2/sites-available/owncloud.conf Alias /owncloud "/var/www/owncloud/" <Directory /var/www/owncloud/> Options +FollowSymlinks AllowOverride All <IfModule mod_dav.c> Dav off </IfModule> SetEnv HOME /var/www/owncloud SetEnv HTTP_HOME /var/www/owncloud </Directory>
Enable the following Apache modules:
# sudo a2enmod rewrite # sudo a2enmod headers # sudo a2enmod env # sudo a2enmod dir # sudo a2enmod mime
Enable the Apache ownCloud configuration:
# sudo a2ensite owncloud.conf
Now restart the Apache web server:
# sudo systemctl restart apache2
Open your web browser and type in the following URL to access the ownCloud web interface:
From here you can finish the setup by following the steps below:
- Enter a username and password for the admin account.
- Click on the Storage & database link.
- Leave the default data folder setting.
- Click the MySQL/MariaDB button.
- Populate the fields with the database information we set above.
- Click Finish Setup.
That’s it, now you should have successfully installed ownCloud 10 on your server.
Of course, you don’t have to install and configure ownCloud 10 on a Ubuntu 16.04 VPS, if you use one of our ownCloud VPS Hosting solutions, in which case you can simply ask our expert Linux admins to install and configure ownCloud 10 on Ubuntu 16.04 for you. They are available 24×7 and will take care of your request immediately. You might want to consider reading our guide on How to Install NextCloud 14 on Ubuntu 16.04.
PS. If you liked this post on how to install and configure ownCloud 10 on a Ubuntu 16.04 VPS, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.