How to Restream to Twitch, YouTube & Facebook from a VPS

Running a restreaming server VPS lets you send one stream from your encoder to multiple platforms simultaneously — Twitch, YouTube, Facebook Live, and anywhere else — without relying on third-party restreaming services that throttle quality, add latency, or charge per-platform fees. This guide shows you how to set up multistreaming on your own VPS using NGINX RTMP, with a fallback option for Wowza and Ant Media.

Why Use a VPS for Restreaming Instead of a Service?

Services like Restream.io and Castr are convenient but have real limitations:

  • Quality caps: Many plans limit bitrate to 6–8 Mbps. Your VPS has no such cap.
  • Latency: Your stream routes through their servers before hitting the platforms — adding 2–5 seconds.
  • Cost at scale: Per-platform or per-viewer fees add up fast for high-volume streamers.
  • No control over routing: You can’t choose which data center handles your stream.

A VPS-based restreaming setup uses your server as the RTMP hub. Your encoder pushes once; the server fans the stream out to every destination. You control bitrate, routing, and which platforms are live.

What You Need

  • A VPS with at least 2 vCPUs, 2 GB RAM, and a 1 Gbps port
  • Ubuntu 20.04 or 22.04
  • NGINX with the RTMP module compiled in (or a pre-installed setup)
  • RTMP stream keys from each platform (Twitch, YouTube, Facebook)

Upstream bandwidth is the key constraint. Pushing a 6 Mbps stream to three platforms simultaneously requires ~18 Mbps sustained upload. Most VPS providers give you far more than that on a 1 Gbps port — but confirm the bandwidth cap on your plan before you start.

Setting Up NGINX RTMP for Restreaming

1. Install NGINX with RTMP Module

sudo apt update
sudo apt install -y build-essential libpcre3 libpcre3-dev zlib1g zlib1g-dev libssl-dev
cd /tmp
wget http://nginx.org/download/nginx-1.25.3.tar.gz
wget https://github.com/arut/nginx-rtmp-module/archive/master.tar.gz
tar -xzf nginx-1.25.3.tar.gz
tar -xzf master.tar.gz
cd nginx-1.25.3
./configure --with-http_ssl_module --add-module=../nginx-rtmp-module-master
make && sudo make install

2. Configure NGINX for Multi-Platform Push

Edit /usr/local/nginx/conf/nginx.conf and add the RTMP block:

rtmp {
    server {
        listen 1935;
        chunk_size 4096;

        application live {
            live on;
            record off;

            # Push to Twitch
            push rtmp://live.twitch.tv/app/YOUR_TWITCH_STREAM_KEY;

            # Push to YouTube
            push rtmp://a.rtmp.youtube.com/live2/YOUR_YOUTUBE_STREAM_KEY;

            # Push to Facebook
            push rtmps://live-api-s.facebook.com:443/rtmp/YOUR_FACEBOOK_STREAM_KEY;
        }
    }
}

Replace each YOUR_*_STREAM_KEY with the actual key from each platform’s live settings page.

3. Start NGINX

sudo /usr/local/nginx/sbin/nginx
# Verify it's running:
sudo /usr/local/nginx/sbin/nginx -t

Open port 1935 on your firewall:

sudo ufw allow 1935/tcp
sudo ufw reload

4. Configure Your Encoder (OBS)

In OBS → Settings → Stream:

  • Service: Custom
  • Server: rtmp://YOUR_VPS_IP/live
  • Stream Key: any key (e.g., stream1)

Hit “Start Streaming” and your VPS will receive the feed and immediately re-push it to all three platforms.

Handling Facebook’s RTMPS Requirement

Facebook requires RTMPS (RTMP over TLS) — plain RTMP won’t work. Standard NGINX RTMP doesn’t support RTMPS outbound natively. You have two options:

Option A — Use stunnel as a proxy: Install stunnel and tunnel the RTMP push through TLS to Facebook’s endpoint.

sudo apt install stunnel4

Create /etc/stunnel/stunnel.conf:

[facebook-rtmp]
client = yes
accept = 127.0.0.1:19350
connect = live-api-s.facebook.com:443

Then change the Facebook push line in nginx.conf to:

push rtmp://127.0.0.1:19350/rtmp/YOUR_FACEBOOK_STREAM_KEY;

Option B — Use a streaming engine that handles RTMPS natively: Wowza Streaming Engine and Ant Media Server both support outbound RTMPS without workarounds. If Facebook is a primary target, this may be worth the overhead.

Adding More Platforms

The NGINX config scales linearly — add one push line per destination:

# Kick
push rtmp://ingest.global-contribute.live-video.net/app/YOUR_KICK_KEY;

# LinkedIn Live
push rtmp://YOUR_LINKEDIN_RTMP_ENDPOINT/YOUR_LINKEDIN_KEY;

# Custom RTMP endpoint
push rtmp://ingest.yourcdn.com/live/YOUR_KEY;

Each push is an independent outbound connection. Your VPS uses separate upload bandwidth for each. Watch your CPU if you’re also transcoding — pure relay (same bitrate out as in) is very low CPU, but transcoding each output to a different bitrate multiplies the load significantly.

Monitoring Your Restream

NGINX RTMP has a built-in stats page. Add this to the http block in nginx.conf:

server {
    listen 8080;
    location /stat {
        rtmp_stat all;
        rtmp_stat_stylesheet stat.xsl;
    }
    location /stat.xsl {
        root /usr/local/nginx/html;
    }
}

Visit http://YOUR_VPS_IP:8080/stat to see active connections, bandwidth, and stream health in real time. If a push to one platform drops, it shows up here immediately.

Pre-Installed Restreaming VPS — Skip the Setup

The NGINX RTMP setup above is manageable if you’re comfortable compiling from source and editing config files. But if you want a restreaming server that’s ready the moment your VPS spins up, StreamingVPS.com provides VPS instances with NGINX RTMP (and other engines) pre-installed and pre-configured.

You get RTMP ingest live in 60 seconds. Add your push destinations to the config, point OBS at the server, and you’re live on every platform simultaneously. See current plans and pricing for bandwidth and resource specs.

Conclusion

A restreaming server VPS gives you full control over multistream quality, latency, and cost — with no third-party limits on bitrate or platforms. The NGINX RTMP setup covered here handles the core use case well: one ingest, multiple push destinations, with the stunnel workaround covering Facebook’s RTMPS requirement.

For more complex setups — adaptive bitrate per platform, stream recording, or WebRTC delivery — Wowza or Ant Media on the same VPS handle all of it without additional workarounds.

Get a pre-installed restreaming VPS from StreamingVPS.com — go live in 60 seconds.

Leave a Reply

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