---
title: How to Deploy ownCloud - An Opensource File-sharing Application and Alternative to Google Drive
url: https://docs.vultr.com/how-to-deploy-owncloud-an-opensource-file-sharing-application-and-alternative-to-google-drive
description: Learn how to deploy ownCloud, a secure open-source file-sharing solution that gives you complete control over your data as an alternative to Google Drive.
publish_date: 2025-05-28T14:13:04.256457Z
last_updated: 2026-09-11T16:40:45.333216Z
author: Kunwar Abhay Singh
header_image: https://docs.vultr.com/public/doc-assets/2226/49ff80ea-03af-4f93-9b3c-e8a0d50f9416.png
---

> Index of every Vultr Docs page in markdown: https://docs.vultr.com/llms.txt

ownCloud is an open-source file-sharing platform that enables you to store, sync, and manage files from a self-hosted server. It offers a privacy-focused alternative to cloud services like Google Drive and Dropbox by giving you full control over your data and infrastructure.

In this article, you will deploy ownCloud on an Ubuntu 24.04 server using Docker. You’ll set up a MariaDB database container, secure your environment, access the ownCloud web interface, and explore features such as file sharing, user management, and app integration.

## Prerequisites

Before you begin:

* Have access to an [Ubuntu 24.04 instance](https://www.vultr.com/servers/ubuntu/) as a non-root sudo user.
* Create a domain A record that points to your server’s IP address. For example, `cloud.example.com`.

## Install ownCloud Using Docker Compose

Docker Compose provides a structured way to manage multi-container applications like ownCloud. This method allows you to define services, networks, and volumes in a single file and manage them together with simple commands.

### Install Docker Compose

1. Update your `APT` package index.

    ```console
    $ sudo apt update
    ```

1. Install Docker.

    ```console
    $ sudo apt install docker.io -y
    ```

1. Enable and start Docker.

    ```console
    $ sudo systemctl enable docker
    ```

    ```console
    $ sudo systemctl start docker
    ```

1. Add your `user` to the docker group to avoid using `sudo` with every command.

    ```console
    $ sudo usermod -aG docker $USER
    ```

    Log out and log back in to apply the change.

1. Install the new Docker Compose plugin.

    ```console
    $ mkdir -p ~/.docker/cli-plugins
    ```

    ```console
    $ curl -SL https://github.com/docker/compose/releases/latest/download/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
    ```

    ```console
    $ chmod +x ~/.docker/cli-plugins/docker-compose
    ```

1. Verify the installation.

    ```console
    $ docker compose version
    ```

    Output should be similar to:

    ```
    Docker Compose version v2.X.X
    ```

### Deploy ownCloud with Docker Compose

1. Create a project directory and switch into it.

    ```console
    $ mkdir ~/owncloud
    ```

    ```console
    $ cd ~/owncloud
    ```

1. Create a `docker-compose.yml` file.

    ```console
    $ nano docker-compose.yml
    ```

1. Add the following configuration to define the ownCloud and MariaDB services:

    ```yaml
    version: "3"

    volumes:
      files:
        driver: local
      mysql:
        driver: local
      redis:
        driver: local

    services:
      owncloud:
        image: owncloud/server:${OWNCLOUD_VERSION}
        container_name: owncloud_server
        restart: always
        ports:
          - ${HTTP_PORT}:8080
        depends_on:
          - mariadb
          - redis
        environment:
          - OWNCLOUD_DOMAIN=${OWNCLOUD_DOMAIN}
          - OWNCLOUD_TRUSTED_DOMAINS=${OWNCLOUD_TRUSTED_DOMAINS}
          - OWNCLOUD_DB_TYPE=mysql
          - OWNCLOUD_DB_NAME=owncloud
          - OWNCLOUD_DB_USERNAME=owncloud
          - OWNCLOUD_DB_PASSWORD=owncloud
          - OWNCLOUD_DB_HOST=mariadb
          - OWNCLOUD_ADMIN_USERNAME=${ADMIN_USERNAME}
          - OWNCLOUD_ADMIN_PASSWORD=${ADMIN_PASSWORD}
          - OWNCLOUD_MYSQL_UTF8MB4=true
          - OWNCLOUD_REDIS_ENABLED=true
          - OWNCLOUD_REDIS_HOST=redis
        healthcheck:
          test: ["CMD", "/usr/bin/healthcheck"]
          interval: 30s
          timeout: 10s
          retries: 5
        volumes:
          - files:/mnt/data

      mariadb:
        image: mariadb:10.11 # minimum required ownCloud version is 10.9
        container_name: owncloud_mariadb
        restart: always
        environment:
          - MYSQL_ROOT_PASSWORD=owncloud
          - MYSQL_USER=owncloud
          - MYSQL_PASSWORD=owncloud
          - MYSQL_DATABASE=owncloud
          - MARIADB_AUTO_UPGRADE=1
        command: ["--max-allowed-packet=128M", "--innodb-log-file-size=64M"]
        healthcheck:
          test: ["CMD", "mysqladmin", "ping", "-u", "root", "--password=owncloud"]
          interval: 10s
          timeout: 5s
          retries: 5
        volumes:
          - mysql:/var/lib/mysql

      redis:
        image: redis:6
        container_name: owncloud_redis
        restart: always
        command: ["--databases", "1"]
        healthcheck:
          test: ["CMD", "redis-cli", "ping"]
          interval: 10s
          timeout: 5s
          retries: 5
        volumes:
          - redis:/data
    ```

    Replace environment values like `securepassword` with secure production credentials.

1. Start the containers using Docker Compose.

    ```console
    $ docker compose up -d
    ```

1. Check that both services are running.

    ```console
    $ docker compose ps
    ```

    Output should show both the `owncloud` and `db` containers as `Up`.

## Configure ownCloud

After deploying ownCloud with Docker Compose, secure and optimize it for production use with HTTPS, a reverse proxy using Nginx, and proper firewall configuration.

### Configure Nginx as a Reverse Proxy

1. Install Nginx if it’s not already installed.

    ```console
    $ sudo apt update
    ```

    ```console
    $ sudo apt install nginx -y
    ```

1. Create a configuration file for ownCloud.

    ```console
    $ sudo nano /etc/nginx/sites-available/owncloud
    ```

1. Paste the following, replacing `cloud.example.com` with your domain:

    ```ini
    server {
       listen 80;
       server_name cloud.example.com;

       location / {
           proxy_pass http://localhost:8080/;
           proxy_set_header Host $host;
           proxy_set_header X-Real-IP $remote_addr;
           proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
           proxy_set_header X-Forwarded-Proto $scheme;
       }
    }
    ```

1. Enable the configuration.

    ```console
    $ sudo ln -s /etc/nginx/sites-available/owncloud /etc/nginx/sites-enabled/
    ```

    ```console
    $ sudo nginx -t
    ```

    ```console
    $ sudo systemctl reload nginx
    ```

### Allow Nginx Through the Firewall

1. Open HTTP and HTTPS ports.

    ```console
    $ sudo ufw allow 'Nginx Full'
    ```

    ```console
    $ sudo ufw reload
    ```

### Secure ownCloud with HTTPS

1. Install Certbot and the Nginx plugin.

    ```console
    $ sudo apt install certbot python3-certbot-nginx -y
    ```

1. Generate and apply a TLS certificate.

    ```console
    $ sudo certbot --nginx -d cloud.example.com
    ```

    Certbot will automatically edit your Nginx config to enable HTTPS.

### Enable Automatic Renewal

1. Ensure Certbot renewal is scheduled.

    ```console
    $ sudo systemctl enable certbot.timer
    ```

1. Test the renewal process.

    ```console
    $ sudo certbot renew --dry-run
    ```

### Verify Setup

Open your browser and navigate to:

```
https://cloud.example.com
```

You should see the ownCloud setup wizard served securely over HTTPS.

## Access and Set Up ownCloud

Complete the final setup through the ownCloud web interface:

1. Open your browser and visit your domain over HTTPS.

    ```
    https://cloud.example.com
    ```

1. The ownCloud setup wizard will appear.

1. Create an admin account by choosing a secure **username** and **password**.

1. Under **Database Configuration**, enter the following:

   * **Database user**: `ownclouduser`
   * **Database password**: the password you used when starting the MariaDB container
   * **Database name**: `owncloud`
   * **Database host**: `owncloud-db`

1. Click **Finish Setup**.

After setup completes, you'll be redirected to the login page. Use your admin credentials to sign in and access the ownCloud dashboard.

## Manage and Share Files with ownCloud

After logging into the ownCloud dashboard, you can begin managing your files:

1. **Upload and organize files** using the web interface. Drag-and-drop support is available.
1. **Create folders and move files** to structure your storage.
1. **Share files or folders** via public or private links. You can:

    * Set expiration dates
    * Require passwords
    * Enable or disable editing

1. **Create user groups** and set granular permissions for collaboration.
1. **Sync files across devices** by installing the [ownCloud desktop or mobile clients](https://owncloud.com/download/). These apps automatically synchronize your data between the server and your devices.

ownCloud also supports WebDAV, making it compatible with third-party tools and OS-native file managers.

## Install and Manage Apps in ownCloud

??? note "Install and Manage Apps in ownCloud (Optional)"

    ownCloud includes an integrated **App Marketplace** that allows you to extend your server with additional features.

    1. **Access the App Marketplace**:

        * Log in as an admin user.
        * Click the **Apps** icon in the top navigation bar.

    1. **Browse or search** for apps based on categories like productivity, storage, authentication, or multimedia.

    1. **Enable an app**:

        * Click **Enable** next to the desired app.
        * Some apps may require additional configuration after activation.

    1. **Popular apps include**:

        * **Calendar** – Schedule and share events with users or groups.
        * **Contacts** – Manage address books and sync them across devices.
        * **External Storage** – Integrate with Dropbox, Google Drive, S3, or local mount points.

    1. **Manage installed apps**:

        * Use the **Enabled** tab to view or disable currently active apps.
        * Some apps offer settings accessible via the **Settings** panel under the **Admin** section.

    Refer to the [official app documentation](https://doc.owncloud.com/server/admin_manual/configuration/apps/index.html) for details on configuring specific apps or developing custom ones.

## Backup and Restore ownCloud Data

To ensure data durability and prevent accidental loss, regularly back up your ownCloud installation. This includes both **user files** and **database content**.

???+ note "Backup with Docker Volumes"

    If you deployed ownCloud using Docker, your data is typically stored in a named volume like `owncloud_files`.

    1. Export the ownCloud data volume to a tarball.

        ```console
        $ docker run --rm \
         -v files:/volume \
         -v $(pwd):/backup \
         alpine \
         tar -czf /backup/owncloud_files_backup.tar.gz -C /volume .
        ```

        This command saves a `.tar.gz` backup of the ownCloud volume to the current directory on your host.

    1. Backup the MariaDB data directory (optional but recommended). If using a MariaDB container, you can similarly back up its volume.

        ```console
        $ docker run --rm \
         -v mysql:/volume \
         -v $(pwd):/backup \
         alpine \
         tar -czf /backup/mariadb_backup.tar.gz -C /volume .
        ```

??? note "Restore from a Tarball Backup"

    To restore the ownCloud volume:

    1. Create a fresh volume (if needed).

        ```console
        $ docker volume create files
        ```
        
        ```console
        $ docker volume create mysql
        ```

    1. Restore contents into it.

        ```console
        $ docker run --rm \
         -v files:/volume \
         -v $(pwd):/backup \
         alpine \
         tar -xzf /backup/owncloud_files_backup.tar.gz -C /volume
        ```

    Apply the same process to your MariaDB volume if restoring database content.

### Backup Best Practices

* Perform regular backups (daily or weekly) using a scheduled cron job.
* Store backups off-server (e.g., to S3, rsync to remote machine).
* Use snapshot-based backups if deploying with cloud storage.

For production deployments, also consider backing up your `docker-compose.yml` and `.env` files if using Docker Compose.

## Conclusion

In this article, you deployed ownCloud on an Ubuntu 24.04 server using Docker. You configured a secure MariaDB backend, set up reverse proxy and firewall rules, optionally enabled SSL with Let's Encrypt, and accessed the ownCloud dashboard via the browser. You also explored optional configurations like background cron jobs, app installation, and backup strategies.

With ownCloud, you gain full control over your file storage and collaboration environment, making it a powerful alternative to third-party platforms like Google Drive and Dropbox.

To explore advanced features or troubleshoot issues, refer to the official documentation:

* [ownCloud Docs](https://doc.owncloud.com/)
* [Docker Docs](https://docs.docker.com/)
* [MariaDB Docs](https://mariadb.com/kb/en/)
