Install ownCloud Server on Debian 12

|
Last Updated:
|
|

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

System Requirements

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

Run system update

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

apt update

Install Apache Web Server;

Check how to install Apache web server on Debian 12 by following the guide below;

Install Apache Web Server on Debian 12

Install MariaDB on Debian 12

MariaDB 10.11 is the current latest version of MariaDB that is supported and is the current available version on the default Debian 12 repositories.

Hence, to install MariaDB 10.11, check the guide below;

Install MariaDB 10 on Debian 12

Install PHP on Debian 12

Debian 12 default repositories ship with PHP 8.2. ownCloud at the moment suppors only upto the PHP 7.4 LTS Service even though it has reached its end of life.

Thus, you need to install PHP 7.4 and other Required Modules for ownCloud;

Install PHP 7.4 on Debian 12

Verify the version of PHP installed;

php -v

PHP 7.4.33 (cli) (built: Jun  9 2023 07:41:51) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies

Install extra PHP modules;

apt install libapache2-mod-php7.4 php7.4-{mysql,intl,curl,gd,xml,mbstring,zip} -y

Installing ownCloud Server on Debian 12

Install ownCloud repository

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

There are available different ownCloud repos for various Debian release versions. Unfortunately, as of this writing, there isn’t a repo for Debian 12. Hence, we will a repo for Debian 11, which can be installed as follows;

echo \
'deb http://download.opensuse.org/repositories/isv:/ownCloud:/server:/10/Debian_11/ /' \
> /etc/apt/sources.list.d/isv:ownCloud:server:10.list

Install ownCloud Repository Signing Key

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

Install ownCloud Server

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

Configure Apache for ownCloud

When ownCloud is installed, it places its web files under the /var/www/owncloud directory.

ls -1 /var/www/owncloud

apps
apps-external
assets
AUTHORS
CHANGELOG.md
config
console.php
COPYING
core
cron.php
data
db_structure.xml
etc
index.html
index.php
lib
occ
ocm-provider
ocs
ocs-provider
public.php
README.md
remote.php
resources
robots.txt
settings
status.php
updater
version.php

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. Ensure the output is Syntax OK.

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 php7.4

Update ownership of the ownCloud root directory;

chown -R www-data: /var/www/owncloud

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 12
  • Set the database connection details as created above.
Install ownCloud Server on Debian 12

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

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 12

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

Install ownCloud Server on Debian 12

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
Kifarunix
Linux Certified Engineer, with a passion for open-source technology and a strong understanding of Linux systems. With experience in system administration, troubleshooting, and automation, I am skilled in maintaining and optimizing Linux infrastructure.

Leave a Comment