In this tutorial, you will learn how to install OwnCloud on Ubuntu 18.04 Linux and configure it correctly for first use.
OwnCloud is very similar to DropBox which I’m sure you will be familiar with or at least Google Cloud technologies. The benefit of OwnCloud is it hosted by you rather than an external provider, and thus under your complete control. Furthermore, it is a completely open-source file sharing server and collaboration platform.
For this tutorial I have used a DigitalOcean Ubuntu 18.04 x64 droplet. You can either create a droplet the same as mine to follow the setups correctly or use your own machine running Ubuntu 18.04.
Once you have setup a DigitalOcean Ubuntu 18.04 VPS or your own setup ssh into the machine and follow the steps below to install OwnCloud.
Step 1: Installing OwnCloud
We need to first update the packages and update the system with the following two commands.
apt-get -y update apt-get -y upgrade
If you are following this tutorial for another Linux distribution the replace
apt-get utility accordingly.
From here we need to install all of the dependencies OwnCloud requires to work correctly, which are Apache, MariaDB, PHP and various PHP modules. You will be prompted for database details when you install MariaDB, make a note of these as they are required by OwnCloud.
apt-get -y install apache2 mariadb-server libapache2-mod-php5 php5-gd php5-json php5-mysql php5-curl php5-intl php5-mcrypt php5-imagick
Next we need to get the latest version of OwnCloud using wget and extract it in
/tmp as follows.
cd /tmp wget https://download.owncloud.org/community/owncloud-8.2.2.zip unzip owncloud-8.2.2.zip
We need to be able to access OwnCloud from the internet and why we need the Apache webs server installed. Let’s copy OwnCloud to the folder Apache uses to serve files and set the permissions.
cp -r owncloud /var/www/html chown -R www-data:www-data /var/www/html/owncloud/
Step 2: Configure Apache and OwnCloud
The next step is to correctly configure Apache to host your new OwnCloud installation. Let’s create a configuration file for Apache with vim to do this as follows.
Copy and paste the following text into the file.
<Directory /var/www/html/owncloud/> Options +FollowSymlinks AllowOverride All <IfModule mod_dav.c> Dav off </IfModule> SetEnv HOME /var/www/html/owncloud SetEnv HTTP_HOME /var/www/html/owncloud </Directory>
Now save and close the file.
All that is required now is to restart Apache so it loads in the new configuration as follows.
service apache2 restart
Step 3: Setup OwnCloud via the Web Interface
So far we have installed and configured OwnCloud with Apache. Next we need to complete the online installation via the web interface. To do this open your server IP address in Firefox or another web browser with the OwnCloud sub-directory as follows.
You will be prompted to create an admin username and password, as well as a folder to store the files for sharing. Enter these details into the form and continue to the next form.
Next we need to configure the database, to do this enter a database name and the root username and password you create when installing the dependencies in Step 1. Then click the button to finish the web installation.
You should now have OwnCloud correctly installed and running.
This tutorial has walked you through the steps to install OwnCloud on an Ubuntu 18.04 server using Apache as a web server. The advantage of OwnCloud is that you control it and the files it stores rather than an independent company.
Next try downloading the desktop application and sync files to your new OwnCloud.