A few words of thanks would be greatly appreciated.

OwnCloud - Implementation on a LAN


OwnCloud is an open source implementation of online storage services and various applications (cloud computing). OwnCloud can be installed on a personal network (as a LAN). Dependencies on this server must will be in PHP and a database in SQLite, MySQL or PostgreSQL.

In addition to a web interface that allows you to view, edit and share data, OwnCloud implements standard protocols such as WebDAV for accessing files, CardDAV to access contacts and CalDAV for calendar, which allows to synchronization with the most common OS.

In this tutorial you will learn:
  • 1 - How to install Owncloud on a personal web server.
  • 2 - How to access data via a file explorer with WebDAV.
  • 3 - How to mount a share in /etc/fstab to access the cloud locally.
  • 4 - How to install a owncloud client on a Desktop.
  • 5 - How to configure your Owncloud client for synchronization.


  • A computer with Linux OS (this tutorial is based on Ubuntu Enterprise Server 10.04LTS or 12.04LTS).
  • Apache web server (Apache web server with a public_html directory in the homedirectory).
  • A version of the PHP server - v5.3 minimum.
  • A computer with Linux OS (Ubuntu desktop distribution (12.04LTS)- to be used as the owncloud client).

Installing OwnCloud on a web server

  • Go to the official website: http://owncloud.org/support/install/
  • Download the 'Latest Stable release'.
  • For this tutorial owncloud-4.0.4 was used.
  • The "username", will be your connection login of your "Linux ubuntu desktop" therefore your "homedirectory".
  • Unzip the downloaded file to the homedirectory of your server
    • tar -xjf owncloud-x.x.x.tar.bz2
  • Move the "owncloud" directory to "public_html" homeDirectory your server (or) in /var/www/, using one of th below commands:
    • mv owncloud ~/public_html/ 
    • sudo mv owncloud /var/www/ 

Note that:
  • The owner of the "www-data" web server should have the following directories in apps, data and config.
  • Two of these directories are part of your ownCloud installation, only the 'data' directory should be created.
  • Go to the owncloud directory
    • cd owncloud 
  • Create the directory 'data'
    • mkdir data

Configure rights fo apps, config and data:
  • sudo chown -R www-data:www-data apps
  • sudo chown -R www-data:www-data config 
  • sudo chown -R www-data:www-data data 

For the Owncloud application to work properly, we need to activate the "rewrite" and "headers" modules (not enabled by default in Apache).
  • sudo a2enmod rewrite 
  • sudo a2enmod headers 

Restart the Apache server to validate the modifications:
  • sudo service apache2 restart

If you have set the owncloud directory in /var/www/ do not perform the following command.
Create a symbolic link to the owncloud directory in /var/www/:
  • s
    udo ln -s /home/username/public_html/owncloud/ /var/www/owncloud 

Note that:
  • 'Username' is the homedirectory of your server.

Launch your web server
  • http://name_of_server/owncloud (or) http://IP_Adress_server/owncloud 
  • Fill-in the form using your personal data.
  • It important to separate administrator and normal user yo avoid security issues.
  • Once you filled in this form the admin account of 'Owncloud' will be created first.
  • It is advisable to set a username and password different from your normal user account.
  • Click on 'Install'.
  • Sign in and start using your 'Owncloud on your personal web server'.
  • When you first connect, create a login and password for normal user.

Create a "users" group:
  • Settings -> Users -> drop down menu 'Groups' -> click 'Add Group'
  • Enter: Users and validate

Creating a user:
  • Put the same login and password to connect to your desktop.
  • Enter a "Name" and "password" -> select the group 'Users' -> click "Create".
  • Quit the application (as an administrator) and connect as a normal user.

Access data via a file explorer with WebDAV

How to configure a WebDAV access that will allow us to save data to local folder via ownCloud?
  • We might as well mount it at root directory of your web server or in a subdirectory.
  • For this tutorial we will use our homedirectory, and create an 'owncloud'directory.

Installing WebDAV support (the davfs2 package)
  • sudo apt-get install davfs2 
Reconfigure davfs2 to allow access by a normal user
  • sudo dpkg-reconfigure davfs2 (select Yes at the prompt)

Add the user having permission mount the shared group options - davfs2
  • sudo usermod -aG davfs2 username 

To allow the user to mount the shared cloud options we need to create the directory in question in its homedirectory.We'll name it as 'owncloud':
  • mkdir owncloud 

Mount 'owncloud' in fstab

  • For owncloud-4.0.4, insert the following line in your 'fstab', indicating the IP of your server:

http://ip_address_server/owncloud/remote.php/webdav/ /home/username/owncloud davfs user,rw,noauto 0 0 

Note that:
  • By going into your file explorer you will see a device named 'owncloud now present.
  • If you click on it, it will not work. You will get a message 'Unable to mount the device etc. ...'
  • Do not worry now,there are still some steps to make it work.
  • When installing "davfs2", an hidden directory and two files "davf2.conf" and "secrets" are created in the homedirectory of the username.

Configuring these two files:
davfs2.conf: uncomment the following lines and use these values, do not edit the rest.
  • ask_auth 0 
  • use_locks 0 
  • gui_optimize 1 

secrets: add to the last line of this file (The double quotes are important).
  • "/home/username/owncloud/" "username" "password"

Important Note:
  • Username and password are the 'login' and 'password' to connect to your owncloud web server created earlier. This is why it is important to create a user in a group of users your owncloud server.

Install the owncloud client to synchronize with the cloud

Add the source package in the list of sources of the apt protocol:
Request to update the list of packages
  • sudo apt-get update 

Installation of the Package
  • sudo apt-get install owncloud-client 

To receive owncloud-client package updates download the key:
Add the key:
  • sudo apt-key add - < Release.key 
Configure the owncloud client
  • Once the client is installed, the launch icon will be displayed in your applications.
  • Search with keyword: cloud.
  • Click on the icon to launch the application, a message appears to tell you need to configure your client.
  • Click on OK.
  • You shall see an icon with a small black cloud in the taskbar at the top right.

  • Now enter your login and password of the user you have created.
  • Normally if you have followed the tutorial it should preferably be your username.
  • The following screen confirms the connection to your cloud.
  • You are then asked to choose a folder that will be synchronized.
  • Select the 'owncloud' directory that you have created in your homedirectory.
  • Give it a name (or alias) for our tutorial we will use: 'Moncloud'
  • On this screen, leave the default settings.
  • A "clientsync" folder will be created by default at the root of your cloud. You can delete it later if you want.
  • To verify that the 'clientsync' folder is present on your server.
  • Open your file explorer, click on 'owncloud' in 'Devices', you should see this directory.
  • Finally, to verify if everything is synced, left-click on the black cloud icon in the taskbar and select 'Open Status ...'

A few words of thanks would be greatly appreciated.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jeff Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.


This document, titled "OwnCloud - Implementation on a LAN," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (https://ccm.net/).