Install ownCloud Server on Debian 11

0
176

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.

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

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 -y

Install PHP and Other Required Modules;

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

You can check about system requirements for ownCloud installation.

Install ownCloud Server on Debian 11

Install ownCloud repository

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;

apt install curl gnupg2 -y
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 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-complete-files -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
  owncloud-deps
The following packages will be upgraded:
  owncloud-complete-files
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/32.3 MB of archives.
After this operation, 228 MB of additional disk space will be used.
apt-listchanges: Reading changelogs...
(Reading database ... 89896 files and directories currently installed.)
Preparing to unpack .../owncloud-complete-files_10.8.0-1+3.2_all.deb ...
Unpacking owncloud-complete-files (10.8.0-1+3.2) over (10.8.0-1+3.2) ...
Setting up owncloud-complete-files (10.8.0-1+3.2) ...

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

Enable ownCloud site.

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

Disable default Apache site;

a2dissite 000-default.conf

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

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 [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 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.
Install ownCloud Server on Debian 11

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.

Install ownCloud Server on Debian 11

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

owncloud ui

And that is it on how to install ownCloud Server on Debian 11. 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

LEAVE A REPLY

Please enter your comment!
Please enter your name here