Setup Owncast on Debian

In this guide i will explain how to install owncast on Debian. View this as a glued together version of the official docs, so that you have a script you can follow with some predefined defaults and some additional infos.

Requirements

There are a few things you need to have to follow this guide:

Installation

Dependencies

The only thing i was missing was ffmpeg. To install ffmpeg run:

apt-get install ffmpeg

Download Owncast

Owncast is not yet packaged for Debian, so we will use the binaries they provide. Go to the Owncast Github repository[1] and Download the latest version of Owncast for your Architecture. Unzip it and copy the Owncast binary into the following directory:

/usr/local/bin/

Create Owncast Data Directory

Create a directory for the data of Owncast in `/var/local`

mkdir /var/local/owncast

Create Owncast User

Owncast should be run by a seperate user. To create a new user without a home directory run:

useradd -M owncast

Create Systemd Unit File

You propably want owncast to be run permanently, even if you are not streaming and automatically started after reboots. For this first create a systemd unit file.

touch /etc/systemd/system/owncast.service

And then fill it with the following.

[Unit]
Description=Owncast Service
[Service]
Type=simple
WorkingDirectory=/var/local/owncast
ReadWritePaths=/var/local/owncast
ExecStart=/usr/local/bin/owncast
Restart=always
RestartSec=5
User=owncast
NoNewPrivileges=true
SecureBits=noroot
ProtectSystem=strict
ProtectHome=read-only
[Install]
WantedBy=multi-user.target

Set permissions on Directories

The Owncast user now needs to get permissions to access the just created data directory.

chown -R owncast /var/local/owncast

Start and enable Owncast

You now should be able to start and enable the owncast service via systemd.

systemctl enable owncast --now

Additions

Webserver

If you start the owncast service owncast will listen on port 8080. You propably want to put it behind a proxy to have it served at the default https port with a valid certificate.

For example if you use Caddy as your webserver/proxy, add the following to your Caddyfile:

<your owncast domain> {
        reverse_proxy localhost:8080
}

Firewall

Owncast has an RTMP endpoint it listens on. Thats where you will stream to. The port 1935 is the default one and needs to be open in your firewall. So for example if you use ufw run the following to open said port:

ufw allow 1935

Post Install

When you first access the admin interface, there are some things you want to do first. To get to the admin interface head over to https://<your owncast domain>/admin and log in with the user `admin` and the password `abc123`.

Change the Admin Password

Since the default password isn't the most secure, on the sidebard click on "Configuration" -> "Server Setup" and set a new admin password.

Change the Default Stream Key

The initial stream key is also `abc123`. To change it, in the admin panel, go to "Configuration" -> "Server Setup", then click on the "Stream Keys" tab. There add a new Stream key and delete the initial one.

---

[1] Owncast Github repository release

---

Back to the main page

This page is best viewed on gemini.