π₯ 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
-
Download Docker Desktop: https://www.docker.com/products/docker-desktop/
-
Install and run Docker Desktop.
β 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:
Linux
Download the binary from:
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:
β 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:
Windows
Download and install:
β 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!