Did You Know?
Got a tip? Let us know

LFCS - Linux Foundation Certified SysAdmin - Exam Preparation Guide

OwnCloud 7 Released – Create Personal/Private Cloud Storage in Linux

Download Your Free eBooks NOW - 10 Free Linux eBooks for Administrators

Cloud storage stands for virtualised pool of network storage most commonly hosted by third parties. Cloud storage is a network-based service which physically do not exist but remains somewhere in the cloud. To be more clear, cloud storage means sharing data over network, rather than having local servers or personal device.

Cloud storage is all around us in our smart phones, on desktops and servers etc. The Dropbox application which is now available on smart phone is nothing but cloud storage application. Google Drive is another cloud storage application which lets you store and access your stored data from anywhere and anytime.

This article aims at – Building your personal cloud storage using ownCloud application. But what is the need of building personal cloud when there are third party hosting. Well all the third party hosting limits you to work with the given configuration and storage limit. With the ever expanding list of photos, videos, mp3’s of storage is not sufficient, moreover cloud storage is a relatively new concept and there are not many third party cloud storage host and the available one is too much costly.

ownCloud community has recently released their special release ownCloud 7. They have come up with incredible changes in terms of quality, performance and innovations to provide excellent cloud experience with “ownCloud“. If you are already working with its older version, you’ll definitely experience significant improvements in Document handling.

What is ownCloud

ownCloud is a free, open-source and powerful web application for data synchronization, file sharing, and remote storage of files. ownCloud is written in PHP/JavaScript languages. It is designed to work with several database management systems, including MySQL, MariaDB, SQLite, Oracle Database, and PostgreSQL. Moreover owncloud can be deployed on all known platforms viz., Linux, Macintosh, Windows and Android. In short it’s a robust, platform Independent, flexible in terms of configuration and usability, easy-to-use open source Application.

Install Owncloud in Linux

Install Owncloud in Linux

Features of owncloud

  1. Store files, folders, contacts, photo galleries, calendar, etc on the server of your choice, Later you can access it from mobile, desktop, or web browser.
  2. In the world of gadgets, a normal person have tablet, smart phone, laptop, etc. Own cloud lets you sync all your files, contacts, photo, calendar, etc synced among the devices.
  3. In the era of sharing aka Facebook, Twitter, Google+, etc, owncloud lets you share your data with others and share them publicly or privately as per your needs.
  4. Easy user interface lets you manage, upload, create user, etc in a very easy fashion.
  5. A special feature is that, even user can undelete the accidentally deleted data from Trash, is not it easy to handle and maintain.
  6. The search feature in owncloud is very responsive which is done in background and lets user search by name as well as file type.
  7. Contacts are organised in categories/group hence easy to access contacts on the basis of friends, co-worker, Family, etc.
  8. You can now access external storage be it Dropbox, FTP or anything else by mounting.
  9. Easy to migrate to/from other owncloud server.

What’s New in ownCloud 7

  1. Shared Folder has been removed. Don’t worry still you can share your files. The only difference is your shared files appears in the root directory at receivers end. Still you can create shared folder and drag your files there, sync it the normal way but the in-built provision of shared folder has been removed.
  2. For those upgrading from owncloud 6 to owncloud 7, all the files in the shared folder will remain intact but the new share will start to show in the root folder at receiver’s end.
  3. A new filter “Shared with Me” shown to the left of file views has been added. This filter makes the navigation easier by showing the paths of files and folders shared with the user.
  4. Besides the above two major changes owncloud 7 has gone more flexible, fixed some bugs, user interface went more user friendly and the expendable plug-ins made it more robust.

Step 1: Install ownCloud Storage in Linux

In order to setup your own personal cloud storage (ownCloud), you must have LAMP (Linux, Apache, MySQL, PHP) stack installed. Other than LAMP stack you might need Perl and Python based upon your use.

On Debian/Ubuntu/Linux Mint
# apt-get install apache2 apache2-doc apache2-utils mysql-server mysql-client php5 php5-mysql
On RedHat/CentOS/Fedora
# yum install httpd mysql-server mysql-client php php-mysql

Step 2: Create Cloud Database

