How to Install ownCloud on Alibaba Cloud ECS Ubuntu 16.04


  • A valid Alibaba Cloud account. If you don’t have one, register for free and get $300 worth in Free Trial.
  • An Alibaba Cloud ECS instance running Ubuntu 16.04 Operating System
  • A non-root user for your Alibaba ECS instance that can perform sudo privileges

Step 1: Install Apache Web Server

Apache is the most widely used web server. It is fast, secure and easy to configure. To install it on your Alibaba Cloud ECS instance running Ubuntu 16.04, run the commands below:

$ sudo apt-get update
$ sudo apt-get install apache2
$ sudo a2dismod autoindex
$ sudo a2enmod rewrite
$ sudo a2enmod headers
$ sudo a2enmod env
$ sudo a2enmod dir
$ sudo a2enmod mime
$ sudo service apache2 restart

Step 2: Install MySQL server

MySQL is the most comprehensive Relational Database Management System (RDMS) with a lot of modern features. It is also secure and scalable. Therefore, it works pretty well with ownCloud allowing you to scale up and down depending with your needs.

$ sudo apt-get install mysql-server
$ sudo mysql_secure_installation
Setup Validate Password plugin? : Y
Password validation policy level:2
Change the password for root? N
Remove anonymous users? : Y
Disallow root login remotely? : Y
Remove test database and access to it? : Y
Reload privilege tables now? : Y

3: Create ownCloud MySQL Database and User

Next, you need to create a database that ownCloud will use for administrative purposes. First, login to your MySQL server on the command line using the command below:

$ sudo mysql -uroot -p
mysql> create database owncloud;
Query OK, 1 row affected (0.00 sec)
mysql> create user 'oc_user'@'localhost' identified by 'PASSWORD';
Query OK, 0 rows affected (0.00 sec)
mysql>flush privileges;
Query OK, 0 rows affected (0.00 sec)

Step 4: Installing PHP scripting language

PHP is one of the most widely used server-side scripting language. The open source general purpose programming language is powerful for running dynamic and interactive web applications like ownCloud

$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt-get update
$ sudo apt-get install php7.1
$ sudo apt-get install php7.1-cli php7.1-common php7.1-mbstring php7.1-gd php7.1-intl php7.1-xml php7.1-mysql php7.1-zip php7.1-curl php7.1-xmlrpc
$ sudo systemctl restart apache2

Step 5: Download ownCloud software

You have now setup a web server, a database server and PHP scripting language. The server environment is now ready for running ownCloud software.
$ cd /tmp
$ wget
$ sudo apt-get install unzip
$ sudo unzip -d /var/www/html/

Step 6: Configuring ownCloud Directory and File Permissions

Apache runs under the default user www-data. We need to associate the ownCloud directory with this user using the command below:

$ sudo chown -R www-data:www-data /var/www/html/owncloud/
$ sudo chmod -R 755 /var/www/html/owncloud/

Step 7: Finalizing the Installation

You can now visit the address below on a web browser to finalize ownCloud installation


Step 8: Testing the Installation

You can now start uploading files by click the + icon on the dashboard:


In the above tutorial, we have described how to setup ownCloud on your Alibaba Cloud Elastic Compute Service (ECS) instance running Ubuntu 16.04 Operating System. We have gone through the steps of setting up Apache web server, PHP scripting language, MySQL server and finally downloaded and installed ownCloud.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website: