OwnCloud is really a cool app, it is shortly a Dropbox-like app allows you to have your very own cloud storage to backup and sync your data across many devices including Desktop PC, laptop, iOS and of course Android devices. The best part of using OwnCloud is that you build it yourself and the storage limit is only limited by the VPS plan you bought.
OwnCloud is basically very easy to get it installed on your VPS and even on a Shared hosting. If you are really one of DigitalOcean’s fans out there, you can simply look at the Applications tab and build a ready -to-use OwnCloud droplet but however the version in that image is not always updated regularly.
In this tutorial I will guide you to install OwnCloud 8 on Ubuntu 15.04 Vivid Vervet VPS on Apache, MariaDB and PHP5 stack, each steps with screenshot pic as always.
What You Need
You’ll need few stuff below:
- A VPS running Ubuntu 15.04. In this article I use a droplet from DigitalOcean (DO) with 512MB of RAM and 20GB SSD storage. DO is my first choice because I can build a server, test cool things and destroy. However that doesn’t mean I don’t have a production server running at DO, I have one and it is pretty solid and stable. Also, the distro I use is Ubuntu 15.04 x86_64.
*p.s: Never use DO before? Signup DigitalOcean via this special link to get free $10 credit in your account.
- You may also need a proper knowledge to use Putty, SSH and common Unix command.
- A spare time to follow this guide.
- A cup of tea or coffee.
Build OwnCloud Server Manually
Step 1 – Get a fresh Ubuntu 15.04 server, minimal version is recommended. Now login to your server as root (I assume you knew how to use SSH / Putty). If you are using a droplet from DO like me, you will be asked to change default root password:
Step 2 – Make sure all packages are up to date using command below:
apt-get update -y
apt-get upgrade -y
Step 3 – OwnCloud is a web-based app that require a web server to run so go ahead to install Apache, don’t worry it is easy:
apt-get install apache2 -y
It should look like this:
Step 4 – Once the install process is finish, continue with installing PHP5:
apt-get install php5 php5-mysql -y
Step 5 – Now install required PHP5 modules for OwnCloud to run:
apt-get install php5-gd php5-json php5-curl php5-intl php5-mcrypt php5-imagick -y
It’ll look similar to this:
Step 6 – Now issue command below to install MariaDB server on your VPS. OwnCloud needs a database server to process all of its data. Currently it supports only MySQL and MariaDB.
apt-get install mariadb-server -y
Also issue command below to setup MariaDB for the very first time:
Simply hit Enter on your keyboard if asked with current password then answer next questions accordingly. Do not forget to create new password and remember it (It is your database password for user root).
Step 7 – Now login to Mariadb as root and create new user and new database, type in this command:
mysql -u root -p
then these few lines of command:
CREATE USER 'newdbuser'@'localhost' IDENTIFIED BY 'newpassword';
CREATE DATABASE ownclouddb;
GRANT ALL ON ownclouddb.* TO 'newdbuser'@'localhost';
Replace newdbuser with your own new database username. Replace newpassword with your password (no spaces). Replace ownclouddb with new database name. Here’s the screenshot of what I’d done:
Step 8 – So we have Apache and MariaDB installed and it is time to install OwnCloud. In the time of writing, current stable version is OwnCloud v8.0.3. Your version may be different. Firstly, go to https://owncloud.org/install/ and click Download button.
Next, you have to copy its download link (Right-click on the link and copy)
Go back to Putty (or Terminal) and download it using wget command:
do not forget to change the download link
Next, extract the package to default Apache’s web folder using this command:
tar -xvf owncloud-8.0.3.tar.bz2 -C /var/www/html/
again, do not forget to change the actual OwnCloud package according to the version you’ve downloaded.
Step 9 – Now we have to set directory permission using this command:
chown www-data:www-data -R /var/www/html/owncloud/
Step 10 – In order for Apache to be able to serve OwnCloud, we have to create new Apache configuration or virtual hosts file. First, create new configuration file for your website. In this article I use servermombox.com as example (domain not exists, just for tutorial shake). We can use Nano (my favorite text editor)
replace servermombox.com in that command with your real domain name. Hit Enter and put this configuration in it:
CustomLog /var/www/servermombox.com/logs/access.log combined
Options Indexes FollowSymLinks
allow from all
it should look like this:
Now save changes and exit (In Nano it is Control+O then Control+X).
Also create new directory to store all the log files:
mkdir -p /var/www/servermombox.com/logs
Step 11 – Now reload / restart Apache then enable the newly created virtual host file using a2ensite command:
service apache2 reload
Step 12 – Now launch your favorite web browser and access your new OwnCloud website.
*p.p.s: As in this article I use servermombox.com as an example and the domain does not actually exist, so I have to edit my local hosts file which in Windows I use HostsMan app. You can also use the same method while waiting for your actual domain to resolve to your server.
In web browser you’ll see OwnCloud setup page where you have to provide few things to finish the setup process.
Create an Admin account:
Simply leave the Data Folder as it is and type in the MariaDB details you’ve created earlier:
Configure The Database:
Once done, click the Finish Setup button. That’s it.
What’s next? Once installed, you can start syncing certain files and folders from your devices using OwnCloud client app.
Also, you can create new users for your friends, family members, or even to sale your newly built cloud storage service. Enjoy..
Do not forget to follow me on Twitter for faster news update.