Install ownCloud Server on Debian 11

|
Last Updated:
|
|

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

Installing ownCloud Server on Debian 11

Prerequisites

In order to install and setup ownCloud on Debian 11, you need to have LAMP/LEMP Stack components installed. We use LAMP stack in this guide.

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

apt update

Before you can proceed, check about system requirements for ownCloud installation.

Install Apache Web Server;

Run the commands below to install Apache on Debian 11;

apt install apache2 -y

Install MariaDB on Debian 11

MariaDB 10.8 is the current latest version of MariaDB that is supported;

Hence, to install MariaDB 10.8, navigate to MariaDB repositories page and select your OS distro, Choose a MariaDB Server version and repository mirror.

The copy and run the repository installation commands;

apt install apt-transport-https curl gnupg2 -y
wget -qO- https://mariadb.org/mariadb_release_signing_key.asc \
| gpg --dearmor > /etc/apt/trusted.gpg.d/mariadb.gpg
echo \
'deb https://mirrors.xtom.nl/mariadb/repo/10.8/debian bullseye main' \
> /etc/apt/sources.list.d/mariadb.list

You can now install MariaDB 10.8 from the MariaDB repository using the command below;

apt update
apt install mariadb-server

Install PHP

Install PHP 7.4 and Other Required Modules;

apt install php libapache2-mod-php php-{mysql,intl,curl,json,gd,xml,mbstring,zip} -y

Install ownCloud Server

OwnCloud is not included by default on Debian 11 repositories. However, there is repo for each Linux distribution maintained by ownCloud itself.

There are available different ownCloud repos for various Debian release versions.

To install ownCloud repositories for Debian 11 server;

echo \
'deb http://download.opensuse.org/repositories/isv:/ownCloud:/server:/10/Debian_11/ /' \
> /etc/apt/sources.list.d/isv:ownCloud:server:10.list
curl -fsSL \
https://download.opensuse.org/repositories/isv:ownCloud:server:10/Debian_11/Release.key \
| gpg --dearmor > /etc/apt/trusted.gpg.d/isv_ownCloud_server_10.gpg

Once again, re-synchronize system packages to their latest versions.

apt update

Once the update is done, install owncloud.

apt install owncloud-complete-files -y

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  owncloud-deps
The following NEW packages will be installed:
  owncloud-complete-files
0 upgraded, 1 newly installed, 0 to remove and 94 not upgraded.
Need to get 65.1 MB of archives.
After this operation, 304 MB of additional disk space will be used.
Get:1 http://download.opensuse.org/repositories/isv:/ownCloud:/server:/10/Debian_11  owncloud-complete-files 10.11.0-1+7.1 [65.1 MB]
Fetched 65.1 MB in 37s (1,776 kB/s)                                                                                                                                        
Selecting previously unselected package owncloud-complete-files.
(Reading database ... 38071 files and directories currently installed.)
Preparing to unpack .../owncloud-complete-files_10.11.0-1+7.1_all.deb ...
Unpacking owncloud-complete-files (10.11.0-1+7.1) ...
Setting up owncloud-complete-files (10.11.0-1+7.1) ...

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.

Copy and paste the command below to create owncloud.conf configuration file.


cat > /etc/apache2/sites-available/owncloud.conf << 'EOL'
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>
EOL

Verify Apache configuration syntax.

apachectl -t

Enable ownCloud site.

a2ensite owncloud.conf

Disable default Apache site;

a2dissite 000-default.conf

Enable additional recommended Apache modules.

a2enmod rewrite mime unique_id php

Restart Apache if the configuration is fine.

systemctl restart apache2

Create ownCloud Database and User

Run the mysql_secure_installation script to remove test databases, disable remote root login e.t.c.

mysql_secure_installation

Login to MariaDB database server and create ownCloud database and database user.

mysql

If you already enabled password authentication, then login via;

mysql -u root -p

Next, execute the commands below to create ownCloud database and database user.

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 and define the ownCloud data directory (/var/www/owncloud/data is the default).
Install ownCloud Server on Debian 11
  • Set the database connection details as created above.
define db connection details

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

When configuration completes, you will get to a login page.

Enter your admin user login details to login to ownCloud dashboard.

owncloud login page

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

owncloud ui

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 ownCloud Desktop Client on CentOS 8

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

2 thoughts on “Install ownCloud Server on Debian 11”

  1. Ahoi. I’ve tried this on a Debian 11 and got stuck at this point.

    root@owncloud-new:~# apt update
    Get:2 http://download.opensuse.org/repositories/isv:/ownCloud:/server:/10/Debian_11 InRelease [1,527 B]
    Hit:3 http://security.debian.org/debian-security bullseye-security InRelease
    Hit:4 http://deb.debian.org/debian bullseye InRelease
    Hit:5 http://deb.debian.org/debian bullseye-updates InRelease
    Get:1 https://download.owncloud.org/download/repositories/10.4.1/prod/Debian_10 InRelease
    Err:1 https://download.owncloud.org/download/repositories/10.4.1/prod/Debian_10 InRelease
    Clearsigned file isn’t valid, got ‘NOSPLIT’ (does the network require authentication?)
    Reading package lists… Done
    E: Failed to fetch http://download.owncloud.org/download/repositories/10.4.1/prod/Debian_10/InRelease Clearsigned file isn’t valid, got ‘NOSPLIT’ (does the network require authentication?)
    E: The repository ‘http://download.owncloud.org/download/repositories/10.4.1/prod/Debian_10 InRelease’ is not signed.
    N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.

    Any Idea how to fix this.

    Redards
    Uwe

    Reply

Leave a Comment