How to install and configure ownCloud on Ubuntu 18.04 LTS

With ownCloud, you can create your own private server and access the data anywhere you want.

ownCloud is an open-source file sharing server and collaboration platform. It allows controlling data on users’ servers and environments. Once configured, ownCloud provides easy access to all your data – whenever you want, wherever you want.

ownCloud Features

  • Access everything wherever you want
  • Share with anybody on your terms
  • Mobile and Desktop Syncing
  • End-to-end encryption support
  • Extensible through an Agile App framework

ownCloud is free to download and install on your private servers without paying to service providers.

In this article, we will help you install and configure ownCloud on your Ubuntu machine. This tutorial is thoroughly tested on Ubuntu 18.04 LTS.

Install ownCloud on Ubuntu 18.04 LTS

Before setting up Owncloud, you need to install Apache, PHP, and MySQL.

Step 1 – Install Apache HTTP Server

Let’s start with updating the system repositories. Launch the Terminal and enter the following command:

sudo apt-get update

Install Apache:

sudo apt-get install apache2

Generally, the Apache service starts automatically. Check the status using the command:

sudo systemctl status apache2.service

If you see the service has not started, you can start it manually using the following command.

sudo systemctl start apache2

Enable Apache On system boot.

sudo systemctl enable apache2

Allow Apache ports from the Ubuntu Firewall.

sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

Reload firewall and check the Firewall status.

sudo ufw reload
sudo ufw status

To check the Apache installation running status, launch the browser using hostname or server IP address.

http://hotname or IP/

If you see the Apache default page, it means everything went well.

Apache Default Page
Apache Default Page

Step 2 – Install MySQL

Let’s start with checking for available MySQL version.

sudo apt-cache policy mysql-server

As you see there is a new version available. We shall install using the command as follows:

sudo apt-get install mysql-server mysql-client

Securing MySQL installation

sudo mysql_secure_installation

You should see a prompt if you want to configure the VALIDATE PASSWORD PLUGIN. Type “Y” to yes and hit Enter to continue.

Then you should see a prompt to select a level of password validation. Select password strength and continue

Go ahead and provide a password for MySQL root user.

It should ask “Do you wish to continue with the password provided?”. Type “Y” and hit Enter.

You should see a series of questions — type “Y” for each one of them.

Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : Y
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y

By now you should have installed MySQL and also securely configured it. You can access MySQL server using the root login and password.

sudo mysql -u root -p

MySQL Root Login
MySQL Root Login

Step 3 – Install PHP

We should first check for available PHP versions and then install it.

sudo apt-cache policy php

Install PHP.

sudo apt-get install php php-cgi libapache2-mod-php php-common php-pear php-mbstring php-mysql php-curl php-json

Step 4 – Install ownCloud

You can add the repository key to apt.

sudo wget -nv -O Release.key
sudo apt-key add - < Release.key

Run the following shell commands to add the repository:

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

Update repositories.

sudo apt-get update

Install additional PHP packages.

sudo apt install php-bz2 php-curl php-gd php-imagick php-intl php-mbstring php-xml php-zip

Install ownCloud package.

sudo apt-get install owncloud-files

Install Owncloud Package
Install Owncloud Package

Generally, the ownCloud package we installed copies the web files to “/var/www/owncloud” on the server.

Step 5 – Configure Apache with SSL

Now we shall create a virtual host for ownCloud.

Create a folder for SSL certificates.

sudo mkdir /etc/apache2/ssl

Enable SSL module.

sudo a2enmod ssl

Restart Apache.

sudo systemctl restart apache2

Copy your SSL certificates to “/etc/apache2/ssl/ ” folder

Create a virtual host file.

sudo vim /etc/apache2/sites-available/

Add the following lines to file. Replace ServerName with fosslinuxowncloud with whatever you want.

<VirtualHost *:80>
    DocumentRoot /var/www/owncloud

<Directory /var/www/owncloud>
        Options -Indexes +FollowSymLinks
        AllowOverride All
    ErrorLog ${APACHE_LOG_DIR}/
    CustomLog ${APACHE_LOG_DIR}/ combined

<VirtualHost *:443>
    DocumentRoot /var/www/owncloud

