How to Install OwnCloud on Ubuntu 16

Try it in our public cloud & Get $50 Credit
CLAIM NOW

Owncloud is a file synchronization and collaboration platform that can run on your own server. Featuring a nice web interface, clients for all major operating systems, and standards-compliant use of APIs and protocols, Owncloud can replace many popular cloud services with a solution that respects autonomy and privacy. In this guide, we’ll install Owncloud on an Ubuntu 16.04 LTS server.

Getting Started

Confirm that you have the following before you follow this guide:
• 1 Node (Cloud Server or Dedicated Server) running Ubuntu 16.
• Root access to the node or one sudo non-root user

If you don't want to go through the whole installation of OwnCloud on your CentOS 7 server, you can always try our One-Click Apps and get a new OwnCloud instance in seconds.

Tutorial

Start by adding the Owncloud package repository. Not only will this be how we install Owncloud, but it will also make upgrades extremely easy later.

nano /etc/apt/sources.list.d/owncloud.list
deb http://download.owncloud.org/download/repositories/stable/Ubuntu_16.04/ /

In order to ensure that the packages we install are official, we’ll also retrieve the GPG key for the Owncloud repository we’ve just added.

wget https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04/Release.key
apt-key add Release.key

With the repository installed and the key added, we must next update our package cache so Owncloud is available.

apt-get update
apt-get install owncloud -y

We’ll use MariaDB as Owncloud’s database server. Install that now.

apt-get install mariadb-server -y

The database server must now be secure. Let’s take care of that.

systemctl start mysql.service
systemctl enable mysql.service
mysql_secure_installation

Owncloud needs a database and MariaDB user to access it. Here we’ll create the necessary database and access credentials.

mysql -u root -p
MariaDB> CREATE DATABASE owncloud;
MariaDB> CREATE USER 'cloud'@'localhost' IDENTIFIED BY 'cloudpassword';
MariaDB> GRANT ALL PRIVILEGES ON owncloud.* TO 'cloud'@'localhost';
MariaDB> FLUSH PRIVILEGES;
MariaDB> exit

Your web server needs permission to write to its document root, as files and other synced content must be persisted to the disk. Here we grant it the necessary access rights.

chown -R www-data. /var/www/owncloud/
systemctl restart apache2.service

Everything is now set up on the server itself. The remaining installation steps are performed via Owncloud’s web-based installer. Visit http://your_ip/owncloud to complete the process.

Start by creating your username and password. Not only will this user be able to sync files and store contacts, but it will also have administrative privileges for Owncloud itself.

Choose MySQL/MariaDB as your database server.

Next you’ll enter the database name, username and password that we set up earlier.

Conclusion

Owncloud is now installed. Next you’ll want to install clients on your desktop and phone, and to sync your contacts and calendars using your new installation. Share this article with any friends who may be interested in hosting their own Dropbox or Google Calendar.