Install ownCloud 9.1 on Ubuntu 16.04

Published on: Mon, Feb 5, 2018 at 4:47 pm EST
Linux Guides Server Apps Ubuntu

OwnCloud is an open source Dropbox-like cloud based file hosting service that allows you to store your personal content. OwnCloud's cross platform compatibility allows you to access your files anywhere; and because it runs on your own VPS, it eliminates the need for a third party cloud hosting service.

This guide was written for ownCloud 9.1, but may also work on newer releases with minor command changes.

Prerequisites

This tutorial assumes that you have already setup a fresh Vultr Cloud Compute instance with Ubuntu 16.04 and root access.

Step 1: Install LAMP

OwnCloud requires a PHP-enabled webserver and a MySQL database. Before you can install ownCloud, you will need to install a LAMP stack.

Update the repository list.

apt-get update

Install the Apache webserver.

apt-get install apache2 -y

Begin the MySQL installation.

apt-get install mysql-server php7.0-mysql -y

During the installation, you will be prompted for a password. Enter a safe password. This will be your MySQL root password. Complete the MySQL installation.

/usr/bin/mysql_secure_installation

Enter your MySQL root password when asked and continue through the installation process.

Would you like to setup VALIDATE PASSWORD plugin? [Y/N] N
Change the root password? [Y/N] N
Remove anonymous users? [Y/N] Y
Disallow root login remotely? [Y/N] Y
Remove test database and access to it? [Y/N] Y
Reload privilege tables now? [Y/N] Y

Next, you need to install PHP, along with the PHP modules required by ownCloud.

apt-get install php7.0 libapache2-mod-php7.0 php7.0-bz2 php7.0-curl php7.0-gd php-imagick php7.0-intl php7.0-mbstring php7.0-xml php7.0-zip -y

Step 2: Create a MySQL database

OwnCloud requires a MySQL database. To create a database, login to the MySQL console.

mysql -u root -p

Enter the MySQL root password you created earlier when asked. Once you are logged in to the MySQL console, create a new database for ownCloud.

mysql>CREATE DATABASE owncloud;

Create a new MySQL user and grant it privileges to the newly created ownCloud database. You can replace username and password with the username and password of your choice.

mysql>GRANT ALL PRIVILEGES on owncloud.* to 'username'@'localhost' identified by 'password';
mysql>FLUSH PRIVILEGES;

Exit the MySQL console.

mysql>exit

Step 3: Download & Install ownCloud

With all the dependencies installed and configured, you can now begin installing ownCloud. Start by adding the ownCloud repository to apt.

sudo wget -nv https://download.owncloud.org/download/repositories/9.1/Ubuntu_16.04/Release.key -O Release.key
sudo apt-key add - < Release.key
sudo sh -c "echo 'deb http://download.owncloud.org/download/repositories/9.1/Ubuntu_16.04/ /' > /etc/apt/sources.list.d/owncloud.list"
sudo apt update

Install ownCloud.

sudo apt install owncloud -y

Step 4: Complete the ownCloud Installation

Once the installation is complete, you can proceed to the ownCloud browser installer to configure the installation. Open a browser window on your computer and navigate to http://{your-server-address}/owncloud. This will launch the browser installer. Enter an administrator username and password of your choice.

Next, click on Storage & database, and then on the MySQL/MariaDB tab. Enter your MySQL database information here. This should match what you entered while creating the database in Step 2.

Click on the Finish Installation button once you have entered the MySQL database information. You will be redirected to the main ownCloud interface.

You have successfully installed ownCloud on an Ubuntu 16.04 VPS and can begin uploading files to your self-hosted cloud server.

Want to contribute ?

You could earn up to $300 by adding new articles