<Directory /var/www/owncloud>
        Options -Indexes +FollowSymLinks
        AllowOverride All
    ErrorLog ${APACHE_LOG_DIR}/
    CustomLog ${APACHE_LOG_DIR}/ combined

SSLEngine on

SSLCertificateFile /etc/apache2/ssl/fosslinuxowncloud.cer
SSLCertificateKeyFile /etc/apache2/ssl/fosslinuxowncloud.key
SSLCertificateChainFile /etc/apache2/ssl/


You can give whatever name to your SSL certificate files.

SSLCertificateFile /etc/apache2/ssl/certificatefile-name.cer
SSLCertificateKeyFile /etc/apache2/ssl/certificate-key-name.key
SSLCertificateChainFile /etc/apache2/ssl/

Check the syntax of the configuration file.

sudo apachectl -t

If you get a “Syntax OK” message, use this command line to disable the default, virtual host.

sudo a2dissite 000-default.conf

The following commands should enable new virtual hosts.

sudo a2ensite

Restart Apache to activate changes.

sudo systemctl restart apache2

Step 6 – Configuring the MySQL Database for Owncloud

Access MySQL using the root account.

sudo mysql -u root -p

Create a database, and name it as you want.

create database fosslinuxowncloud;

Create a DB user and grant privileges.

create user 'ownclouduser'@'localhost' identified BY 'QB35JaFV6A9=BJRiT90';
grant all privileges on fosslinuxowncloud.* to ownclouduser@localhost;

Flush privileges.

flush privileges;

Step 7 – Configure ownCloud

Open a web browser and navigate to the following address to access the ownCloud web interface.

https://Domain-Name or IP

Owncloud Web Interface
Owncloud Web Interface

Create an admin account by choosing a username and a password. No need to modify Data Folder.

Fill out the details of the database name, database username, and database password. Here we installed the database in the same server, so we leave the database host as “localhost”.


Click the “Finish setup” button to finish configuring.

Now it should redirect to login page. You can provide given username and password to access the dashboard.

Login Page
Login Page

Inside Owncloud
Inside Owncloud

You can use a desktop or mobile client to sync your data to your ownCloud. Download OwnCloud client from here.


Step 8 – Install Owncloud client on Ubuntu 18.04 Desktop

Run following commands to add the repository. We should run commands as root user.

wget -nv -O Release.key
apt-key add - < Release.key

Update repository.

apt-get update

Add repository.

sh -c "echo 'deb /' > /etc/apt/sources.list.d/isv:ownCloud:desktop.list"

Update repository.

apt-get update

Install client.

apt-get install owncloud-client

After installation is complete, open ownCloud desktop Sync client, add your Domain name and click next.


Then you should get User credentials window where you should provide your username and password.

User Credentials
User Credentials

Then you can select the local folder and configure sync settings.



After you click connect, it should sync data with the server.



You can add your files to the ownCloud local folder. For example, I have added an image to the folder.


Then it should sync to the server.

Now you can go to the server and check the data. You can see the added image on the server.


If you have come this far, you successfully installed and configured the ownCloud server and also synced files with its desktop client.

How did your installation go? Let us know your feedback in the comments below, and don’t forget to share this article with your friends and colleagues who may find it useful.

Hey! I'm Darshana, a Linux / DevOps Engineer and also a contributor to FOSS Linux. I enjoy working on various kind of Linux distributions and cloud technologies. During my free time, I love to swim and hike across nature trails. Linux is my love and I'm here to share all my learnings with all of you! Hope you enjoyed reading my article.


  1. Hi there,
    I’m missing as to where the SSL certificates I am to copy to the created folder are.
    “Copy your SSL certificates to “/etc/apache2/ssl/ ” folder”

  2. For certificates, you can buy them from a trusted company or generate your own files.

    To generate your own, use the command:

    sudo openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /etc/apache2/ssl/MyOwnCloud.key -out /etc/apache2/ssl/MyOwnCloud.cer

    The command will give you a 10 years (3650 days) validity. Along with site information you provided during the execution.

    Also, please change the name of the certificate files and comment out the chain file.

    SSLCertificateFile /etc/apache2/ssl/MyOwnCloud.cer
    SSLCertificateKeyFile /etc/apache2/ssl/MyOwnCloud.key
    #SSLCertificateChainFile /etc/apache2/ssl/

    This will enable your SSL connection but your browser will notify you that you are not secure. It is because this is a self-signed keys hence there is no one to verify it. But the connection will be encryped securely.

  3. When I try the website.. I get a huge error message, and says something along the lines of; “owncloud not supported by microsoft windows” and “This version of ownCloud requires at least PHP 7.1.0 “.
    How can I fix this?


