Skip to content

πŸŽ₯ Streaming Server with Docker β€” Complete Guide (macOS, Linux, Windows)

This document shows how to:

βœ… Run a live streaming server locally
βœ… Connect OBS Studio for live video
βœ… Share your stream publicly via ngrok
βœ… Host your stream on your own domain using Cloudflare Tunnel

We’ll use Owncast, an open-source, self-hosted streaming platform that runs entirely in Docker.


πŸš€ 1. Run Streaming Server Locally

βœ… 1.1 Install Docker


macOS

Install Homebrew if you don’t have it:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
````

Then install Docker:

```bash
brew install --cask docker

Start Docker Desktop after install.


Linux

Debian / Ubuntu:

sudo apt update
sudo apt install -y docker.io
sudo systemctl start docker
sudo systemctl enable docker

Add your user to the docker group:

sudo usermod -aG docker $USER

Then log out and log back in.


RHEL / CentOS:

sudo yum install -y docker
sudo systemctl enable docker
sudo systemctl start docker

Windows

βœ… Confirm Docker works:

docker --version

βœ… 1.2 Run Owncast

Run Owncast container:

docker run -d \
  -p 8080:8080 \
  -p 1935:1935 \
  owncast/owncast

βœ… Owncast will run locally:

  • Web page:

http://localhost:8080

  • RTMP ingest:

rtmp://localhost:1935/live


βœ… 1.3 Access Admin Panel

Visit:

http://localhost:8080/admin

Default credentials:

Username: admin
Password: abc123

Go to:

Server Setup β†’ Stream Settings

βœ… Copy:

  • RTMP URL:

rtmp://localhost:1935/live * Stream Key: e.g. abc123xyz


πŸŽ₯ 2. Install OBS Studio


βœ… macOS

Install via Homebrew:

brew install --cask obs

Or download: https://obsproject.com/


βœ… Linux

For Ubuntu:

sudo add-apt-repository ppa:obsproject/obs-studio
sudo apt update
sudo apt install obs-studio

βœ… Windows

Download and install: https://obsproject.com/


πŸŽ›οΈ 3. Configure OBS for Streaming


βœ… Step 1 β€” Stream Settings

In OBS:

  • Go to:

Settings β†’ Stream * Choose:

Service: Custom... Server: rtmp://localhost:1935/live Stream Key: <your stream key>

Replace with your actual stream key from Owncast.


βœ… Step 2 β€” Add Video Sources

In OBS:

βœ… Add Webcam

  • Click βž• under β€œSources.”
  • Choose:

Video Capture Device * Pick your webcam.


βœ… Share Your Screen

  • Click βž• under β€œSources.”

  • macOS:

    macOS Screen Capture * Windows:

    Display Capture * Linux:

    Screen Capture (XSHM) or PipeWire

  • Select your display or window.


βœ… Play a Video File

  • Click βž• under β€œSources.”
  • Choose:

Media Source * Pick a video file (e.g. mp4).


βœ… Step 3 β€” Start Streaming

  • Click:

Start Streaming


βœ… Step 4 β€” View Your Stream

Visit:

http://localhost:8080

βœ… You should see your live video!


🌎 4. Share Your Local Stream Publicly (ngrok)

Perfect for quick demos without cloud servers.


βœ… Step 1 β€” Install ngrok


macOS

brew install ngrok/ngrok/ngrok

Or download:

https://ngrok.com/download


Linux

Download the binary from:

https://ngrok.com/download

Unzip it and move it to /usr/local/bin.

Example:

unzip ngrok-v3-stable-linux-amd64.zip
sudo mv ngrok /usr/local/bin/

Windows

Download and install from:

https://ngrok.com/download


βœ… Step 2 β€” Authenticate ngrok

Sign up for a free account. Copy your auth token.

Run:

ngrok config add-authtoken YOUR_TOKEN_HERE

βœ… Step 3 β€” Run ngrok

Run:

ngrok http 8080

βœ… ngrok will give you a URL like:

https://funny-lion-1234.ngrok.io

βœ… Share this link β†’ your stream is globally accessible!


🚫 Limitations

  • ngrok shares only web page traffic (port 8080).
  • RTMP streaming from outside (port 1935) will not work through ngrok.
  • Perfect for demo viewing by others.

🌐 5. Host Streaming on Your Own Domain (Cloudflare Tunnel)

For a professional, permanent solution.


βœ… Step 1 β€” Prerequisites

βœ… You need:

  • A domain (e.g. yourdomain.com)
  • Cloudflare account managing that domain
  • Docker + cloudflared installed

βœ… Step 2 β€” Install cloudflared


macOS

brew install cloudflared

Linux

Debian/Ubuntu:

sudo apt install cloudflared

Or download binary:

https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/installation/


Windows

Download and install:

https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/installation/


βœ… Step 3 β€” Login to Cloudflare

Run:

cloudflared tunnel login

A browser window opens β†’ log in.


βœ… Step 4 β€” Create a Tunnel

Run:

cloudflared tunnel create owncast-tunnel

Example output:

Tunnel credentials written to /Users/koti/.cloudflared/324500d1-4ab0b-a4694083b668.json

βœ… Step 5 β€” Create Config File

Create:

/Users/koti/.cloudflared/config.yml

Example content:

tunnel: owncast-tunnel
credentials-file: /Users/koti/.cloudflared/324500d1-a4694083b668.json

ingress:
  - hostname: stream.yourdomain.com
    service: http://localhost:8080
  - service: http_status:404

βœ… Replace:

  • stream.yourdomain.com β†’ your subdomain
  • path to your credentials file

βœ… Step 6 β€” Route DNS

Run:

cloudflared tunnel route dns owncast-tunnel stream.yourdomain.com

βœ… This creates a DNS CNAME record:

stream.yourdomain.com β†’ <your-tunnel-id>.cfargotunnel.com

βœ… Step 7 β€” Run Tunnel

First run Owncast:

docker run -d -p 8080:8080 -p 1935:1935 owncast/owncast

Then start your tunnel:

cloudflared tunnel run owncast-tunnel

βœ… Your stream is live:

https://stream.yourdomain.com

⭐ Your One-Liner Workflow

Every time you want to go live publicly:

docker run -d -p 8080:8080 -p 1935:1935 owncast/owncast
cloudflared tunnel run owncast-tunnel

βœ… That’s it!


🎯 Summary

βœ… Local streaming server β†’ Owncast in Docker βœ… Stream live with OBS βœ… Share demos via ngrok βœ… Host live streams on your own domain via Cloudflare Tunnel

Enjoy building your streaming empire!