Skip to main content

Run Owncast as a Background Service

You can run Owncast under systemd so it starts automatically when your machine boots and restarts on its own if it crashes. This page is for Linux servers running systemd. If you run Owncast in a container, use Docker's restart: unless-stopped policy instead (see Run Owncast in a container). On macOS the equivalent is a launchd agent.

Create the service file

Create a file at /etc/systemd/system/owncast.service with the following. Change WorkingDirectory, ExecStart, User, and Group to match where Owncast is installed and the account it should run as.

[Unit]
Description=Owncast
After=network.target

[Service]
Type=simple
WorkingDirectory=/opt/owncast
ExecStart=/opt/owncast/owncast
User=owncast
Group=owncast
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

WorkingDirectory is the folder that holds the owncast binary and its data/ directory. ExecStart is the full path to the binary. Do not run Owncast as root. Create a dedicated user (for example sudo useradd --system --home-dir /opt/owncast owncast) and point User/Group at it.

Enable and start it

Reload systemd so it picks up the new file, then enable and start the service in one step:

sudo systemctl daemon-reload
sudo systemctl enable --now owncast

enable --now both starts Owncast immediately and sets it to start on every boot.

Confirm it's running

systemctl status owncast

You should see active (running). To follow the logs live:

journalctl -u owncast -f

Once it's running, load your server in a browser on port 8080 to confirm it's serving.

Hardening (optional)

The project ships a sample service file that adds systemd sandboxing options:

ReadWritePaths=/opt/owncast
NoNewPrivileges=true
SecureBits=noroot
ProtectSystem=strict
ProtectHome=read-only

ProtectSystem=strict makes most of the filesystem read-only, so ReadWritePaths must point at your Owncast directory or the server cannot write its data/. Add these to the [Service] section if you want them.

Owncat suggests

The contrib directory holds more user-supplied examples (including notes for Windows). Those files are community-contributed and not officially supported, but they are a good starting point for setups this page doesn't cover.


Improve this page

See something missing or incorrect? Edit this page and improve the documentation for everyone.

Contributors to this documentation

Related Documents