You can use Docker to run an NGINX RTMP relay that accepts a live feed from an encoder and forwards it to YouTube Live. The relay does not create the video or guarantee a 24/7 broadcast: your source, host, network connection, and recovery plan must all keep working. This guide covers the relay setup, YouTube settings, validation, and the operational work behind a continuous stream.
How the relay works
The setup has three parts: a source that continuously produces video and audio, an NGINX server with the third-party RTMP module, and YouTube’s ingest endpoint. Your encoder publishes to the relay; the relay pushes that feed to YouTube using the server URL and stream key shown in YouTube Live Control Room.
NGINX Open Source does not include this RTMP functionality by default. The arut/nginx-rtmp-module project provides RTMP support and documents stream relay with a push target. NGINX documents compiling Open Source with a third-party module using --add-module=<PATH>; its separate RTMP package for NGINX Plus is not a free Open Source package. See NGINX’s configure documentation and NGINX Plus RTMP module page.
Choose a Docker image or build your own
Community image for a smoke test
The tiangolo/nginx-rtmp repository documents this basic container command:
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
docker run -d -p 1935:1935 --name nginx-rtmp tiangolo/nginx-rtmp
This exposes RTMP on port 1935. The repository demonstrates publishing from OBS to the container and playing the local stream in VLC, making it useful as a basic relay test. It is a community image, not an official NGINX image. Before relying on it for a long-running service, review whether it is maintained and whether its base image and bundled module match your requirements.
Build NGINX with the RTMP module
Building gives you more control over NGINX, module, and base-image versions, but you are responsible for maintaining a compatible build. NGINX’s documented third-party module build option is --add-module=<PATH>. Pin the versions you select and rebuild when you need security updates; the available sources do not establish a universally suitable version combination.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Configure the RTMP application and destination
The module’s documented pattern is an RTMP application with live on; and a push target. Conceptually, an encoder publishes to rtmp://relay-host/live/stream-name, and the module relays that stream to the configured YouTube destination. The exact configuration depends on the image or build you chose, so use its configuration path and syntax rather than assuming every image uses the same file.
- Get the destination from YouTube. In YouTube Live Control Room, copy the server URL and stream key for the broadcast. Use the exact ingest endpoint supplied for that stream; do not hard-code an assumed regional endpoint. YouTube explains the server URL and key workflow in its live encoder setup guidance.
- Configure the relay. Add an RTMP application using the module’s
live on;andpushpattern. Set the push destination to the supplied ingest URL with the stream key in the destination path, as required by the endpoint. - Keep the key secret. Do not commit a key in a public repository, share it in a public configuration example, or expose it in logs. Use a secret-aware deployment method appropriate to your container host and restrict access to the configuration and logs.
- Publish to the relay. Set your encoder’s server to the relay address and its stream name/key to the path expected by your RTMP application. The source must stay active and continue sending video and audio.
YouTube recommends RTMPS: “We recommend streaming to YouTube Live with RTMPS, a secure extension to the popular RTMP streaming video protocol.” A plain RTMP push configuration is not encrypted merely because YouTube supports RTMPS. Confirm that your selected relay and destination configuration actually negotiate TLS before treating the outbound connection as secure. YouTube’s live encoder settings guidance covers its protocol recommendations.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Set encoder quality for YouTube
Choose settings for the resolution, frame rate, and codec you intend to send. YouTube’s bitrate guidance varies across those choices, so there is no single bitrate that suits every stream. Check the current table in YouTube’s encoder settings guidance and use the row that matches your output.
- Codec: YouTube’s current guidance includes H.264, H.265/HEVC, and AV1 among its options. Confirm that your chosen encoder and relay support the intended format end to end.
- Rate control: YouTube recommends constant bitrate (CBR).
- Frame rate: YouTube supports frame rates up to 60 fps; choose a rate appropriate to the source and output.
- Keyframes: YouTube recommends a two-second interval and says it should not exceed four seconds.
- Audio: YouTube’s advanced settings recommend stereo AAC at 128 Kbps and 44.1 kHz.
Test with representative motion and audio, then monitor YouTube’s stream health messages. A static test image may not reveal problems that appear with fast motion, detailed scenes, or the actual audio mix.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Test the relay before depending on it
- Check local ingest first. Start the container and publish from OBS or another RTMP source to the relay. The Docker example’s OBS-to-container and VLC playback flow is a useful local smoke test. Confirm that the relay receives and plays a stable feed before adding YouTube to the path.
- Check the outbound connection. Configure the YouTube destination and start the relay. Look at container and application logs for connection failures, while ensuring that logs do not reveal the stream key.
- Check YouTube’s preview and health. Open Live Control Room and verify that the preview appears and that stream-health messages do not indicate a problem. Do not treat a successful local VLC playback as proof that YouTube is receiving the stream.
- Test recovery deliberately. In a controlled test, interrupt the source or relay connection and observe what happens. Confirm which component reconnects and whether a person must restart anything; the module and image documentation does not establish a universal automatic recovery policy.
What continuous operation requires
An RTMP relay is only one link in a continuous broadcast. The source must keep generating content; the Docker host and container must remain available; the network path to YouTube must work; and the encoder or relay must recover appropriately after interruptions. The module documents mechanisms such as static pulls and external program execution on events, but these are building blocks—not an uptime guarantee.
- Keep the source running: Decide how the video and audio are generated continuously and what should happen when the source ends or fails.
- Plan for container and host failures: Choose a restart and recovery approach, monitor the host and container, and arrange alerts for failures that need attention.
- Protect connectivity: Monitor the host’s network path and available upload capacity; a working local relay cannot compensate for a failed upstream connection.
- Maintain the deployment: Pin the image or build components, review maintenance and compatibility, and update them deliberately.
- Account for YouTube archives: YouTube Help says streams under 12 hours are automatically archived. Do not assume that one archive will cover a broadcast running beyond that threshold; consult YouTube’s live stream archiving guidance.
Copyright and reused-content checks
A technically healthy relay does not establish that you have the rights to broadcast its content or that a channel complies with YouTube policies. Before scheduling a continuous stream, confirm that you have permission for the video, music, and other material, and review YouTube’s applicable rules for live content and monetization. For a practical preflight, use the copyright safety checklist; it does not replace YouTube’s policies or legal advice.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Troubleshoot common failures
| Symptom | Likely area to check | What to do |
|---|---|---|
| Encoder cannot connect to the relay | Container availability, port exposure, host firewall, relay address, or application path | Confirm the container is running, port 1935 is reachable where intended, and the encoder is publishing to the correct relay and application path. |
| Local playback works, but YouTube has no preview | Outbound push URL, stream key, or connection protocol | Copy the current server URL and key from Live Control Room, check the destination path and logs, and verify TLS if configuring RTMPS. |
| Video arrives but stream health reports problems | Encoder settings or source quality | Match bitrate to YouTube’s current table for the selected resolution, frame rate, and codec; check CBR, keyframe interval, and representative audio and motion. |
| Stream stops after a source or network interruption | Recovery behavior in the source, container, relay, or host | Identify which component failed, test its restart or reconnect behavior, and add monitoring and alerts. Do not assume the RTMP module itself guarantees recovery. |
| Key appears in logs or configuration history | Credential handling | Restrict access, remove the exposed secret from public locations, and rotate the YouTube stream key in Live Control Room before resuming. |
Or let it run in the cloud
If the goal is a continuous YouTube stream from uploaded video rather than operating a relay host, StreamNeo is a managed alternative: upload a recording or build a playlist, add your YouTube stream key once, and go live. It loops uploaded videos in the cloud, so nothing has to stay on at home. Every slot streams the upload as made, up to 4K 60fps, at one flat price per slot; it also automatically recovers if YouTube drops the stream. The first day is free with no card, one free day per account. Monthly billing is $9.99 per month. StreamNeo is for YouTube streams from uploaded videos, not camera broadcasts. Start your free day with StreamNeo.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




