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.
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.
Login with your Admin user account details you defined during setup. After a successful login, you will land on ownCloud dashboard.
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
Does it work on Raspbian too?
I think the latest versions of Pi can run Debian Buster. If so then, you can try and give us feedback. Thank you
I’ll stick with Stretch for now.
Errors come to owncloud 9 after upsate from stretch to buster.
What are these errors Starvos?
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 😉
We are glad that it helped you Yoann. Enjoy
The following command to curl the PGP signing key for owncloud displays the following error:
curl https://download.owncloud.org/download/repositories/10.2.1/Debian_9.0/Release.key | apt-key add –
curl: (23) Failed writing body (0 != 4485)
Please ensure you have gnupg installed.
Run the command below and try again.
apt install gnupg2
I have the same problem and previously
I was installed gnupg2. Please help
Thank you so much! You save my day!
For the one who needs to set PHP 7.2 to work with Apache web server, please follow section 8 in this:
https://www.tecmint.com/install-different-php-versions-in-ubuntu/
For the one who installed mysql, try to remove completely mysql then install mariaDB again if the above instruction doesn’t work for you.
We are glad the tutorial helped you Tung!
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
...
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!
Thank you for your feedback buddy. Enjoy
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 …..
fiz a configuração toda, no primeiro acesso funcionou, agora apenas http erro 599