Once you setup LAMP stack on your personal box, just login to your database (MySQL, here).

# mysql -u root -p

Enter mysql root password. Now we will be creating a database (say cloud).

mysql> create database cloud ; 
Query OK, 1 row affected (0.00 sec)

It is not a good idea to access your database from root, hence grant all the permission to a normal user (say tecmint).

mysql> grant all on cloud.* to tecmint@localhost identified by 'my_password'; 
Query OK, 0 rows affected (0.00 sec)

Step 3: Download and Install ownCloud Application

Now its time to Download latest ownCloud (i.e version 7.0.0) application using below link.

  1. http://owncloud.org/install/

Alternatively, you may use wget command to download the source tar-ball package.

# wget https://download.owncloud.org/community/owncloud-7.0.0.tar.bz2

You may alternatively install from source package using APT or YUM. The installation instruction can be found at:

  1. Install ownCloud using APT or YUM

However we choose the TAR package which is universally accepted and works on most of the known system.

After Downloading the owncloud package, move it to your Apache working directory, which is /var/www (for Debian) and /var/www/html (for RedHat).

# cp owncloud-7.0.0.tar.bz2 /var/www/		[For Debian based Systems]
# cp owncloud-7.0.0.tar.bz2 /var/www/html/	[For RedHat based Systems]

Next, extract the package using tar command as shown below.

# tar -jxvf owncloud-7.0.0.tar.bz2

Since the TAR Archive is extracted you may remove the Archive.

# rm -rf owncloud-7.0.0.tar.bz2

We might need to change the file permission of owncloud, in our Apache working directory.

# chmod -R 777 owncloud/

Note: Remember we are giving read, write and execute permission to all, which is although risky but this time needed since several configuration file would be written automatically. We later need to change permission to 755, once the setup is finished.

Step 4: Configuring Apache for ownCloud

For security purpose ownCloud uses Apache‘s .htaccess files, in order to use them. We need to enable two Apache modules mod_rewrite and mod_headers for ownCloud to function properly. Type the following command to enable these modules under Debian based systems only, for RedHat systems they are enabled by default.

# a2enmod rewrite
# a2enmod headers

Additionally, we need to enable mod_rewrite rules to work properly under Apache‘s main configuration file. Open the Apache global configuation file.

# nano /etc/apache2/sites-available/default	[For Debian based Systems]
# vi /etc/httpd/conf/httpd.conf			[For RedHat based Systems]

There, find “AllowOverride None” and change this to “AllowOverride All” as shown.

AllowOverride None

Change this to:

AllowOverride All

Now we need to restart Apache to reload new changes.

# service apache2 restart			[For Debian based Systems]
# service httpd restart				[For RedHat based Systems]

Step 5: Access ownCloud Application

Now you can acess your very personal cloud storage at:

http://localhost/owncloud
OR

http://your-ip-address/owncloud

We need to enter username, password and mysql database username, password and database name, (Here the one we created above- cloud).

ownCloud Configuration

ownCloud Configuration

Once all the correct values are entered, click Finish and your private cloud storage is ready, you may have a test drive. Login to owncloud

OwnCloud Login

OwnCloud Login

After successful login, you are greeted with the working interface:

OwnCloud Admin Panel

OwnCloud Admin Panel

Upload a picture file.

OwnCloud Upload

OwnCloud Upload

Upload videos, pictures, PDF, etc similarly

OwnCloud Upload

OwnCloud Upload

The uploaded video/mp3 file can be played from the interface itself by double clicking (check top of left most column playing mp3)

Owncloud Streaming

Owncloud Streaming

Note: You can add users or imports user account, change password, assign user role and allocate space by clicking the Gear icon on left bottom of the page.

You may now add folder, sync media files be it pictures, images and videos from the mobile application. Owncloud lets you add new user, and sync calendar, contacts, Media files, etc.

It also has a built in MP3 Player, PDF Viewer, Document Viewer, and a lot many which is worth a try and explore. So what are you waiting for? Become a proud owner of private cloud storage, give it a try!

Upgrading Owncloud 6 to Latest Released Owncloud 7

