dotlinux blog

How to Install OwnCloud to Create Your Own Cloud Storage in Linux

In today's digital age, having your own cloud storage solution offers numerous benefits such as data privacy, control over your files, and the ability to access your data from anywhere. OwnCloud is a popular open-source self-hosted file sync and share platform that allows you to set up your very own cloud storage on a Linux server. In this blog post, we'll walk you through the step-by-step process of installing OwnCloud.

2026-04

Table of Contents#

  1. Prerequisites
  2. Installing Dependencies
  3. Downloading OwnCloud
  4. Configuring the Web Server
  5. Setting Up the Database
  6. Installing OwnCloud
  7. Post-Installation Configuration
  8. Securing OwnCloud
  9. Conclusion

1. Prerequisites#

Before you start the installation process, make sure you have the following:

  • A Linux server (we'll use Ubuntu 20.04 in this example, but the steps can be adapted for other Linux distributions).
  • A non-root user with sudo privileges.
  • A LAMP (Linux, Apache, MySQL/MariaDB, PHP) stack installed. If you don't have it, you can install it using the following commands:
sudo apt update
sudo apt install apache2 mysql-server php libapache2-mod-php php-mysql php-gd php-json php-curl php-mbstring php-intl php-imagick php-xml php-zip

2. Installing Dependencies#

OwnCloud has some additional dependencies. Install them using the following command:

sudo apt install redis-server php-redis

3. Downloading OwnCloud#

First, create a directory for OwnCloud:

sudo mkdir /var/www/owncloud

Then, change the ownership of the directory:

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

Now, download the latest version of OwnCloud. You can check the official website for the latest stable release URL. For example, if the latest version is 10.11.0:

wget https://download.owncloud.org/community/owncloud-10.11.0.zip -P /var/www/owncloud

Unzip the downloaded file:

sudo -u www-data unzip /var/www/owncloud/owncloud-10.11.0.zip -d /var/www/owncloud

Remove the zip file:

sudo rm /var/www/owncloud/owncloud-10.11.0.zip

4. Configuring the Web Server#

Create a new virtual host configuration file for OwnCloud. For Apache, the file is usually in the /etc/apache2/sites-available/ directory. Let's call it owncloud.conf:

sudo nano /etc/apache2/sites-available/owncloud.conf

Add the following content (adjust the ServerName according to your domain or server IP):

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName yourdomain.com
    DocumentRoot /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>
 
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Enable the virtual host and the necessary Apache modules:

sudo a2ensite owncloud.conf
sudo a2enmod rewrite headers env dir mime
sudo systemctl restart apache2

5. Setting Up the Database#

Log in to the MySQL/MariaDB shell:

sudo mysql -u root -p

Create a new database for OwnCloud:

CREATE DATABASE ownclouddb;

Create a new user and grant privileges:

CREATE USER 'ownclouduser'@'localhost' IDENTIFIED BY 'yourpassword';
GRANT ALL PRIVILEGES ON ownclouddb.* TO 'ownclouduser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

6. Installing OwnCloud#

Now, point your web browser to http://yourdomain.com (replace yourdomain.com with your actual domain or server IP). You'll be greeted with the OwnCloud installation wizard.

  • Enter an admin username and password.
  • Select "MySQL/MariaDB" as the database type.
  • Enter the database name (ownclouddb), username (ownclouduser), password (yourpassword), and host (localhost).
  • Click "Finish setup".

7. Post-Installation Configuration#

After the installation, you can configure additional settings such as enabling apps (OwnCloud has a wide range of apps for different functionalities like document editing, calendar, etc.). You can also adjust storage settings, user quotas, etc. from the admin dashboard.

8. Securing OwnCloud#

  • Enable HTTPS: Obtain an SSL certificate (for example, using Let's Encrypt) and configure Apache to use HTTPS. This is crucial for securing data in transit.
  • Regular Updates: Keep OwnCloud and its dependencies up to date to patch security vulnerabilities.
  • User Management: Set proper user permissions and manage user accounts carefully.

9. Conclusion#

Congratulations! You've successfully installed OwnCloud on your Linux server and created your own cloud storage solution. Now you can start uploading, sharing, and syncing your files securely. Remember to regularly maintain and secure your OwnCloud instance to ensure the safety of your data.

References#