Installing OwnCloud on Ubuntu Server

Want something like Dropbox or Google Drive with more options? Perhaps you want to use your own hardware (such as an old PC). Many times, buying a 1TB hard drive is much cheaper than buying a premium cloud service. Also, you will get faster connection speeds at home because it is self hosted. Whatever the reason, OwnCloud is the easiest and best reason to host your own cloud service with multiple users, add-ons, file shares, mobile and desktop apps, and a web GUI.

Before you install OwnCloud, you have to:

Let’s get started!

  1. SSH into your server or access it directly.
  2. Go to OwnCloud’s downloads page and choose “Ubuntu” because that is the operating system we will be installing OwnCloud server on.
  3. Type “sudo su” and then type in your password to connect as the root user for more permissions.
  4. Go down to the section corresponding to your version of Ubuntu Server. To find out, type “lsb_release -a” in the server’s command line. Also, make sure you use the latest version of OwnCloud. 1
  5. Copy and paste (or type if you are directly on the server) the commands (one line at a time) in order to download and add the key.
  6. Then, copy and paste the next three commands to add the repository and install OwnCloud. Press Y and ENTER to confirm the installation. This will also install required packages such as Apache2.
  7. Now, OwnCloud is installed, but it does not have a Virtual Site with Apache2, so it will now show up online yet. Type “sudo nano /etc/apache2/sites-available/owncloud.conf” to create a new configuration file.
  8. Type “ln -s /etc/apache2/sites-available/owncloud.conf /etc/apache2/sites-enabled/owncloud.conf”  to make a link.
  9. Type “service apache2 restart” for your configuration to take action.
  10. Type “ifconfig” to find your ipv4 address if you do not already know it.
  11. Then, using a web browser go to the owncloud directory on your IP address. For example, mine is “”
  12. Type in the username and password you would like for your admin account. You can make additional (admin or user) accounts later.2
  13. OPTIONAL: If you want faster speeds and plan on using a lot of users and files, set up MySQL.
    • Do not click Finish setup. First, you will have to install a MySQL server.
    • Type “sudo apt-get install mysql-server -y” to install MySQL server.
    • Create a password for your root MySQL user. I recommend making it the same as your server user.3
    • Repeat the same password for confirmation.
    • Type “mysql_secure_installation” to make sure your MySQL server is secure.
    • Type in your ROOT MYSQL password (the one you set a minute ago) to confirm.
    • I decided to choose no for the “VALIDATE PASSWORD PLUGIN” by pressing any key besides “Y”.  However, I opted in for all the other options.
    • Type “mysql –password” to log in as the root user.
    • Type in your ROOT MYSQL password and press ENTER.4
    • Type “create database owncloud;” to create the database. It should say this: 5
    • Type “exit” to go back to the command line.
    • Click “Storage & Database” for advanced settings.
    • Click the “MySQL/MariaDB” tab.
    • Database user: “root”
    • Database password: your MYSQL ROOT password
    • Database name: “owncloud”
  14. Click “Finish setup” to save your changes.
  15. That’s it! You’ve installed OwnCloud. You can change settings add users by clicking your name in the top right, then Admin. To install apps, click “Files” in the top right, then click “Apps”.
  16. There are other things you can do to make your experience better.


Did this tutorial help? Share it with a friend!