frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

How to Install Owncloud Ubuntu and Debian

MichailMichail Moderator
edited February 19 in Linux Applications

Introduction

OwnCloud is a powerful open-source software platform that allows you to create your own cloud storage for storing, synchronizing, and sharing files. ownCloud is a great alternative to commercial cloud storage services such as Dropbox or Google Drive, as it gives you full control over your data.

In this article, we will take a detailed look at the process of installing and configuring ownCloud on an Ubuntu (starting from 20.04 version) and Debian (starting from 11 version).

Prerequisites

  • Apache: Before installing OwnCloud, make sure you have the Apache web server installed. You can refer to our guide for instructions.
  • MariaDB: You will also need MariaDB to create a database for OwnCloud. You can install MariaDB by following our guide.

Please note: OwnCloud supports PHP 7.4 but does not support the latest PHP versions (such as PHP 8.0 and higher). Therefore, in this guide, we will install PHP 7.4. PHP 7.4 reached end of life (EOL) in 2022. Please keep this in mind before proceeding with the OwnCloud installation.

Also, it is advisable to back up your server before installing OwnCloud or any other software if you have custom configurations on your VPS.

Installation Guide

1. Update your system

Ensure your system is up to date by running the following command:

apt update -y && apt upgrade -y

Create Database For Owncloud

To create database for your Owncloud, first access MariaDB as root:

mysql -u root -p

Once you connected, enter this command to create Owncloud database:

CREATE DATABASE owncloud;

After that, grants all privileges to the owncloud user for the owncloud database (type the actual password that you want to specify instead of "'New_Password"):

GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud'@'localhost' IDENTIFIED BY 'New_Password';

Then flush privileges and exit:

FLUSH PRIVILEGES;

EXIT;

3. Install PHP

Next, you need to install PHP.

On Ubuntu run these commands to add required repository:

apt-get install software-properties-common
add-apt-repository ppa:ondrej/php

On Debian run these commands:

apt install ca-certificates apt-transport-https software-properties-common wget -y

wget -O /usr/share/keyrings/php-archive-keyring.gpg https://packages.sury.org/php/apt.gpg
echo "deb [signed-by=/usr/share/keyrings/php-archive-keyring.gpg] https://packages.sury.org/php bookworm main" | sudo tee /etc/apt/sources.list.d/php.list

Next, run this command to instal PHP 7.4 (on both Ubuntu and Debian):

apt install php7.4 libapache2-mod-php7.4 php7.4-intl php7.4-mysql php7.4-curl php7.4-cli php7.4-zip php7.4-xml php7.4-gd php7.4-gmp php7.4-common php7.4-mbstring php7.4-xmlrpc php7.4-json php7.4-sqlite3 php7.4-ldap php7.4-imap php7.4-pgsql php7.4-ssh2 php7.4-soap php7.4-zip

Verify the installation by checking PHP version:

php -v

The output should look like this:

4. Download ownCloudinstallation files

After that, visit the official Owncloud website and copy the download link for the .zip archive. Right-click on "Download .ZIP" and copy the link:

The link will depend on the version of ownCloud. At the time of writing this tutorial, the latest version is 10.15.0.

Next, use the wget command along with the copied link to download the OwnCloud archive:

wget https://download.owncloud.com/server/stable/owncloud-complete-20240724.zip -P /tmp

Next, extract the installation files:

unzip /tmp/owncloud-complete-20240724.zip -d /var/www

5. Create Virtual Host file for ownCloud

Run this command to create the Virtual Host file for ownCloud (you can use your preferred text editor):

nano /etc/apache2/sites-available/owncloud.conf

Inside the file, paste this content:

Alias /owncloud "/var/www/owncloud/"

<Directory /var/www/owncloud/>
   Options +FollowSymlinks
   AllowOverride All

<IfModule mod_dav.c>
   Dav off
   </IfModule>

   SetEnv HOME /var/www/owncloud
   SetEnv HTTP_HOME /var/www/owncloud

 </Directory>

Save changes and exit.

Next run these commands to enable configurations file and restart Apache2:
a2ensite owncloud.conf
a2enmod env rewrite dir mime headers setenvif ssl
systemctl restart apache2

6. Create Folders for ownCloud and set permissions

You also need to create some folders to run ownCloud:

mkdir -p /var/www/owncloud/data
mkdir -p /var/www/owncloud/apps-external

Set correct permissions:

chown -R www-data:www-data /var/www/owncloud
chmod -R 770 /var/www/owncloud

After setting up the correct permissions, restart Apache:

systemctl restart apache2

7. Access ownCloud

Now, you can connect to your ownCloud by entering your server's IP address followed by /owncloud in your web browser:

server_ip_address/owncloud

Next, you will see the "Login" page. Here, you need to create an administrator account with a password.

Then select click "Storage & database".

Leave the "Data Folder" path as it is by default.

Select MySQL/MariaDB and enter the database name, username, and the password you created earlier. Then, click Finish Setup:

Next, enter your new administrator account username and password:

Congratulations! You are now connected to your ownCloud dashboard!

Conclusion

In conclusion, installing ownCloud is a straightforward process that allows you to set up your own private cloud storage solution. By following the steps outlined in this guide, you'll have your own secure and customizable file-sharing platform ready for use.

For more information about ownCloud, you can refer to the official documentation.

Sign In or Register to comment.

Time4VPS

Learn how to install a web and database server, email, FTP client or other applications. Discover and share information on server security or optimization recommendations.
Feel free to join our constantly expanding community, participate in discussions, strengthen your knowledge on Linux and Windows server management!
© 2013 - 2025 Time4VPS. All rights reserved.

Get In Touch