Skip to content

Deploying an ownCloud App

Introduction

ownCloud is an open-source file sync and share platform. This guide shows how to containerize ownCloud with a Dockerfile, connect it to MySQL, persist files and configs, and deploy it to Klutch.sh over HTTP.

Prerequisites

  • GitHub repository containing your Dockerfile.
  • MySQL database (managed or deployed separately).
  • Klutch.sh project ready in klutch.sh/app.

Project structure

.
└── Dockerfile

Sample Dockerfile

FROM owncloud/server:latest
# Default ownCloud port
ENV HTTP_PORT=8080
EXPOSE 8080

Required environment variables

  • OWNCLOUD_DOMAIN – e.g., example-app.klutch.sh
  • OWNCLOUD_DB_TYPE=mysql
  • OWNCLOUD_DB_NAME
  • OWNCLOUD_DB_USERNAME
  • OWNCLOUD_DB_PASSWORD
  • OWNCLOUD_DB_HOST – MySQL host and port
  • OWNCLOUD_ADMIN_USERNAME
  • OWNCLOUD_ADMIN_PASSWORD
  • HTTP_PORT=8080

Optional environment variables

  • OWNCLOUD_REDIS_ENABLED=false (set true and configure if using Redis)
  • OWNCLOUD_TRUSTED_DOMAINS=example-app.klutch.sh
  • OWNCLOUD_LOGLEVEL=2

Persistence

ownCloud requires durable storage:

  • Mount path: /mnt/data
  • Size: based on expected user files, logs, and app data

Networking

  • Protocol: HTTP
  • Internal port: 8080
  • Users reach https://example-app.klutch.sh while Klutch.sh routes to port 8080 inside the container.
Terminal window
curl -I http://localhost:8080

Deployment on Klutch.sh

  1. Push your Dockerfile to GitHub.
  2. In klutch.sh/app, create a new app and select GitHub as the source.
  3. Klutch.sh automatically detects the Dockerfile in the repository root.
  4. Select HTTP traffic and set the internal port to 8080.
  5. Add environment variables for the MySQL connection, admin credentials, domain, and any optional settings. Mark secrets as sensitive.
  6. Attach a persistent volume at /mnt/data sized for your users’ files.
  7. Deploy. After the app starts, complete the web installer and log in with your admin account.

Verification

  • UI: open https://example-app.klutch.sh and confirm the ownCloud login screen loads.

  • Quick check:

    Terminal window
    curl -I https://example-app.klutch.sh

Next steps

  • Configure HTTPS at the edge and set trusted domains.
  • Enable Redis for caching if desired.
  • Schedule backups for MySQL and the /mnt/data volume.