I am a danish programmer living in Bangkok.
Read more about me @ rasmus.rummel.dk.
Webmodelling Home > How to install OwnCloud on Ubuntu
Do good

OwnCloud on Ubuntu

Feb 2014. This tutorial is a step-by-step how to install OwnCloud on Ubuntu server.

OwnCloud is an open source and free cloud based storage system that allows you to syncronize files between multiple devices and share files with other users - as such OwnCloud is very similar to eg. DropBox, however with the definitive advantage that you can add as much space as you have harddrive and that you own your own files.

In addition OwnCloud have several builtin tools like Calendar, Task scheduler, Address book (all syncronizable between devices) and a growing well ordered 3.party plugin library you can use to custom enhance your OwnCloud.

Tutorial Content :

  1. Install OwnCloud on Ubuntu - step-by-step
  2. Install OwnCloud Clients

References :

Install OwnCloud on Ubuntu : step-by-step

Here I start on a fresh Ubuntu 12.04 Precise Penguin server (my Ubuntu 12.04 server is running on a KVM/QEMU virtual machine, but that should mean no difference). If you have a newer version of Ubuntu, you need to substitute 12.04 in all commands below with your own version.

  1. Prepare Operating System :
    1. Logon to your Ubuntu 12.04 as root (if you don't have a root user, then you must prefix all commands with sudo)
    2. shell> apt-get update : update your packages information from the repositories as specified in /etc/apt/sources.list.
    3. shell> apt-get upgrade : upgrade all existing packages based on the up-to-date packages information.
  2. Install Prerequisites :
    1. shell> apt-get install lamp-server^ : don't forget ^.
      1. answer Y then prompted to continue.
      2. Write a password for MySql root user then prompted (you will be asked to repeat the password a second time).
      3. Lamp-server is finished installing.
    2. shell> apt-get install php5-gd : (installing lamp-server will install most pre-requisites for OwnCloud, but not php5-gd)
      1. shell> Y : answer Y then prompted to continue.
    3. shell> mysql_install_db : be sure the MySql data directory is initialized with the system tables.
    4. shell> /usr/bin/mysql_secure_installation : remove the test database and the anonymous user for security (since this will be a production database).
      1. key in the MySql root password (the password you specified for MySql then installing lamp-server above).
      2. answer n - you don't want to change your MySql root password.
      3. answer Y - you want to remove anonymous users.
      4. answer Y - you want to disable the ability of MySql root user to login remotely.
      5. answer Y - you want to remove the MySql test database.
      6. answer Y - you want to reload privileges now.
      7. securing MySql is finished.
    5. Create the MySql user to be used by OwnCloud :
      1. shell> mysql -u root -p : logon to MySql.
        1. enter your MySql root user password.
      2. mysql> create database owncloud; : create a database for OwnCloud called owncloud.
      3. mysql> create user 'owncloud'@'localhost' identified by 'SomePassword'; : OwnCloud needs a user to connect to the database, call that user for owncloud also.
      4. mysql> grant all on owncloud.* to 'owncloud'@'localhost'; : give the new owncloud user all privileges on the owncloud database.
      5. mysql> flush privileges; : be sure the above GRANT ALL command take effect immediately.
      6. mysql> exit; : return to shell prompt.
  3. Install the OwnCloud Repository :
    1. shell> sh -c "echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/xUbuntu_12.04/ /' >> /etc/apt/sources.list.d/owncloud.list"
    2. shell> wget http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_12.04/Release.key : (note that if you are installing on an Ubuntu desktop, you can use this command instead : wget http://download.opensuse.org/repositories/isv:ownCloud:desktop/xUbuntu_12.04/Release.key)
    3. shell> apt-key add - < Release.key :
    4. shell> apt-get update : yet another update to sync your OwnCloud packages information with the online OwnCloud repository.
  4. Installing OwnCloud itself :
    1. shell> apt-get install owncloud : install the OwnCloud server package.
    2. answer Y to continue then prompted.
    3. OwnCloud server is installed.
    4. shell> service apache2 restart : restart apache webserver.
  5. Configure HTTPS access : (for more indept understanding, see this : HTTPD - Apache2 Web Server)
    1. shell> openssl genrsa -des3 -out /etc/ssl/server.key 4096 :
      1. enter a password (here called passphrase). You will be prompted a second time to confirm the passphrase.
    2. shell> openssl req -new -key /etc/ssl/server.key -out /etc/ssl/server.csr :
      1. enter the certificate password again.
      2. enter a range of certificate details.
    3. shell> openssl req -new -key /etc/ssl/server.key -out /etc/ssl/server.csr :
      1. enter the certificate password again.
    4. shell> openssl rsa -in /etc/ssl/server.key -out /etc/ssl/server.key.insecure :
      1. enter the certificate password again.
    5. shell> mv /etc/ssl/server.key /etc/ssl/server.key.secure :
    6. shell> mv /etc/ssl/server.key.insecure /etc/ssl/server.key :
    7. shell> mkdir /etc/apache2/ssl :
    8. shell> cp /etc/ssl/server.key /etc/apache2/ssl :
    9. shell> cp /etc/ssl/server.crt /etc/apache2/ssl :
    10. shell> nano /etc/apache2/sites-available/default-ssl : open default-ssl site in the Nano editor and make 3 changes :
      1. Add your servername :
        • From this
          (the top section of default-ssl)
        • To this
      2. Change AllowOverride from None to All : (otherwise the rewrite module will not work)
        • Like this
          (also the top section of default-ssl)
      3. Change certificate file and key to the 2 files we made above :
        • From this
        • To this
          1. out-comment the SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
          2. out-comment the SSLCertificateKeyFile /etc/sss/private/ssl-cert-snakeoil.key
          3. add the line SSLCertificateFile /etc/apache2/ssl/server.crt
          4. add the line SSLCertificateKeyFile /etc/apache2/ssl/server.key
      4. Press ctrl+x and then 'y' to exit the Nano editor and save the file.
    11. shell> a2enmod ssl : enable the Apache2 ssl module.
    12. shell> a2enmod rewrite : enable the Apache2 rewrite module.
    13. shell> a2ensite default-ssl : enable the default-ssl site (sites-available/default-ssl will be copied to sites-enabled/default-ssl).
    14. shell> service apache2 restart : restart the Apache2 webserver to activate the changes.
  6. Create the OwnCloud admin account :
    1. Open a browser and navigate your browser to your OwnCloud installation, typically http://localhost/owncloud (I installed remotely on our company server, so my url need to point the company server : http:owncloud.favouritedesign.com/owncloud).
    2. Fill in all the needed fields to get started.
    3. Success !.
  7. Force clients to use only https to connect :
    1. Open a browser and navigate your browser to your OwnCloud installation using https instead of http (OwnCloud will not allow you to "Enforce HTTPS" if you are not already connected using https, which is good, because if https is not working you would then not be able to connect).
    2. Select the "admin" link in the toop right corner of the OwnCloud page and then select "Admin" from the resulting dropdown.
    3. Scroll down until you come to the Security section and then select "Enforce HTTPS".
    4. If you try to access your OwnCloud installation using http, your browser will automatically change to use https.
  8. Creating a user :
    1. Again select the "admin" link in the toop right corner of the OwnCloud page and then select "User" from the resulting dropdown.
    2. Fast fill in the details for the new user.
    3. Open a new browser and login as the new created user.
    4. Successfully logged on as rasmus.

Install OwnCloud Clients

You can interact with OwnCloud using a webbrowser, a desktop client (Windows, Mac, Linux) and a mobile client (iOS, Android). Here I will only only go through how to install the OwnCloud Windows Desktop Client.

  1. Install the Windows Desktop Client :
    1. Download OwnCloud Windows Desktop Client
    2. Start the installer and click "Next".
    3. Choose which components to install (Standard & Full is the same). Click "Next".
    4. Accept the default install location and click "Install".
    5. After installation is complete, click "Next".
    6. Be sure "Run OwnCloud" is checked and then click "Finish".
    7. First time running the OwnCloud desktop client, you are prompted for connection details. The first connection parameter is the "Server Address" (typically https://localhost/owncloud).
    8. My SSL certificate is selfcreated, so the desktop client does not trust it. Select "Trust this certificate anyway" and click "OK".
    9. You are prompted for user credentials to logon to OwnCloud (connect as the user, you created above).
    10. Lastly you are prompted for local folder on your desktop to syncronize. Just select the default, you can delete it later. Click "Connect".
    11. Click finish
    12. Success ! OwnCloud desktop client is now in your tray
    13. Right click on the OwnCloud tray icon to see your options.

All Clients :

Appendix : Custom enhance OwnCloud with 3.party plugins

OwnCloud have an extensive well structured 3.Party OwnCloud Plugin library from which you can custom enhance your OwnCloud (just like eg. FireFox can be custom enhanced from it's huge plugin library)

Appendix : Cloud Concepts & Acronyms

  • Cloud : another term for network or Internet. Cloud computing means accessing programs and data over the internet instead of from the local harddrive (also accessing programs and data from the local network is not considered cloud computing) - that's it.
  • SaaS : Software as a Service : a software distribution model in which applications are hosted by a service provider and made available to customers over a network, eg. the Internet.
  • PaaS : Platform as a Service : an extension of SaaS in which service providers host software platforms for developer teams to test and collaborate on software.
  • IaaS : Infrastructure as a Service : a hardware distribution model in which the service provider owns, houses and maintains the hardware and the customer pays per usage (sometimes called HaaS for Hardware as a Service).

Appendix : Other Cloud Products

Name Free 3.Party Plugins Comment
OwnCloud Community free
Enterprise not free
Yes, many and well structured
Ubuntu OpenStack Free

click to top


You can comment without logging in
 B  U  I  S 
Words: Chars: Chars left: 
      report  reply  
Is there turtorial how to install owncloud working with ISPConfig ?
      report  reply