Skip to main content

Command Palette

Search for a command to run...

Deploying ownCloud File Sharing Platform on Ubuntu 24.04

Step-by-step guide to deploy ownCloud with MariaDB, Redis, Docker Compose, and Traefik on Ubuntu 24.04, with persistent storage and automatic HTTPS for a self-hosted file sharing platform.

Updated
2 min read
Deploying ownCloud File Sharing Platform on Ubuntu 24.04
S
A Developer Advocate with a focus on improving the developer experience through clear communication, technical enablement, and community engagement.
A
DevOps Engineer with experience in Kubernetes, automation, cloud infrastructure, and observability. I work in Developer Relations, contribute to technical documentation, and collaborate on engineering-focused projects.

ownCloud is an open-source file sharing platform that lets you store, sync, and share files from a self-hosted server, with desktop, mobile, and web clients across every major platform. This guide deploys ownCloud with a MariaDB backend and Redis cache using Docker Compose, with Traefik handling automatic HTTPS, following file sharing platform deployment practices documented in Vultr Docs.


Set Up the Directory Structure

1. Create the project directory structure:

mkdir -p ~/owncloud/{files,mysql,redis,letsencrypt}
cd ~/owncloud

2. Create the environment file:

nano .env
OWNCLOUD_DOMAIN=owncloud.example.com
ADMIN_USERNAME=admin
ADMIN_PASSWORD=STRONG_ADMIN_PASSWORD

DB_PASSWORD=STRONG_DB_PASSWORD
DB_ROOT_PASSWORD=STRONG_ROOT_PASSWORD

LETSENCRYPT_EMAIL=admin@example.com

Deploy with Docker Compose

1. Add your user to the Docker group:

sudo usermod -aG docker $USER
newgrp docker

2. Create the Docker Compose manifest:

nano docker-compose.yml
services:
  traefik:
    image: traefik:latest
    container_name: traefik
    restart: unless-stopped
    environment:
      DOCKER_API_VERSION: "1.44"
    command:
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.websecure.address=:443"
      - "--entrypoints.web.http.redirections.entrypoint.to=websecure"
      - "--entrypoints.web.http.redirections.entrypoint.scheme=https"
      - "--certificatesresolvers.le.acme.httpchallenge=true"
      - "--certificatesresolvers.le.acme.httpchallenge.entrypoint=web"
      - "--certificatesresolvers.le.acme.email=${LETSENCRYPT_EMAIL}"
      - "--certificatesresolvers.le.acme.storage=/letsencrypt/acme.json"
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./letsencrypt:/letsencrypt

  mariadb:
    image: mariadb:10.11
    container_name: owncloud_db
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
      MYSQL_USER: owncloud
      MYSQL_PASSWORD: ${DB_PASSWORD}
      MYSQL_DATABASE: owncloud
    volumes:
      - ./mysql:/var/lib/mysql
    healthcheck:
      test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
      interval: 10s
      timeout: 5s
      retries: 3

  redis:
    image: redis:latest
    container_name: owncloud_redis
    restart: unless-stopped
    volumes:
      - ./redis:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 3

  owncloud:
    image: owncloud/server:latest
    container_name: owncloud_server
    restart: unless-stopped
    depends_on:
      mariadb:
        condition: service_healthy
      redis:
        condition: service_healthy
    environment:
      OWNCLOUD_DOMAIN: ${OWNCLOUD_DOMAIN}
      OWNCLOUD_DB_TYPE: mysql
      OWNCLOUD_DB_NAME: owncloud
      OWNCLOUD_DB_USERNAME: owncloud
      OWNCLOUD_DB_PASSWORD: ${DB_PASSWORD}
      OWNCLOUD_DB_HOST: mariadb
      OWNCLOUD_ADMIN_USERNAME: ${ADMIN_USERNAME}
      OWNCLOUD_ADMIN_PASSWORD: ${ADMIN_PASSWORD}
      OWNCLOUD_REDIS_ENABLED: "true"
      OWNCLOUD_REDIS_HOST: redis
    volumes:
      - ./files:/mnt/data
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.owncloud.rule=Host(`${OWNCLOUD_DOMAIN}`)"
      - "traefik.http.routers.owncloud.entrypoints=websecure"
      - "traefik.http.routers.owncloud.tls=true"
      - "traefik.http.routers.owncloud.tls.certresolver=le"
      - "traefik.http.services.owncloud.loadbalancer.server.port=8080"

3. Start the services:

docker compose up -d

4. Verify the services are running:

docker compose ps

Access ownCloud

Open https://owncloud.example.com in a browser and sign in with ADMIN_USERNAME and ADMIN_PASSWORD from .env. The dashboard loads with file management and the app marketplace.


Next Steps

ownCloud is running and served securely over HTTPS. From here you can:

  • Install the desktop and mobile clients for two-way sync

  • Add users, groups, and per-folder sharing policies

  • Enable apps from the marketplace (Files Antivirus, OnlyOffice, Talk)

For the full guide with additional tips, visit the original article on Vultr Docs.

The Self-Hosted Stack

Part 38 of 50

The Self-Hosted Stack is a developer-focused series exploring open-source tools you can deploy, run, and manage on your own infrastructure. From AI platforms and databases to developer tools, observability stacks, and authentication systems, each guide walks through deploying production-ready open-source software on Vultr cloud infrastructure.

Up next

Deploying Pi-hole DNS Sinkhole Service on Ubuntu 24.04

Step-by-step guide to deploy Pi-hole with Docker Compose and Traefik on Ubuntu 24.04, freeing port 53 and securing the admin dashboard with automatic HTTPS.

More from this blog

V

Vultr

71 posts

Vultr is a global cloud infrastructure provider trusted by developers and businesses in 185+ countries. We publishe hands-on guides spanning Linux administration, server configuration, DevOps, networking, open source stacks, AI code agents, and Vultr product walkthroughs, all tested against real cloud environments and built for engineers who ship.