Install ownCloud Server on Debian 10 Buster

|
Last Updated:
|
|

In this guide, we are going to learn how to install ownCloud Server on Debian 10 Buster. If you need to have your own self-hosted cloud storage that provides a safe, secure, and compliant file synchronization and sharing solution, try ownCloud.

Our previous guide was about upgrading ownCloud 9 to ownCloud 10. See the link below;

How to Upgrade ownCloud 9 to ownCloud 10 on Ubuntu 16.04

Installing ownCloud Server on Debian 10 Buster

Prerequisites

In order to install and setup ownCloud on Debian 10 Buster, you need to have LAMP Stack components installed.

Run system update

Ensure your system package cache is up-to-date.

apt update

Install and Setup LAMP Stack

To begin with, run the commands below to install Apache and MariaDB.

apt install apache2 mariadb-server mariadb-client

Install PHP 7.3 and Other Required Modules;

As of this writing, the current release versions of ownCloud supports php 7.3, which is available as the default PHP version on Debian 10 repositories.

apt install php libapache2-mod-php php-{mysql,intl,curl,json,gd,xml,mbstring,zip}
php -v
PHP 7.3.14-1~deb10u1 (cli) (built: Feb 16 2020 15:07:23) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.14, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.14-1~deb10u1, Copyright (c) 1999-2018, by Zend Technologies

If for some reasons you are installing a version that doesn’t support PHP 7.3, you can install PHP 7.2 as follows;

Create some repo to enable you install PHP 7.2 on Debian 10.

wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list

Next, run system update and install PHP 7.2 and the required extensions.

apt update
apt install php7.2 libapache2-mod-php7.2 php7.2-{mysql,intl,curl,json,gd,xml,mb,zip}

Install ownCloud on Debian 10 Buster

Install ownCloud repository

Owncloud is not included by default on Debian 10 repositories. However, there is repo for each Linux distribution maintained by ownCloud itself. There are available different ownCloud repos for various release versions.

Before you can install the ownCloud repo, first install repo PGP signing key.

apt install curl gnupg2 -y

Note that ownCloud 10.4.1 is the current stable release version. Be sure to replace the release version number accordingly.

VER=10.4.1
curl https://download.owncloud.org/download/repositories/$VER/prod/Debian_10/Release.key | apt-key add -

Once you install the repository signing key, proceed to install ownCloud repository by executing the command below;

echo 'deb http://download.owncloud.org/download/repositories/10.4.1/prod/Debian_10/ /' > /etc/apt/sources.list.d/owncloud.list

Next, once again, resynchronize system packages to their latest versions.

apt update

Once the update is done, install owncloud.

apt install owncloud-files

Configure Apache for ownCloud

When ownCloud is installed, it places its web files under the /var/www/owncloud directory. In order to configure Apache to server the ownCloud content, you need to create ownCloud Apache configuration file where you can define the ownCloud directory as your root directory.

vim /etc/apache2/sites-available/owncloud.conf
Alias / "/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 the configuration file and enable ownCloud site.

ln -s /etc/apache2/sites-available/owncloud.conf /etc/apache2/sites-enabled/

Enable additional recommended Apache modules.

a2enmod rewrite mime unique_id

Verify Apache configuration syntax.

apachectl -t

Restart Apache if the configuration is fine.

systemctl restart apache2

Create ownCloud Database and User

Login to MariaDB database server and create ownCloud database and database user. Note that with MariaDB 10, authentication is via the unix socket plugin and hence no root password is required.

mysql

If you already enabled password authentication, then login via;

mysql -u root -p
create database ownclouddb;
grant all on ownclouddb.* to ocadmin@localhost identified by "StrongP@ss";
flush privileges;
quit

Finalize ownCloud Configuration

To complete ownCloud installation and configuration, you need to access it via the browser using the address http://<server-IP>.

When you access the ownCloud server address, you are welcomed by the ownCloud configuration interface.

Set the ownCloud admin user and password, define the ownCloud data directory (/var/www/owncloud/data is the default), set the database connection details as created above.

Install ownCloud Server on Debian 10 Buster

Once you done with configuration, click Finish setup to finalize ownCloud configuration on Debian 10 Buster.

When configuration completes, you will get to a login page. Enter your admin user login details to login to ownCloud dashboard.

ownCloud login on Debian 10 Buster

Login with your Admin user account details you defined during setup. After a successful login, you will land on ownCloud dashboard.

owncloud dashboard on Debian 10 buster

There you go. You have successfully installed and configured ownCloud server on Debian 10 Buster. You can now create different folders and share with your relevant users. Enjoy.

You can read our other guides by following the links below;

Configure ownCloud OpenLDAP Authentication

Install phpMyAdmin with Nginx on Debian 10 Buster

Install MySQL 8 on Debian 10 Buster

Install OpenVAS 10 (GVM) on Debian 10 Buster

Install LAMP Stack with MariaDB 10 on Debian 10 Buster

SUPPORT US VIA A VIRTUAL CUP OF COFFEE

We're passionate about sharing our knowledge and experiences with you through our blog. If you appreciate our efforts, consider buying us a virtual coffee. Your support keeps us motivated and enables us to continually improve, ensuring that we can provide you with the best content possible. Thank you for being a coffee-fueled champion of our work!

Photo of author
koromicha
I am the Co-founder of Kifarunix.com, Linux and the whole FOSS enthusiast, Linux System Admin and a Blue Teamer who loves to share technological tips and hacks with others as a way of sharing knowledge as: "In vain have you acquired knowledge if you have not imparted it to others".

18 thoughts on “Install ownCloud Server on Debian 10 Buster”

  1. After a few tutorials with Debian 9 and php 7.2 I had only issues. Then I found yours and after a quarter of work it works perfectly!

    Thanks a lot 😉

    Reply
  2. The following command sudo apt install owncloud-files follow this:
    E: Unable to locate package owncloud-files
    I have Debian Buster by the way.

    Reply
    • Hi Maush,
      Kindly ensure that the repositories are in place.

      apt install owncloud-files
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      The following NEW packages will be installed:
      owncloud-files
      ...

      Reply
  3. Working on Rapsbian Buster running on RPi 4.
    Except for very slow MariaDB response which may provide “everything has hanged up” experience it works without any modification at all.

    Thank you very much for such great walk-through!

    Reply
  4. I have some problem with /etc/apahce2/sites-enabled/owncloud.conf
    AH00526: syntax error in line 5 of the /etc / apache2 / sites -enabled / owncloud file .conf: invalid AllowOverride command …..

    Reply

Leave a Comment