Introduction
ownCloud is a self-hosted file sync and share server that allows you to store and access your files, contacts, calendars, and more. This tutorial will guide you through the process of installing ownCloud on Debian 12.
Prerequisites
Before you begin, ensure you have:
- A Debian 12 server or desktop system
- Root or sudo privileges
Step 1: Install Prerequisites
Update the package index and install the required packages:
sudo apt update
sudo apt install -y apache2 mariadb-server libapache2-mod-php php-gd php-json php-mysql php-curl php-mbstring php-intl php-imagick php-xml php-zip
Step 2: Configure MariaDB
Secure the MariaDB installation:
sudo mysql_secure_installation
Log in to the MariaDB root account:
sudo mysql -u root -p
Create a database and user for ownCloud:
CREATE DATABASE owncloud;
GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud'@'localhost' IDENTIFIED BY 'your_password';
FLUSH PRIVILEGES;
EXIT;
Step 3: Download ownCloud
Download the latest version of ownCloud:
wget https://download.owncloud.org/community/owncloud-complete-*.zip
Extract the downloaded file:
sudo apt install unzip
unzip owncloud-complete-*.zip -d /var/www/html/
Step 4: Configure Apache
Enable the required Apache modules:
sudo a2enmod rewrite
sudo a2enmod headers
sudo a2enmod env
sudo a2enmod dir
sudo a2enmod mime
sudo systemctl restart apache2
Step 5: Set Permissions
Set the correct permissions on the ownCloud directory:
sudo chown -R www-data:www-data /var/www/html/owncloud/
Step 6: Complete the Installation
Open a web browser and navigate to your server's IP address or domain followed by /owncloud (e.g., http://your_server_ip/owncloud). Follow the on-screen instructions to complete the installation.
Conclusion
Congratulations! You have successfully installed ownCloud on Debian 12. You can now start using ownCloud to store and manage your files, contacts, calendars, and more.