Nowadays people started to realize the importance of centralized storage.
Instead of saving the data on the local system, people are started storing it on a cloud so that they can access that from anywhere in the world.
One of the main concern is buying the cloud storage from a different vendor. The cost is high and every time, you need to pay frequently.
Building your own cloud will give you the flexibility and security.
Also, you are not among the 100's of people who are sharing the same space.
Today in this article, we will see how to setup your own cloud to access it from anywhere using owncloud app.
Also, remind that the responsibility is yours now.
We are going to install OwnCloud software and configure it. Let us see the owncloud ubuntu server requirement.
Ubuntu 16.04 with sudo non-root user. Refer this article to initial server setup.
LAMP stack installed on your Ubuntu machine. LAMP refers to Linux, Apache, MySQL and PHP. To install LAMP stack on ubuntu follow this guide.
You need all the following PHP extensions for the OwnCloud to work properly.
SSL certificate installed:
For owncloud ssl setup, follow the below steps.
There are two options for you. If you are pointing a domain name to your server, then follow the How to Install Let's Encrypt on Apache.
If you plan to access the server with IP, then you have to create Self Signed SSL certificate.
Installing the Own Cloud
Ubuntu does not have the default repository for OwnCloud.
Owncloud itself maintains a dedicated repository where you can get their release key.
To do that we will use the apt-get utility and curl command as mentioned below.
$sudo curl https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04/Release.key | sudo apt-key add -
For that, you will get the following output.
. . . % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1358 100 1358 0 0 2057 0 --:--:-- --:--:-- --:--:-- 2057 OK
The release.key has the PGP public key for the apt to verify the authenticity of the OwnCloud package.
To import the key you have to create owncloud.list in sources.list.d directory. Apt will use this directory.
The file has the address of the owncloud repository.
echo 'deb https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04/ /' | sudo tee /etc/apt/sources.list.d/owncloud.list
The output of the above command will be
deb https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04/ /
Now, update the Ubuntu repository.
$ sudo apt-get update
You will get the following output.
W: https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04/Release.gpg: Signature by key DDA2C105C4B73A6649AD2BBD47AE7F72479BC94B uses weak digest algorithm (SHA1)
Now, install the OwnCloud using the apt-get command.
$ sudo apt-get install owncloud
The prompt will ask you whether you want to install the application. You just enter Y.
Output Setting up owncloud-deps-php7.0 (9.1.1-1.2) ... Enabling conf owncloud. To activate the new configuration, you need to run: service apache2 reload apache2_invoke: Enable module rewrite apache2_invoke owncloud: already enabled Setting up owncloud (9.1.1-1.2) ... Processing triggers for libc-bin (2.23-0ubuntu4) ... Processing triggers for libapache2-mod-php7.0 (7.0.8-0ubuntu0.16.04.3) ...
When you install the OwnCloud, it will create a new configuration for Apache.
To make the Apache work on the changes, reload the Apache with systemctl command.
$ sudo systemctl reload apache2
Next, we are going to set up the database for the OwnCloud.
MySQL Database Configuration
Owncloud also requires a unique database to store data. Here, we will create a Database and User.
Also, we will grant the user to access and modify the database.
Then we will make the own cloud to use the user to manage the database.
First, log in to the MySQL database with username and password.
$ mysql -u root -p
After that, you will be entered into the MySQL command prompt.
First, we have to create a database. To create a database just execute the below command.
$ mysql> CREATE DATABASE owncloud;
Here, I have created the database with name Owncloud. It is easy to understand.
You can give any name to your database. It is your choice.
Now, create a user and grant access to the owncloud database.
mysql> GRANT ALL ON owncloud.* to 'owncloud'@'localhost' IDENTIFIED BY 'set_your_own_password';
You have to set your own password at the place of 'set_your_own_password'.
Now, you have to update the recent changes in the database to the running MySQL instance.
Use the below command for that.
mysql> FLUSH PRIVILEGES;
That's all. Now, you have to exit from the MySQL. For that type exit and press Enter.
Now, the database setup is over. Our next task to complete the setup through the web interface.
Configuring OwnCloud through Web Interface
Connect to the server using the following owncloud server address. It will lead you to owncloud login page.
When you try to enter to the IP, the browser will show you a notification about the host authenticity.
It is because of the SSL certificate that we generated by on our own.
You just don't need to worry about that and you can proceed.
You can see the setup page which will ask you to enter the username and password.
Choose a secure username and password which is hard to guess and crack.
Check the database and storage section. Don't make any changes in the database folder.
In the configure database settings, enter the Database username and password that you have set and also enter the database to which the user has the access.
After that, click on Finish setup.
After finishing the setup, it will show a page like below.
Just close the notification and start using the platform.
Once you finished that, just go through all the options.
You can access your cloud from all over the Globe also, now it is customizable for you.
When you require a lot of Storage on your own cloud, it is better to establish a storage at your place with dedicated IP for the access.