How to install Owncloud 10.0 on Ubuntu 17.04 Server

Owncloud 10.0 has been released with many bug fixes and improvements. This tutorial will show you how to install Owncloud 10.0 on Ubuntu 17.04 server. Even this version is still marked as next stable version, we can use it in our system confidently. Since the official Owncloud repository still use the current stable version 9.1.6, we will install Owncloud 10.0 manually. But don’t worry, we will try as best as we can to explain every steps we took to install Owncloud 10.0 on our Ubuntu 17.04 Server.

The following major changes have been made to Owncloud 10.0:

  • Fix issue with database.xml migration being triggered twice on market app install
  • Apps formerly marked as shipped can now be uninstalled
  • Market now properly updates app version when using multiple apps paths

Steps to install Owncloud 10.0 on Ubuntu 17.04 Server

Step 1. Install LAMP Stack

Before we can install Owncloud, we need to make sure LAMP is installed and well configured on our Ubuntu 17.04. Please read my previous guide to install LAMP Stack on Ubuntu 17.04.

Step 2. Install additional modules

If you follow my tutorial in the link above, we still need to install some additional packages/modules. Execute the following command to ensure our system has all needed modules.

sudo apt install -y libapache2-mod-php7.0 \
    php7.0-gd php7.0-json php7.0-mysql php7.0-curl \
    php7.0-intl php7.0-mcrypt php-imagick \
    php7.0-zip php7.0-xml php7.0-mbstring

Once installed, don’t forget to restart Apache

sudo systemctl restart apache2

Step 3. Create new database for Owncloud

We need to create a new database and a new user for Owncloud. The following example shows step to create new database called “owncloud” and a new user called “owncloud” with password “12345678“. You will need to modify these label and password with your own.

ubuntu@ubuntu-server:~$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.7.18-0ubuntu0.17.04.1 (Ubuntu)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE DATABASE owncloud;
Query OK, 1 row affected (0.00 sec)

mysql> CREATE USER 'owncloud'@'localhost' IDENTIFIED BY '12345678';
Query OK, 0 rows affected (0.05 sec)

mysql> GRANT ALL ON owncloud.* TO 'owncloud'@'localhost' IDENTIFIED BY '12345678';
Query OK, 0 rows affected, 1 warning (0.01 sec)

Query OK, 0 rows affected (0.00 sec)

mysql> EXIT;

Step 4. Download Owncloud

Now we need to download Owncloud package from the official website. Please check this website to see the latest version available.

cd /tmp
sudo mv owncloud /var/www/html/
sudo chown -R www-data:www-data /var/www/html

Step 5. Configure Owncloud via web browser

Now open a web browser and type the Ubuntu server IP address to open the Owncloud configuration. For example in my case would be:

Make sure you enter the database name, user, password with the ones we created earlier. When successful, you will see the following login screen of the Owncloud

Step 6. Cleanup

After finish installing, we need to secure our Owncloud. For easier way, we will create a new shell script (modified from the official website). This script will make modification to the folder permissions used by Owncloud.

cd /tmp

Copy and paste these lines:


printf "Creating possible missing Directories\n"
mkdir -p $ocdata
mkdir -p $ocpath/assets
mkdir -p $ocpath/updater

printf "chmod Files and Directories\n"
find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750
find ${ocdata}/ -type f -print0 | xargs -0 chmod 0640
find ${ocdata}/ -type d -print0 | xargs -0 chmod 0750

printf "chown Directories\n"
chown -R ${rootuser}:${htgroup} ${ocpath}/
chown -R ${htuser}:${htgroup} ${ocpath}/apps/
chown -R ${htuser}:${htgroup} ${ocpath}/assets/
chown -R ${htuser}:${htgroup} ${ocpath}/config/
chown -R ${htuser}:${htgroup} ${ocdata}/
chown -R ${htuser}:${htgroup} ${ocpath}/themes/
chown -R ${htuser}:${htgroup} ${ocpath}/updater/

chmod +x ${ocpath}/occ

printf "chmod/chown .htaccess\n"
if [ -f ${ocpath}/.htaccess ]
  chmod 0644 ${ocpath}/.htaccess
  chown ${rootuser}:${htgroup} ${ocpath}/.htaccess
if [ -f ${ocdata}/.htaccess ]
  chmod 0644 ${ocdata}/.htaccess
  chown ${rootuser}:${htgroup} ${ocdata}/.htaccess

Now close and save it and then make it executeable and run it

chmod +x
sudo ./



One Comment

  1. hi,
    the last part cleaning which running : sudo ./
    gives error , I tried to change the path to : ocpath=’/var/www/html/owncloud’
    adding html , then it runs without previous error , but now it says can not access .htaccess ! I don’t know what is the issue!!!

Leave a Reply

Your email address will not be published. Required fields are marked *