In this post, I will show you how to install Owncloud on Ubuntu 18.04.
It is becoming more and more common to read and hear about security breaches from companies that handle vital user information on the Internet, and this makes many people wonder whether it is so necessary to trust these giant companies.
Another important issue is that these large companies do not take the issue of privacy seriously and their handling of user files and information is at least questionable.
Therefore, many users and small businesses prefer to invest in infrastructure that allows them to have their private cloud. At the software level, owncloud is emerging as the most important solution in this matter.
OwnCloud is a software that allows us to create a private cloud with which you can synchronize files, calendars, contacts, notes and more using extensions. It’s free, open-source and has an application for Android, iOS and desktop clients for Linux, Windows and Mac OS X.
So, let us install it.
Owncloud on Ubuntu 18.04
1.- Install LAMP on Ubuntu 18.04
The first step is to install a LAMP server on Ubuntu 18.04. But don’t worry that we have an article with which you can do it without problems.
Then, you can continue with the rest of the steps.
2.- Install some PHP module and create the new database for Owncloud
Owncloud, in order to work properly, requires some extra PHP modules. So let’s install them first.
:~$ sudo apt install libapache2-mod-php7.2 openssl php-imagick php7.2-common php7.2-curl php7.2-gd php7.2-imap php7.2-intl php7.2-json php7.2-ldap php7.2-mbstring php7.2-mysql php7.2-pgsql php-smbclient php-ssh2 php7.2-sqlite3 php7.2-xml php7.2-zip
After installing LAMP, it is possible that several have already been installed, but better to be sure.
After that, create a new user and database for Owncloud.
:~$ sudo mysql -u root -p > CREATE DATABASE owncloud; > GRANT ALL PRIVILEGES ON owncloud.* TO owncloud@localhost IDENTIFIED BY 'owncloud_password'; > FLUSH PRIVILEGES; > exit;
Of course, you can modify the name of the database, the user name and the password for one that you prefer.
Now, we can start to install Owncloud.
3.- Install Owncloud on Ubuntu 18.04 (I)
We can choose two ways to install Owncloud. One is to download the package directly from the project website. But the other is easier and safer and is to do it from the Owncloud repositories.
To do this, first, you need to install a necessary package.
:~$ sudo apt-get install apt-transport-https
Then, we have to add the GPG key of the repository to be sure that the download and installation will be safe.
:~$ sudo wget -qO- https://download.owncloud.org/download/repositories/stable/Ubuntu_18.04/Release.key | sudo apt-key add - OK
Now we can add the repository as such. The next command, you have to do it as the root user, so execute:
:~$ sudo -i
:~$ echo 'deb http://download.owncloud.org/download/repositories/10.3.2/general/Ubuntu_18.04/ /' > /etc/apt/sources.list.d/owncloud.list
Returns to a regular user:
All that’s left is to refresh the APT cache and install Owncloud.
:~$ sudo apt update && sudo apt install owncloud-files
Wait for the download to finish in installation.
For everything to go well, you must enable two Apache modules that are not by default.
:~$ sudo a2enmod rewrite :~$ sudo a2enmod headers
And create a new configuration file for Owncloud.
:~$ sudo nano /etc/apache2/conf-available/owncloud.conf
And add the following content:
ServerName owncloud.osradar.test Alias /owncloud "/var/www/owncloud/" <Directory /owncloud "/var/www/html/owncloud"> Options +FollowSymlinks AllowOverride All <IfModule mod_dav.c> Dav off </IfModule> SetEnv HOME /var/www/owncloud SetEnv HTTP_HOME /var/www/owncloud </Directory>
So, press CTRL + O to save the changes and CTRL + X to close the file.
Finally, enable the new configuration and restart Apache2.
:~$ sudo a2enconf owncloud :~$ sudo systemctl reload apache2
Now we can complete the installation from the web browser.
4.- Install Owncloud on Ubuntu 18.04 (II)
Now, you can open your web browser and go to
http://your-server/owncloud and you will see the following:
There, you will have to set up the administrator user account. Below on the “Storage & Database” section select MySQL / MariaDB and fill in the fields with the created MariaDB credentials.
Then, it will start the Owncloud installation and configuration on the server. Then you will see the Login screen where you will have to enter your credentials.
Then you’ll see this screen. This shows that everything is in order.
So, that is it.
Owncloud is quite useful to be able to have our own private cloud without depending on third parties. However, you have to know how to install it and thanks to this guide you know how to do it. All that’s left is for you to do it and get the most out of this tool.