To update earlier version of owncloud6 to 7, you need to first update the owncloud6 to latest point release of the same version (e.g., 6.0.xy to 6.0.2), and then you able to upgrade to owncloud 7.

Update Owncloud 6.0.xx to 6.0.2

1. Making proper backup of everything is always suggested.

2. Enable the updater plugin (if it is disabled).

3. Go to Admin Panel and fire update.

4. Refresh page using ‘Ctrl+F5‘, you’re done.

Upgrade Owncloud 6 to Owncloud 7

1. Update your owncloud version to latest point release of your version.

2. Not to Mention, Make a full backup before upgrading.

3. Download the latest tarball using wget command.

# wget http://download.owncloud.org/community/owncloud-latest.tar.bz2

4. Deactivate all native and third party Applications and plugins.

5. Delete Everything from the owncloud Directory except DATA and CONFIG directory.

NOTE: Don’t touch DATA and CONFIG directory.

6. Untar the tar-ball and copy everything to the root of your owncloud directory within your working directory.

7. Grant required permissions and run Upgrade from the Next page and its done!.

8. Don’t forget to install and enable Third party Application and plug-ins only after checking the compatibility with the current version.

So what are you waiting for? Install the latest owncloud project or upgrade your last version to latest and start using it.

Reference Links

  1. ownCloud Homepage

That’s all for now. Don’t forget to provide us with your valuable feedback in comments. I’ll soon be here with another interesting article, you people will love to read. Till then Stay tuned, connected to tecmint and healthy. Like and share us, help us get spread.

I am a major in computer science, love to research nix. I love to write codes and scripts, review distros, experiment Foss Technologies, write technical articles, Hack, of course Ethically. I am working as System Administrator (nix) for a NGO.
Download Free eBooks
Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Ubuntu Linux Toolbox: 1000+ Commands

