Install ownCloud Server on Debian 10 Buster

17
4810

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. In this guide, we are going to learn how to install ownCloud Server on Debian 10 Buster.

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

Install 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.

apt update

Next, run the commands below to install Apache and MariaDB.

apt install apache2 mariadb-server mariadb-client

At the moment, ownCloud doesn’t support PHP 7.3 which is the default PHP version on Debian 10 repositories. Hence, you need to install PHP 7.2 and the required modules by running the commands below;

First you need to 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 distribution maintained by ownCloud itself. The ownCloud repos for Debian 10 however are not available yet. Hence, since the repos for Debian 9 contains the latest ownCloud release, we are going to use it.

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

apt install curl gnupg2 -y
curl https://download.owncloud.org/download/repositories/10.2.1/Debian_9.0/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.2.1/Debian_9.0/ /' > /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 [email protected] identified by "[email protected]";
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

17 COMMENTS

  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 😉

  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.

    • 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
      ...

  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!

  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 …..

LEAVE A REPLY

Please enter your comment!
Please enter your name here