Install an Owncast Streaming Server

This tutorial will demonstrate how to set up an Owncast server for web delivery of live streamed video. This tutorial will use a Debian 12 server. Watch the video version here.

Prerequisites: You will need a server running Debian 12 (visit linode.nots.co, digitalocean.nots.co, or vultr.nots.co if you don't have one). You will also need a domain name to register an SSL/TLS certificate with Let's Encrypt (visit hover.nots.co if you don't have one).

Example parameters: In this example, the server URL used for Vaultwarden/Bitwarden will be example.nerdonthestreet.com.


Step 1: Make sure your server is entirely up-to-date, then install the prerequisite packages:

apt update
apt full-upgrade
apt install unzip ffmpeg apache2 certbot python3-certbot-apache

Step 2: Make and enter a directory to install Owncast in:

mkdir /opt/owncast
cd /opt/owncast

Step 3: Download and unzip the `-linux-64bit.zip` file for the latest release of Owncast:

wget https://github.com/owncast/owncast/releases/download/v0.1.2/owncast-0.1.2-linux-64bit.zip
unzip owncast-0.1.2-linux-64bit.zip
rm owncast*.zip

Step 4: Create a Systemd unit file for Owncast:

nano /etc/systemd/system/owncast.service

Insert the following configuration:

[Unit]
Description=Owncast Streaming Server

[Service]
Type=simple
WorkingDirectory=/opt/owncast/
ExecStart=/opt/owncast/owncast
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

Step 5: Reload systemd to detect the new service, then enable and start the service:

systemctl daemon-reload
systemctl enable --now owncast

Step 6 (optional): Visit your.ip.address.here:8080/admin, log in with the username "admin" and the password "abc123", navigate to Configuration -> Server Setup, and set the "Owncast port" option to your desired internal port.

  • Do not change the admin password yet, unless you're running on the same trusted network as the server.

Step 7: Create an Apache virtual host for Owncast:

nano /etc/apache2/sites-available/owncast.conf

Insert the following configuration:

<VirtualHost *:80>
ServerName example.nerdonthestreet.com
ServerAdmin jacob@nerdonthestreet.com

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Step 8: Enable the virtual host, reload Apache to apply the new configuration, and run Certbot to get a TLS certificate:

a2ensite owncast
systemctl reload apache2
certbot --apache

Step 9: Edit the new Owncast TLS virtual host:

nano /etc/apache2/sites-available/owncast-le-ssl.conf

Insert the following additional configuration:

# Proxy traffic to/from Owncast.
ProxyRequests Off
ProxyPreserveHost On
AllowEncodedSlashes NoDecode

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/

RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Port "443"

# Ensure websocket connections are also proxied.
RewriteEngine On
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC,OR]
RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
RewriteRule .* ws://127.0.0.1:8080%{REQUEST_URI} [P,QSA,L]

Step 10: Enable the necessary Apache modules, then restart Apache to load them and apply the new configuration:

a2enmod proxy_http proxy_wstunnel headers
systemctl restart apache2

Step 11: Visit example.nerdonthestreet.com/admin, log in with the username "admin" and the password "abc123", navigate to Configuration -> Server Setup, and change the "Admin Password" option to your desired admin password.

  • You'll need to refresh the webpage and log in again after changing your password.

Step 12: Configure Owncast as desired and start streaming!


Embedding Video and Chat

To embed your Owncast server's video into another webpage, use the following iframe (substituting your own domain name for "example.nerdonthestreet.com"):

<style>.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style><div class='embed-container'><iframe src='https://example.nerdonthestreet.com/embed/video' title='Owncast' referrerpolicy='origin' allowfullscreen></iframe></div>

To embed your Owncast server's chat, create another iframe with the "src" value set to "https://example.nerdonthestreet.com/embed/chat/readwrite/" (substituting your own domain name for "example.nerdonthestreet.com").

For more information about customizing Owncast, see the official documentation.


There are no pages beneath this page

Expand: Discussion Discussion (0 posts)