How to Install Owncast on Ubuntu 24.04

How to Install Owncast on Ubuntu 24.04

Below is a step‐by‐step guide to install Owncast on Ubuntu 24.04. You can choose either the manual installation method (using the official installer script) or the Snap package method. Both methods are effective; pick the one that best suits your needs.


Prerequisites

  1. Update Your System:
    Open a terminal and run:

    sudo apt update && sudo apt upgrade -y
    
  2. Install Required Tools:
    Ensure you have curl installed:

    sudo apt install curl -y
    
  3. Optional – Firewall Setup:
    If you use UFW, you’ll need to allow ports:

    sudo ufw allow 8080/tcp   # For the web interface
    sudo ufw allow 1935/tcp   # For RTMP streaming
    

Method 1: Manual Installation Using the Official Installer

  1. Download and Run the Installer Script:
    This script downloads the latest Owncast release (including FFmpeg if needed) and sets up a new owncast directory.

    curl -s https://owncast.online/install.sh | bash
    

    This command will:

    • Create an owncast folder.
    • Download the latest Owncast release from GitHub.

  2. Start Owncast:
    Change into the newly created directory and run Owncast:

    cd owncast
    ./owncast
    

    You should see log messages indicating that:

    • The RTMP server is listening on port 1935.
    • The web server (and admin interface) is running on port 8080.
  3. Access the Admin Interface:
    Open your web browser and navigate to:

    http://[your-server-ip]:8080/admin
    

    Use the default credentials:

    • Username: admin
    • Password: abc123
      (Be sure to change the default password immediately.)

  4. (Optional) Configure Owncast as a Systemd Service:
    To ensure Owncast starts on reboot:

    • Move the Owncast Directory:
      sudo mv ~/owncast /usr/share/owncast
      
    • Create a Service File:
      Open /etc/systemd/system/owncast.service in your text editor:

      sudo nano /etc/systemd/system/owncast.service
      

      Paste in the following configuration:

      [Unit]
      Description=Owncast Streaming Server
      After=network.target
      
      [Service]
      Type=simple
      WorkingDirectory=/usr/share/owncast
      ExecStart=/usr/share/owncast/owncast
      Restart=on-failure
      RestartSec=5
      
      [Install]
      WantedBy=multi-user.target
      
    • Reload and Enable the Service:
      sudo systemctl daemon-reload
      sudo systemctl enable owncast
      sudo systemctl start owncast
      
    • Verify Status:
      sudo systemctl status owncast
      

Method 2: Installing Owncast via Snap

  1. Ensure Snap Is Enabled:
    On Ubuntu 24.04, snapd is pre-installed. If not, install it:

    sudo apt update
    sudo apt install snapd -y
    
  2. Install Owncast Snap:
    Run the following command to install Owncast from the Snap Store:

    sudo snap install owncast --beta
    

    This command installs the beta version of Owncast packaged with all its dependencies.

  3. Running Owncast:
    Once installed, you can start Owncast by simply typing:

    owncast
    

    Your server will then be available on port 8080 (for the web interface) and port 1935 (for RTMP streaming).


Next Steps: Configuring and Connecting Your Stream

  1. Log into the Admin Interface:
    Visit http://[your-server-ip]:8080/admin and log in using:

    • Username: admin
    • Password: abc123
      Change your password immediately after logging in.
  2. Configure Stream Settings:

    • Set a custom stream key.
    • Adjust video resolution, bitrate, and other metadata.
    • Customize the appearance and integrated chat settings.
  3. Connect Your Streaming Software (e.g., OBS):
    In OBS, configure your stream:

    • Stream URL: rtmp://[your-server-ip]/live
    • Stream Key: The one you configured in Owncast.
  4. Start Streaming:
    Click “Start Streaming” in OBS. Your stream should now be live and viewable via your Owncast server.


By following these steps, you’ll have a fully functional Owncast installation on Ubuntu 24.04, ready for live streaming and interactive audience engagement.

For additional details or advanced configuration, refer to the official Owncast documentation.

 

Writing System Service for Owncast

Here’s a systemd service file for running Owncast on your server:

[Unit]
Description=Owncast Live Streaming Service
After=network.target

[Service]
User=owncast
Group=owncast
WorkingDirectory=/opt/owncast/owncast
ExecStart=/opt/owncast/owncast/owncast
Restart=always
RestartSec=5
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=owncast
LimitNOFILE=1048576

[Install]
WantedBy=multi-user.target

Instructions to Enable and Start the Service

  1. Save the file as:
    /etc/systemd/system/owncast.service
    
  2. Reload systemd to recognize the new service:
    sudo systemctl daemon-reload
    
  3. Enable Owncast to start on boot:
    sudo systemctl enable owncast
    
  4. Start the Owncast service:
    sudo systemctl start owncast
    
  5. Check the status:
    sudo systemctl status owncast
    

This setup ensures Owncast runs automatically and restarts if it crashes.

Administrator

Administrator

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *