How to Install and Configure ownCloud with Apache on Ubuntu

ownCloud is an open-source collection of client-server software for creating file hosting servers. This tutorial is about how to configure OwnCloud on Ubuntu.

How to Install and Configure ownCloud with Apache on Ubuntu?


OwnCloud is free and popular robust open source enterprise web application written in PHP that’s used for data synchronization and file sharing. It also allows you to easily manage data files, contacts, calendars, to do lists and many more. It is a great alternative to the most popular cloud platforms such as Google Drive, Dropbox, iCloud, and other cloud storage services out there. But unlike the other cloud storage services, OwnCloud is free to create own host cloud.

ownCloud is an open source private cloud software that provides data access using web interface to create a private cloud. It enables you to create your own file sharing server where you can easily view and sync calendar events, archives, pictures, recordings, tasks, address books with bookmarks, similar to Dropbox and Google Drive. It also provides options to sync and share data across devices all under your control. Install and configure ownCloud supports your data synced for desktop clients as well as mobile app devices. Moreover, You can easily implement user and group access restrictions on files per user using ownCloud on Ubuntu. OwnCloud is a cross platform application and can be installed on all popular operating systems.

This tutorial will help you to install and configure ownCloud on Ubuntu LTS systems.

  • Install LAMP Server
  • Download ownCloud
  • Create MySQL Database and User
  • Install ownCloud
  • Conclusion

Step 1: Install LAMP Server

To setup own cloud server and how to create a private cloud, we first need to set up a running LAMP server. If you have already installed and running LAMP stack, skip this step else use the followings commands to set up the LAMP on your Ubuntu system.

Install PHP

You can install PHP 5.6 or higher version on your Ubuntu or Debian system by running commands:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y php php-gd php-curl php-zip php-dom php-xml php-simplexml php-mbstring

Install Apache2

Apache is the most widely used open-source web server software. Next, install the Apache Web Server on Ubuntu by running:

sudo apt-get install -y apache2 libapache2-mod-php

Install MySQL

MySQL open-source relational database management system is a component of the LAMP web application software stack and others. Now installing MySQL on Ubuntu by running below:

sudo apt-get install -y mysql-server php-mysql

Step 2: Download ownCloud on Ubuntu

After successfully configuring lamp server on your Ubuntu system, Let’s download latest ownCloud private cloud storage solution setup from its official website.

cd /tmp

After download owncloud server software has completed, now extract the downloaded archive under website document root and setup appropriate permissions on files and directories by running.

cd /var/www/html
sudo tar xjf /tmp/owncloud-10.4.0.tar.bz2
sudo chown -R www-data:www-data owncloud
sudo chmod -R 755 owncloud

Now, remove the archive file and restart apache server.

sudo rm -f /tmp/owncloud-10.4.0.tar.bz2
sudo systemctl restart apache2

Step 3: Create Owncloud Database and User

After extracting code, now let’s create a MySQL database and user account for configuring ownCloud. Use following set of commands to login to MySQL server to create ownCloud database and user.

mysql -u root -p
Enter password:

mysql> CREATE DATABASE owncloud;
mysql> GRANT ALL ON owncloud.* to 'owncloud'@'localhost' IDENTIFIED BY '_password_';
mysql> quit

Next, we need to install ownCloud on ubuntu from the web interface to create a private cloud.

Step 4: Install ownCloud on Ubuntu

Now access the ownCloud web panel directory on a web browser. Change localhost to your server IP address or domain name.


You should see the open source owncloud login page. Enter new admin username and password credentials to create an admin account and provide the location of the data folder. If everything okay So then you should get the web page like this.

Install ownCloud with Apache on Ubuntu

Now slide your page down. In the below form you need to input username and password to manager best personal cloud server OwnCloud panel. Also provide the database along with username and password to connect OwnCloud server with database server, the location of the data folder and click on Finish Setup.

configure owncloud on ubuntu

After completing the setup you will get the admin dashboard. Where you can create users, groups and assigned them permissions, etc.

install owncloud Dashboard

Yeah! It’s done. You now know how to completely install OwnCloud on Ubuntu for building a private cloud step by step similar to Dropbox or Google Drive.


Congratulations! You have successfully installed and configured OwnCloud to build your own private cloud with Apache on Ubuntu machine. Now your data is never in the hands of third parties and can be managed privately. Many companies are choosing to create their ownCloud servers with a lot of vital information due to many problems with the privacy of data. In our upcoming tutorials, we’ll discuss more interesting topics of web server solution stacks.

Your can join us on Twitter, LinkedIn and our Facebook page. What cloud-based storage solution do you use online?. If you have any questions, please get in touch.


We also have several other articles relating to the day-to-day management of your server.