How to Install Own Cloud On an an Ubuntu 18.04 Dedicated Server or VPS

How to Install Own Cloud On an an Ubuntu 18.04 Dedicated Server or VPS

You can create your own self-hosted cloud storage services by installing the open source software – OwnCloud on your Ubuntu 18.04 server. OwnCloud provides similar functionalities like DropBox, OneDrive and Google Drive.

Having a cloud storage service is inevitable in today’s world where information is very vital in every business. You can use the cloud to create backups for your most important pieces of information. You can then restore information from your backup in case a disaster (e.g. flooding, fires, earthquakes) strikes.

Note
Special Note: as your company and brand grow your hosting needs may change and require better scaling and redundancy. if this is your case, you should consider upgrading to cloud hosting service. Consult with HostAdvice’s Cloud hosting services reviews to find the best provider.

Offsite backups hosted on the cloud are the most effective. A regular backup performed on a nearby external hard disc or memory card is not enough because it can be damaged together with your main storage.

OwnCloud offers a great solution for protecting your data on the cloud while making collaboration easier. In this guide, we will show you how to integrate a self-hosted OwnCloud storage service on your Ubuntu 18.04 server.

Prerequisites

  • An Ubuntu 18.04 VPS
  • A non-root user with sudo privileges

Step 1: Install Apache

You need to install Apache on your Ubuntu Server for OwnCloud to work, if you haven’t done so, type the command below;

$ sudo apt install apache2

Next, disable directory listing on your Apache:

$ a2dismod autoindex

Enable the following Apache modules for OwnCloud to work correctly:

$ sudo a2enmod rewrite
$ sudo a2enmod headers
$ sudo a2enmod env
$ sudo a2enmod dir
$ sudo a2enmod mime

Restart Apache for the changes to take place:

$ sudo systemctl restart apache2

Step 2: Install MariaDB Server

Then install MariaDB server by running the command below:

$ sudo apt-get install mariadb-server mariadb-client

By default, MariaDB installation is not secure; we need to run the command below to make it safe:

$ sudo mysql_secure_installation

This will allow us to;

  • Set a strong password for the root user of our MariaDB,
  • remove anonymous users
  • disallow root login and
  • remove test databases

Then login to your MariaDB server using the command below to create a database:

$ sudo mysql -u root -p

Enter your password when prompted.

Create OwnCloud database user and password by typing the commands below. Replace ‘PASSWORD’ with a strong value.

CREATE DATABASE owncloud;
CREATE USER 'oc_user'@'localhost' IDENTIFIED BY 'PASSWORD';
GRANT ALL ON owncloud.* TO 'oc_user'@'localhost' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION; 
FLUSH PRIVILEGES;
EXIT;

Step 3: Install PHP

OwnCloud supports PHP 7.1 so we need to install it using the commands below:

$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt update
$ sudo apt install php7.1

Then we need to install all the related PHP modules using the command below:

$ sudo apt-get install php7.1-cli php7.1-common php7.1-mbstring php7.1-gd php7.1-intl php7.1-xml php7.1-mysql php7.1-zip php7.1-curl php7.1-xmlrpc

The default PHP settings may limit the way OwnCloud works, so we need to adjust some default values.

Open the default ‘php.ini’ file by typing the command below:

$ sudo nano /etc/php/7.1/apache2/php.ini

Find the settings below and change their values to correspond the ones we have at the bottom:

file_uploads = On
allow_url_fopen = On
memory_limit = 256M
upload_max_file_size = 100M

Then press CTRL+X, Y and Enter to save the changes.

Restart Apache:

$ sudo systemctl restart apache2

Step 4: Download the latest OwnCloud release

CD to the ‘tmp’ directory and download the latest release of Owncloud using the commands below:

$ cd /tmp 
$ wget https://download.owncloud.org/community/owncloud-10.0.3.zip

Then, unzip ‘owncloud-10.0.3.zip’ file to the current directory:

$ unzip owncloud-10.0.3.zip

Move the files to a new owncloud directory under the root folder of your website:

$ sudo mv owncloud /var/www/html/owncloud/

Step 5: Set directory and file permissions

In order for Owncloud to function correctly, we need to set the following directory permissions/ownership:

$ sudo chown -R www-data:www-data /var/www/html/owncloud/
$ sudo chmod -R 755 /var/www/html/owncloud/

Step 6: Finalize the Installation

Visit your server URL and to finalize the installation. In our case, we will visit http://ipadress/owncloud

Enter your preferred admin username and password as shown below:

Then configure the database by entering the database name, username, and password values that you created above as shown below:

Finally, click on ‘Finish Setup’ at the bottom of the screen.

You Owncloud instance is now setup and you can log in to the admin panel and start uploading files

Conclusion

That’s it when it comes to installing OwnCloud self-hosted service. Remember, you can create different directories/folders to organize your files better. Owncloud allows you to share files with your team especially if you are working on a project. I hope you enjoyed reading the guide.

Check out the top 3 Cloud hosting services:

HostArmada
$2.49 /mo
Starting price
Visit HostArmada
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.5
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.0
ScalaHosting
$2.95 /mo
Starting price
Visit ScalaHosting
Rating based on expert review
  • User Friendly
    4.8
  • Support
    4.3
  • Features
    4.4
  • Reliability
    4.8
  • Pricing
    4.5
Kamatera
$4.00 /mo
Starting price
Visit Kamatera
Rating based on expert review
  • User Friendly
    3.5
  • Support
    3.0
  • Features
    3.9
  • Reliability
    4.0
  • Pricing
    4.3

How to Enable Two-Factor Authentication on an Ubuntu 18.04 VPS or Dedicated Server

This guide will show you how you enable two-factor authentication to improve the
4 min read
Max Ostryzhko
Max Ostryzhko
Senior Web Developer, HostAdvice CTO

How to Install the LEMP (Linux, Nginx, MySQL, PHP) Stack on an Ubuntu 18.04 VPS or Dedicated Server

This tutorial walks you through the process of installing Nginx, MySQL, and PHP
4 min read
Mark Armistead
Mark Armistead
Author

How to Install a Let’s Encrypt Certificate on your Ubuntu 18.04 Dedicated Server or VPS

If you are hosting your website on a VPS server running Ubuntu 18.04, we will sh
3 min read
Michael Levanduski
Michael Levanduski
Expert Hosting Writer & Tester

How to install OpenLiteSpeed on an Ubuntu 18.04 VPS or Dedicated Server

OpenLiteSpeed is an open source web server characterized by high-performance, li
3 min read
Kennedy Mbuvi
Kennedy Mbuvi
Author
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top