ownCloud is a file sharing server that permits you to store your personal content, like documents and pictures, in a centralized location, much like Dropbox. The difference with ownCloud is that it is free and open-source, which allows anyone to use and examine it. It also returns the control and security of your sensitive data back to you, thus eliminating the utilization of a third-party cloud hosting service.
In this tutorial, we will install and configure an ownCloud instance on an Ubuntu 16.04 server.
In order to complete the steps in this guide, you will need the following:
The ownCloud server package does not exist within the default repositories for Ubuntu. However, ownCloud maintains a dedicated repository for the distro.
To begin, download their release key using the
curl command and import it with the
apt-key utility with the
- sudo curl https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04/Release.key | sudo apt-key add -
Output. . . % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1358 100 1358 0 0 2057 0 --:--:-- --:--:-- --:--:-- 2057 OK
The ‘Release.key’ file contains a PGP (Pretty Good Privacy) public key which
apt will use to verify that the ownCloud package is authentic.
In addition to importing the key, create a file called
owncloud.list in the
sources.list.d directory for
apt. The file will contain the address to the ownCloud repository.
- echo 'deb https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04/ /' | sudo tee /etc/apt/sources.list.d/owncloud.list
Outputdeb https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04/ /
After adding a new source, use the
apt-get utility and the
update command to make
apt aware of the change:
- sudo apt-get update
Output. . . W: https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04/Release.gpg: Signature by key DDA2C105C4B73A6649AD2BBD47AE7F72479BC94B uses weak digest algorithm (SHA1)
Finally, perform the installation of ownCloud using the
apt-get utility and the
- sudo apt-get install owncloud
When prompted with the
Do you want to continue? [Y/n] message, press the
ENTER key to confirm the installation.
OutputSetting up owncloud-deps-php7.0 (9.1.1-1.2) ... Enabling conf owncloud. To activate the new configuration, you need to run: service apache2 reload apache2_invoke: Enable module rewrite apache2_invoke owncloud: already enabled Setting up owncloud (9.1.1-1.2) ... Processing triggers for libc-bin (2.23-0ubuntu4) ... Processing triggers for libapache2-mod-php7.0 (7.0.8-0ubuntu0.16.04.3) ...
As you can see by the output, the installation created a new configuration for Apache. Use the
systemctl utility with the
reload command to make the Apache daemon aware of the change:
- sudo systemctl reload apache2
With the ownCloud server installed, we will move on to setting up a database for it to use.
To get started, log into MySQL with the administrative account:
- mysql -u root -p
Enter the password you set for the MySQL root user when you installed the database server.
ownCloud requires a separate database for storing administrative data. While you can call this database whatever you prefer, we decided on the name
owncloud to keep things simple.
- CREATE DATABASE owncloud;
Note: Every MySQL statement must end with a semi-colon (;). Be sure to check that this is present if you are experiencing an issue.
Next, create a separate MySQL user account that will interact with the newly created database. Creating one-function databases and accounts is a good idea from a management and security standpoint. As with the naming of the database, choose a username that you prefer. We elected to go with the name
owncloud in this guide.
- GRANT ALL ON owncloud.* to 'owncloud'@'localhost' IDENTIFIED BY 'set_database_password';
Warning: Be sure to put an actual password where the command states:
With the user assigned access to the database, perform the flush-privileges operation to ensure that the running instance of MySQL knows about the recent privilege assignment:
- FLUSH PRIVILEGES;
This concludes the configuration of MySQL, therefore we will quit the session by typing:
With the ownCloud server installed and the database set up, we are ready to turn our attention to configuring the ownCloud application.
To access the ownCloud web interface, open a web browser and navigate to the following address:
If a self-signed certificate is being used, you will likely be presented with a warning because the certificate is not signed by one of your browser’s trusted authorities. This is expected and normal. We are only interested in the encryption aspect of the certificate, not the third-party validation of our host’s authenticity. Click the appropriate button or link to proceed to the ownCloud admin page.
You should see something like this:
Create an admin account by choosing a username and a password. For security purposes it is not recommended to use something like “admin” for the username.
Before clicking the Finish setup button, click on the Storage & database link:
Leave the Data folder setting as-is and click the MySQL/MariaDB button in the Configure the database section.
Enter the database information that you configured in the previous step. Below is an example, which matches the database credentials that we used in this guide:
Click the Finish setup button to sign into ownCloud. A safe home for all your data splash screen should appear:
Click the x in the top-right corner of the splash screen to access the main interface:
Here, you can create or upload files to your personal cloud.
ownCloud can replicate the capabilities of popular third-party cloud storage services. Content can be shared between users or externally with public URLs. The advantage of ownCloud is that the information is stored securely in a place that you control.
Explore the interface and for additional functionality, install plugins using ownCloud’s app store.
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Click below to sign up and get $200 of credit to try our products over 60 days!
Isn’t it working with Nginx?
Regarding the recent inability to load opencloud: I ran into that as well, but found an older version that works here: https://download.owncloud.org/download/repositories/9.0/owncloud/
Follow the instructions for “Ubuntu_16.04 owncloud-9.0.11-1.1” in place of the commands above for step 1. of installing opencloud.
Hope this helps. I was beating my head against the wall trying to get the newer versions of opencloud to work (but could not). Thanks Michael for the original great article!
Please let me know what should i do having this error
E:package owncloud has no installation candidate?
After a “sudo apt-get update”
I should have seen this output :
Output . . . W: https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04/Release.gpg: Signature by key DDA2C105C4B73A6649AD2BBD47AE7F72479BC94B uses weak digest algorithm (SHA1)
Unfortunately Instead I get this :
sudo apt-get update Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB] Hit:2 http://ppa.launchpad.net/certbot/certbot/ubuntu xenial InRelease
Hit:3 http://nyc2.mirrors.digitalocean.com/ubuntu xenial InRelease
Ign:4 https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04 InRelease Hit:5 http://nyc2.mirrors.digitalocean.com/ubuntu xenial-updates InRelease Get:6 https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04 Release [986 B] Get:7 https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04 Release.gpg [481 B] Get:8 https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04 Packages [833 B] Hit:9 http://nyc2.mirrors.digitalocean.com/ubuntu xenial-backports InRelease Fetched 104 kB in 1s (95.6 kB/s) Reading package lists… Done
Then when I continue :
sudo apt-get install owncloud
I get this :
Reading package lists… Done Building dependency tree
Reading state information… Done Package owncloud is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: owncloud-files E: Package ‘owncloud’ has no installation candidate
Is there something needs to be updated or something I am doing wrong ? Please advise ?
Is there any chance to figure out this issue ? trying to : sudo apt-get install owncloud and get this output Please advise .
~$ sudo apt-get install owncloud Reading package lists… Done Building dependency tree
Reading state information… Done Package owncloud is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: owncloud-files
Awesome tutorial! Very user friendly and easy to follow. Thank you Digital Ocean for making such great tutorials. Some of the best I’ve seen online.
Thanks! This tutorial worked for me the first time. I’ve been searching for a long time for a tutorial to set this up and either my server did not act right or the other tutorials I found the commands wouldn’t work for my server. Either way, I tried to relocate my data DB using your tutorial [https://www.digitalocean.com/community/tutorials/how-to-move-a-mysql-data-directory-to-a-new-location-on-ubuntu-16-04]
However, now I get this when I try logging in at the web browser:
*Internal Server Error
The server encountered an internal error and was unable to complete your request. Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report. More details can be found in the server log.*
Versions: PHP 7.0.18 OwnCloud 9.1.6-1.1 owncloud-deps-php7.0 Apache2 2.4.18-2 MYSQL 5.7.18
Installation worked first time, thank you!
I’ve been using a few of your tutorials, and they are awsome. I have an issue with the ownCloud installation though! I think the issue is within the repository as it is not up to date. I got another one though which worked, but the output is a bit different. So now, when I try to reach my cloud (‘…/owncloud’), it gives me a 404, but I can reach the server.
Desperate for help. Tahnks!