Please enter your comment!
Please enter your name here




How to setup FTP Server on CentOS

You are allowed to use any one of the FTP servers as you like. However, in this tutorial, we will be installing and using vsftpd, short for Very Secure FTP Daemon. It is a fast, stable, and secure FTP server that will help you transfer files to and from a remote system in a jiffy.

CentOS Vs. Ubuntu Server : Everything You Need to Know

Choosing the perfect Linux distribution to set up your server can be confusing since Linux provides a limitless number of options. The main reason behind these many distributions is because Linux is an opensource platform. Anybody with the required skills can contribute to the development or build and release their distribution. Currently, there are more than 600 Linux Desktop and Server distributions in the market.

Top 10 Reasons to use Xfce as your Desktop Environment

There are many choices for desktop environments for Linux based operating systems. Mainly, you can install any DE of your choice on most of the Linux based distributions, even if they are not offered as a package officially. In our recent articles, we discussed the best of KDE and Cinnamon. In this article, we wish to present to you the top reasons why you should consider Xfce as your desktop environment.

The 10 Best Linux Network Monitoring Tools

Having total control over your network is essential to prevent programs from overusing your network resources and slowing down the overall performance. This is why you should install a network monitoring tool on your system, giving you a visual overview of everything that's happening on your network. Networking Tools are like swiss-knife for the system administrators for troubleshooting system issues.

How to install CouchPotato on Ubuntu

Downloading movies and copying them over to your home server can get frustrating, especially if you are doing it daily! What if you have an option to download videos automatically, quickly, and above all with excellent quality. CouchPotato allows you to download movies easily once they are available and released automatically.

Top 20 Rsync Examples in Linux

The Rsync (remote sync) command is a Linux/Unix utility used to synchronize and copy files and directories either locally or remotely. Most Linux geeks use Rsync to mirror, backup or migrate data across folders, across disks and networks. One notable feature with the Rsync command is that it uses the "delta transfer algorithm."


Linux is growing faster than ever. As per the latest report, there is a drop in the Windows 10 market share for the first time, and Linux's market share has improved to 2.87% this month. Most of the features in the list were rolled out in the Pop OS 20.04. Let's a detailed look into the new features, how to upgrade, and a ride through video.
Elementary OS 5.1 Hera has received a point release with a handful of new features and bug fixes, and we will be reviewing the significant changes in this article. For those new to elementary OS, this Ubuntu-based Linux distribution uses their inhouse built Pantheon desktop environment and AppCenter.

Manjaro ‘Gellivara’ XFCE Edition (17.0.5) in 10 Screenshots

Want to take a quick virtual tour Manjaro XFCE edition instead of downloading GBs worth of ISO image and then making a Live USB of it? We will make it easy for you. Here are a series of screenshots of the important aspects of Manjaro Linux in XFCE edition. This is a light-weight edition, and aims to be fast and low on system resources. You will be amazed on how it is still visually appealing and user friendly.

VIDEO: Linux Lite 4.8 Features and Desktop Tour

Linux Lite eases Windows 7 users transition to Linux much more comfortable by offering simple software like Team Viewer, VLC, Firefox, TimeShift backup utility, and a full Microsoft Office compatible office suite in LibreOffice.

13 ways to use the copy command in Linux (with examples)

Being a Linux user, copying files and directories is one of the everyday tasks that you have to carry out. It can be copying a file to make a backup or copy it to another partition, directory, or external storage drive.

CopyQ – Advanced clipboard manager for Linux

We have all had that moment when we copied a text, but we first needed another one, and in the process, lost the first one. If you're lucky, you can get it back quickly with a bit of work.