A Dockerized installer for Owncast, designed for ZuidWest TV and Rucphen RTV. This project serves as a replacement for nginx-rtmp-live.
- Working Directory:
/opt/owncast/
- Environment Configuration:
- The
.env
file is located in the/opt/owncast/
directory and contains all the necessary environment variables:STREAM_KEY
(RTMP key for Owncast)ADMIN_PASSWORD
(Password for the Owncast admin interface)SSL_HOSTNAME
(The server’s hostname (without includinghttp://
orhttps://
))ADMIN_IPS
(One or more IP addresses that should be permitted to access the admin interface, separated by spaces)
- The
- Owncast Data: Stored in the Docker volume
owncast_data
. - Caddy Data: Stored in the Docker volume
owncast_caddy_data
. - Service Setup:
- Owncast and Caddy run as Docker containers.
- Caddy: Acts as a secure reverse proxy with automatic SSL certificates managed by Let's Encrypt.
- Owncast: Handles RTMP streaming and broadcasting.
This setup separates application logic (Docker containers) from persistent data (Docker volumes), ensuring easier upgrades and maintenance.
Choose your preferred method below ⬇️
- Ensure your DNS settings are correctly configured for your domain.
- Set up a fresh Debian or Ubuntu server with Docker and Docker Compose installed.
- Run the following command as
root
:/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/oszuidwest/zwtv-owncast/main/install.sh)"
- The installer will set everything up for you automatically.
- As the last step it'll ask you if you want to start the services. If you choose to do so, it'll also ask you if you want to run the postinstall script.
Download the docker-compose.yml
, .env.example
and Caddyfile
files from the repository and configure them as needed.
The postinstall.sh
script configures Owncast with custom settings, such as stream output variants. The install script asks you if you want to run this script. If you choose not to do so, and want to do it manually later, you can do so with the command below. It sets these settings:
- 4 stream output variants (360p, 480p, 720p 1080p).
- Disable browser notifications.
- Hide viewer counts.
- Disable search indexing.
- Disable chat.
- Remove social handles and tags.
Run this command to apply the settings:
docker run --rm \
--volume /opt/owncast/.env:/.env \
--network owncast_backend \
-e BASE_URL=http://owncast:8080 \
alpine sh -c "apk add --no-cache bash curl && bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/oszuidwest/zwtv-owncast/main/postinstall.sh)\""
If you've changed the network or container name, update the command
Video transcoding is an intensive process. To ensure the maximal stability, tune the CPU for maximal performance. This only works on machines with physical cpus, not virtualized machines or containers. Do the following:
- Install cpupower with
apt install linux-tools-generic
- Tune the CPU for performance
cpupower frequency-set -g performance
To ensure it remains tuned for maximal performance after reboots, add a service file:
cat << EOF | sudo tee /etc/systemd/system/cpupower.service
[Unit]
Description=CPU tuning
[Service]
Type=oneshot
ExecStart=/usr/bin/cpupower frequency-set -g performance
[Install]
WantedBy=multi-user.target
EOF