Skip to content

Deploying an Owncast App

Introduction

Owncast is an open-source self-hosted live video streaming and chat server. Deploying Owncast with a Dockerfile on Klutch.sh provides reproducible builds, managed secrets, and persistent storage for streams, assets, and configuration—all configured from klutch.sh/app. This guide covers installation, repository prep, a production-ready Dockerfile, deployment steps, Nixpacks overrides, sample API usage, and production tips.


Prerequisites

  • A Klutch.sh account (sign up)
  • A GitHub repository containing your Owncast Dockerfile (GitHub is the only supported git source)
  • RTMP/ingest source (e.g., OBS) pointing to your Owncast RTMP endpoint
  • Storage sizing for video, images, and logs

For onboarding, see the Quick Start.


Architecture and ports

  • Owncast serves its web UI/API on internal port 8080; choose HTTP traffic in Klutch.sh and set the internal port to 8080.
  • RTMP ingest runs on 1935. Klutch.sh supports one port per app; if you need RTMP ingest, deploy a second app (TCP) mapped to internal 1935, or configure an external RTMP forwarder to your HTTP app’s URL if supported by your workflow.
  • Persistent storage is required for data, images, and logs.

Repository layout

owncast/
├── Dockerfile # Must be at repo root for auto-detection
└── README.md

Keep secrets out of Git; store them in Klutch.sh environment variables.


Installation (local) and starter commands

Validate locally before pushing to GitHub:

Terminal window
docker build -t owncast-local .
docker run -p 8080:8080 owncast-local

Dockerfile for Owncast (production-ready)

Place this Dockerfile at the repo root; Klutch.sh auto-detects it (no Docker selection in the UI):

FROM owncast/owncast:latest
ENV PORT=8080
EXPOSE 8080 1935
CMD ["./owncast", "--port", "8080"]

Notes:

  • Pin the image tag (e.g., owncast/owncast:0.1.3) for stability; update intentionally.
  • If you split RTMP, run a second app pointing to the same image and set its internal port to 1935 with TCP traffic.

Environment variables (Klutch.sh)

Set these in Klutch.sh before deploying:

  • PORT=8080
  • Optional: RTMP_PORT=1935 (if you configure a second app for RTMP)
  • Optional secrets for integrations (webhooks, chat) as needed

If you deploy without the Dockerfile and need Nixpacks overrides (not typical for Owncast):

  • NIXPACKS_START_CMD=./owncast --port 8080

Attach persistent volumes

In Klutch.sh storage settings, add mount paths and sizes (no names required):

  • /app/data — Owncast data, configuration, and assets.
  • /app/webroot/img — optional if you customize branding.
  • /var/log/owncast — optional logs if written to disk.

Ensure these paths are writable inside the container.


Deploy Owncast on Klutch.sh (Dockerfile workflow)

  1. Push your repository—with the Dockerfile at the root—to GitHub.
  2. Open klutch.sh/app, create a project, and add an app.
  3. Select HTTP traffic and set the internal port to 8080.
  4. Add the environment variables above.
  5. Attach persistent volumes for /app/data (and optional /app/webroot/img, /var/log/owncast) sized for your streams, assets, and logs.
  6. Deploy. Your Owncast web UI and API will be reachable at https://example-app.klutch.sh. If you need RTMP ingest, create a second app with TCP traffic and internal port 1935 pointing to the same repo/image.

Sample API usage

Get server status:

Terminal window
curl -X GET "https://example-app.klutch.sh/api/status"

List connected viewers (if enabled):

Terminal window
curl -X GET "https://example-app.klutch.sh/api/viewers"

Health checks and production tips

  • Add an HTTP probe to /api/status for readiness.
  • Enforce HTTPS at the edge; forward internally to port 8080.
  • Keep RTMP exposed only if needed; secure your streaming key and store it in Klutch.sh secrets.
  • Monitor disk usage on /app/data; resize before it fills.
  • Pin image versions and test upgrades in staging; back up data before updates.

Owncast on Klutch.sh combines reproducible Docker builds with managed secrets, persistent storage, and flexible HTTP/TCP routing. With the Dockerfile at the repo root, port 8080 configured, and data persisted, you can deliver self-hosted live streaming without extra YAML or workflow overhead.