47 Responses

  1. It is a bad idea, from a security point of view, to set AllowOverride universally. What you should do is create a configuration file or section that applies only to the Owncloud directory, and enable AllowOverride there.

    A packaged OwnCloud is available for Fedora and works very well, though for the current stable Fedora releases, you will get OwnCloud 4.x not 5.x. If you’re OK with that, you can simply ‘yum install owncloud’ on your server, set up the database stuff, edit the owncloud config file with the database config, and you’re done.

    If you run GNOME 3.8 or later, you can configure your system as an OwnCloud client very easily from the Online Accounts tool in the GNOME Control Center: this will make the OC file share visible in the sidebar of all file operation dialogs and Nautilus, and configure your OC calendar and contacts in Evolution.

  2. peacengell says:

    Hello was waiting for something like this thanks a lot.

    But i have a questions:

    I have compile my apache and my php on a fedora19

    I have this issue when starting ownloud.

    there are three module not install in php.

    GD_module
    and the two Z module

    any one know how to compile and install these three module.

    I did try a few way

    pear install gd when successful but didn’t work

    thanks if someone could or else i need to use this tutorials.

    cheers and beers

  3. Ricky Tan says:

    Hi,

    Just a question, since this is a cloud topic, Do you know anything or do you do a tutorial in OPEN STACK?

    Thanks

    Ariel Chiong

  4. Ganesh says:

    Hi,

    I have correctly followed your steps but failed to execute this part.

    # nano /etc/apache2/sites-available/default [For Debian based Systems]

    There, find “AllowOverride None” and change this to “AllowOverride All” as shown.

    My default file is empty and I am not sure what should I put in there?

    Please help.

    • Jeremy says:

      I’m running Ubuntu 13.10, and have the same problem as Ganesh. In /etc/apache2/sites-available there is a file called “000-default.conf” and “default-ssl.conf” but neither have a line “AllowOverride None”.

      • Ravi Saive says:

        If it isn’t exists, just add “AllowOverride All” in the .htaccess file in the root directory of owncloud.

        • Ganesh says:

          Hi Ravi,

          In which folder under /var/www/owncloud/ do I look for the .htaccess file?

          I am unable to find the file under /var/www/owncloud.

          Thanks,

          Ganesh

          • Ganesh says:

            Done. No need to edit the .htaccess file under owncloud but need to edit the following file:

            sudo gedit /etc/apache2/sites-available/000-defaults.conf

            search for “Allowoveride” and change the parameter under /var/www parameter.

            That should do it

  5. David Armstrong says:

    When I type “mysql -u root -p” I get the following error:

    david@david-XFX-nForce-780i-3-Way-SLI:/var/www$ mysql -u root -p
    Enter password:
    ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)
    david@david-XFX-nForce-780i-3-Way-SLI:/var/www$ sudo mysql -u root -p
    Enter password:
    ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)
    david@david-XFX-nForce-780i-3-Way-SLI:/var/www$

  6. peacengell says:

    @David Armstrong

    How did you install mysql

    package or compiling

    do a
    #which mysqld
    if nothing appear

    find / -name mysqld

    if still nothing appear

    then do a yum -y install mysql-server mysql-client

    OR

    apt-get install mysql-server mysql-client

  7. peacengell says:

    Hello guys,,

    my owncloud is working now .

    Here is the Compile options for php.

    ./configure \
    –prefix=/Site/web1.local/php \
    –with-mysql –with-apxs2=/Site/web1.local/Apache_install/bin/apxs \
    –with-config-file-path=/Site/web1.local/Apache_install/conf/extra \
    –with-pear \
    –with-zlib \
    –with-pdo-mysql=shared \
    –with-mysqli=shared \
    –with-mysql=shared \
    –with-zlib-dir=/usr/local/lib \
    –with-gd \
    –with-gd-dir=/usr/local/lib \
    –with-libdir=/usr/local/lib \
    –with-jpeg-dir=/usr/local/lib \
    –with-png-dir=/usr/local/lib \
    –with-freetype-dir=/usr \
    –enable-mbstring \
    –enable-xml \
    –enable-zip \
    –enable-gd

    and I did a find of the php.ini

    I found one in /etc/php.ini

    enable zlib there and voila everythings work and i have update it to 5.0.13
    I’m very happy…

    huray…

    anyone having trouble can ask here…

    will try to help cheers.

  8. vinayak gupta says:

    thanks a lot !!!! going to try :)

  9. Nichlas says:

    Personal storage? This is worth absolutely nothing if there is no encryption.

    There is a reason that we don’t use FTP and Telnet anymore.

  10. Guest says:

    Where this data is going to get stored? On PC??

    • Avishek Kumar says:

      Dear User,

      Please post comment from your original name. By giving comment or feedback you are not committing a crime.

      Ok! Answer to Your Question: Yup! Data is going to be store on your Local Machine (Server).

  11. Jonas says:

    I followed your guide step by step. I now have a working owncloud. But I am afraid to let it out on the internet since I get a message when I log in as admin saying my .htaccess file is not working. How can I solve this problem? Thanks for a great website!

  12. Stuart says:

    Seems pretty pointless to me. It doesnt seem to offer any advantages over using FTP over SSL, or SCP. Sure there is a nice GUI but thats all. To me a “cloud” solution should offer the capability to:
    – add storage by adding a slave node (server) to the system or another drive to such a node.
    – automatically handle redundancy/availability by replicating data across nodes/drives.

    I think these are features in the “object storage” aspects of openstack

  13. Rizwan says:

    It needs High internet speed to upload bulk images and files.

  14. David Nguyen says:

    Hi Avishek Kumar,

    I installed owncloud 6 with centos 6.5 (final) and see this notice:

    “Your PHP version is outdated. We strongly recommend to update to 5.3.8 or newer because older versions are known to be broken. It is possible that this installation is not working correctly.”

    So should I upgrade php from 5.3.3 to 5.3.8.

    Thanks in advance

  15. Nassey says:

    I have given task to host owncloud on our company server and use it as company private storage, my questions are :

    – Does ownCloud have API’s that i can integrate with using other applications developed built in .Net, Android, iOS which will synch files?
    – Does ownCloud storage support MS SQL as storage ?

    Thanks and appreciate your answers.

  16. mojtaba says:

    tanks for your article very useful

  17. Peter says:

    I keep getting the message you have tried to open ‘ application/x-httpd-php (1.1 KB)’ what should firefox do with this. What is missing from my setup

    Thanks

  18. phil says:

    I have followed the instructions but when I try to access it ( http://your-ip-address/owncloud) all i get is

    It works!

    This is the default web page for this server.

    The web server software is running but no content has been added, yet.

    I have installed it on ubuntu 12.04

    • Simon Massey says:

      Ubuntu12.04. Below are the commands I ran while as root. You can use sudo to run them if you have not ‘su – root’. The apache site config I have put at http://paste.ubuntu.com/7297997/ note that you can only have one site running as ssh you cannot have multiple virtual sites and you need to change “asdf.com” to be your domain. Then you need to setup your dns to “cloud.asdf.com” to your server. Once you have all that you should be able to hit “https://cloud.asdf.com” to get to owncloud. I then installed the yubikey app so that i can use the $20 one time crypto hardware token to login from anywhere which is going to be way more secure than using a password. Each of OSX desktop sync and iPhone work will with this install even using a self signed security cert. Enjoy.

      sh -c “echo ‘deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/xUbuntu_12.04/ /’ >> /etc/apt/sources.list.d/owncloud.list”
      wget -O – http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/xUbuntu_12.04/Release.key | sudo apt-key add –
      apt-get update
      apt-get install owncloud
      cp /etc/apache2/sites-available/default /etc/apache2/sites-available/owncloud
      vi /etc/apache2/sites-available/owncloud
      # use file at http://paste.ubuntu.com/7297997/
      a2enmod ssl
      a2ensite owncloud
      a2enmod rewrite
      service apache2 restart

  19. Sriram says:

    I need to install excel plugins. because i want to work as google drive.. please suggest me the steps

    • shambhu Rajput says:

      Hi There,
      It is a very good tool but I am agree with Sriram that we need to install excel plugin. We would like to use this instead of Google docs.

      Is it possible ?

      Thanks and Regard.

  20. Arshi says:

    Thanks it was very good article. I followed the steps mentioned but after putting in localhost/owncloud instead of getting login page I get following

    <?php

    /**
    * ownCloud
    *
    * @author Frank Karlitschek
    * @copyright 2010 Frank Karlitschek karlitschek@kde.org
    *
    * This library is free software; you can redistribute it and/or
    * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
    * License as published by the Free Software Foundation; either
    * version 3 of the License, or any later version.
    *
    * This library is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
    *
    * You should have received a copy of the GNU Affero General Public
    * License along with this library. If not, see .
    *
    */

    Thanks in Advance

    • Avishek Kumar says:

      Seems you have not installed php.
      apt-get install php5-common libapache2-mod-php5 php5-cli (Debian/Ubuntu)

      Just yum the required package if you are using RedHat based Distro.

  21. Tom Wright says:

    I followed your instructions to the letter and when it comes to logging on in either localhost or via ip address I get 404 The requested URL /owncloud was not found on this server.

    And Apache/2.2.16 (Debian) Server at localhost Port 80.

    Owncloud is not running but I have no idea how to start the service.

    • Avishek Kumar says:

      Do the below as root.

      # cd /var/www
      # ls -l

      check for any folder named owncloud. Notice foldername case. Remember linux is case sensitive. Point your browser to link/owncloud. Remember link/owncloud is not same as link/Owncloud.

      Best of Luck!

  22. Avishek Kumar says:

    Do the below as root.

    # cd /var/www
    # ls -l

    check for any folder named owncloud. Notice foldername case. Remember linux is case sensitive. Point your browser to link/owncloud. Remember link/owncloud is not same as link/Owncloud.

    Best of Luck!

  23. Yazir Arafath says:

    Thank you for this useful post.

    Can I install OwnCloud on Nginx?

    • Avishek Kumar says:

      Dear Yazir,
      To be true, I personally have no idea of installing it over Nginx. Why dont you install it and in case of any fix required our team will work to short it out with you.

  24. Ganesh says:

    How do I access owncloud over Internet?

    Thanks,

    Ganesh Bhat

Leave a Reply

This work is licensed under a (cc) BY-NC | TecMint uses cookies. By using our services, you comply to use of our cookies. More info: Privacy Policy.
© 2012-2014 All Rights Reserved.