How to set up an Owncast server for web delivery of live streamed video

elementor pointing

Live streaming video content has become an essential part of communication, entertainment, and business. Whether you’re a gamer, content creator, or business looking to stream events, owning your own streaming server gives you complete control over your content. One of the most powerful open-source tools for self-hosted streaming is Owncast. Owncast is a flexible, easy-to-use solution that allows you to broadcast live video content directly to the web without relying on third-party streaming platforms.

In this guide, we will walk you through the process of setting up an Owncast server for web delivery of live-streamed video.

Prerequisites

Before we begin, ensure you have the following:

  1. A server or machine: Owncast can run on Linux, macOS, and Docker. A basic VPS or cloud instance is ideal.
  2. Domain or static IP: A public domain (like example.com) or a static IP to host the server.
  3. A web browser and SSH client: To access your server and manage the installation.

Step 1: Install Docker

The easiest way to deploy Owncast is using Docker, which simplifies the process and isolates dependencies.

php closeupIf you don’t have Docker installed, follow the instructions for your operating system:

For Ubuntu Linux:

  1. Update the package list:
    sudo apt update
    
  2. Install dependencies:
    sudo apt install apt-transport-https ca-certificates curl software-properties-common
    
  3. Add Docker’s official GPG key:
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    
  4. Add Docker’s stable repository:
    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    
  5. Install Docker:
    sudo apt update
    sudo apt install docker-ce
    
  6. Verify the installation:
    sudo docker --version
    

Step 2: Install Owncast

Now that Docker is installed, we can proceed with the Owncast installation.

  1. Download and configure the Owncast Docker container:

    You’ll need to pull the Owncast image from Docker Hub. Run this command:

    sudo docker pull owncast/owncast
    
  2. Set up your configuration files:
    • Create a directory to store your configuration and media files:
      mkdir -p ~/owncast/config ~/owncast/videos
      
    • The config directory will hold your custom configuration, and the videos directory will store recorded streams and other media files.
  3. Run the Owncast container:

    To launch Owncast, run the following Docker command:

    sudo docker run -d -p 8080:8080 -v ~/owncast/config:/config -v ~/owncast/videos:/opt/owncast/videos owncast/owncast
    

    This command runs Owncast on port 8080. If you want to use a different port, change the 8080:8080 part.

Step 3: Configure Domain and SSL (Optional but Recommended)

Setting Up a Domain

To make the server publicly accessible, you need to point a domain name to the IP address of your server. This can be done by setting up DNS records at your domain registrar to direct traffic to your server’s public IP.

Configuring SSL (HTTPS)

For security reasons, it’s recommended to use HTTPS when streaming content. Here’s how to set up SSL using Let’s Encrypt:

  1. Install Certbot:
    sudo apt install certbot python3-certbot-nginx
    
  2. Request a certificate for your domain:
    sudo certbot certonly --standalone -d yourdomain.com
    
  3. Set up NGINX to proxy traffic to Owncast over HTTPS:
    • Create an NGINX configuration file for Owncast under /etc/nginx/sites-available/owncast.
    • Use this configuration as an example:
      server {
        listen 80;
        server_name yourdomain.com;
        return 301 https://$host$request_uri;
      }
      
      server {
        listen 443 ssl;
        server_name yourdomain.com;
      
        ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
      
        location / {
          proxy_pass http://localhost:8080;
          proxy_set_header Host $host;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header X-Forwarded-Proto $scheme;
        }
      }
      
  4. Enable the site:
    sudo ln -s /etc/nginx/sites-available/owncast /etc/nginx/sites-enabled/
    
  5. Restart NGINX:
    sudo systemctl restart nginx
    

Your stream should now be securely accessible through https://yourdomain.com.

Step 4: Start Streaming

  1. Access the Admin Panel: Open your browser and navigate to http://yourserverip:8080 or https://yourdomain.com if using SSL. You will see the Owncast web interface.
  2. Log in: Use the default username and password (admin/password) to log in. You should change these credentials immediately for security.
  3. Start Streaming: From the admin panel, you can configure streaming settings, add stream metadata, and connect your streaming software (like OBS) to Owncast.
  4. Test Your Stream: Once OBS is connected to your Owncast server, start streaming and check your stream’s URL (http://yourserverip:8080 or https://yourdomain.com) to ensure everything is working correctly.

Step 5: Customize and Maintain

Owncast has a powerful admin panel where you can:

  • Set up stream titles and descriptions.
  • Manage users and chat.
  • Monitor server statistics and stream health.

You can also integrate Owncast with social media, customize its appearance, and adjust performance settings from the configuration files.


Frequently Asked Questions (FAQ)

Q1: What do I need to stream on Owncast?

  • You need a server (or VPS) with Docker installed, a domain or static IP address, and a streaming software (like OBS) to send video to Owncast.

Q2: Can I use Owncast with YouTube or Twitch?

  • No, Owncast is a self-hosted solution. It operates independently of platforms like YouTube or Twitch, allowing you to stream directly to your audience without intermediaries.

Q3: How do I record streams in Owncast?

  • Streams are recorded automatically in the /opt/owncast/videos folder. You can access and download recordings from the web interface.

Q4: Is Owncast free to use?

  • Yes, Owncast is open-source and free to use. You only need to cover server hosting and domain costs.

Q5: Can I stream in 1080p or higher with Owncast?

  • Yes, Owncast can handle high-resolution streams depending on the server’s bandwidth and resources. Ensure your server can handle the video bitrate for the desired resolution.

Q6: How can I protect my stream from unauthorized viewers?

  • You can set up password protection for the stream or use token-based authentication to restrict access. This can be configured in the admin settings.

Q7: What if my server has performance issues during a stream?

  • Ensure your server has enough resources (CPU, RAM, bandwidth) to handle the stream. You can also limit the stream’s bitrate in the Owncast settings to reduce server load.

With these steps, you now have a fully functioning Owncast server to stream your video content live to the web! Enjoy the flexibility and control of self-hosted streaming.