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 is not itself a video source: to keep a channel live continuously, your source must keep producing video and audio, while the container host, network connection, and relay path remain available. This guide covers the relay setup, YouTube configuration, testing, and the extra work required for 24/7 operation.
How the relay works
The flow has three parts: an encoder or other publishing source sends RTMP to your Docker host; the NGINX RTMP module accepts that feed; and an NGINX push directive forwards it to the ingest URL and stream key supplied by YouTube. The module is third-party functionality: NGINX Open Source does not include RTMP support by default. NGINX documents building Open Source with a third-party module using --add-module=<PATH>; its separate RTMP installation page refers to a package for NGINX Plus, not a free Open Source module. NGINX configure options · NGINX Plus RTMP module documentation
The arut/nginx-rtmp-module project documents RTMP applications and stream relay. Its basic pattern is an application with live on; and one or more push targets. A publisher connects to an address such as rtmp://relay-host/live/stream-name; the relay then sends the incoming stream onward. Treat that address as a conceptual pattern, not a complete configuration: the module, image, protocol support, and YouTube endpoint all need to match.
Choose an image or build your own
Community Docker image for a smoke test
A community Docker example starts its image with:
docker run -d -p 1935:1935 --name nginx-rtmp tiangolo/nginx-rtmp
This publishes container port 1935 on the host and runs the container in the background. The image repository demonstrates publishing from OBS to the container and opening the local stream in VLC, a useful first check that the container accepts a feed. It is a community image, not an official NGINX image; review its maintenance status, base image, module compatibility, and configuration before relying on it for a long-running deployment. The command is an example, not a universal production recipe. tiangolo/nginx-rtmp Docker example
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →#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.
Build and pin your own image
Building your own gives you greater control over the NGINX version, module revision, configuration, and update schedule. It also makes compatibility and maintenance your responsibility. For an always-on service, pin the image and module versions you have selected, document how you update them, and test changes before deploying them. NGINX’s build documentation describes adding a third-party module, but the sources here do not establish a particular Dockerfile, image tag, or version combination as the recommended choice.
Configure the relay and protect the stream key
The module’s documented relay pattern is an RTMP application that accepts a live stream and pushes it to a destination. Adapt this shape to the syntax and configuration locations of the image you selected:
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.
rtmp {
server {
listen 1935;
application live {
live on;
push rtmp://<youtube-ingest-host>/<stream-key>;
}
}
}
This is an illustrative pattern, not a copy-and-run production configuration. Replace the destination with the exact server URL and key YouTube shows for your stream, and confirm that your selected relay supports the destination protocol you intend to use. Do not put a real key in a public repository, a public example, or logs. Use a secret-aware deployment mechanism and restrict access to configuration and deployment output that could expose it. If a key is exposed, replace or reset it in YouTube Live Control Room.
YouTube tells creators to copy the server URL and stream key from Live Control Room into the encoder. Use the endpoint shown for the stream rather than assuming a fixed regional address. YouTube recommends RTMPS, the encrypted extension to RTMP. A plain push rtmp://... target is not encrypted just because YouTube supports RTMPS; establish that the chosen client can connect with TLS and that the configured destination actually negotiates it. The cited module documentation establishes a push pattern, not that every image or module build supports secure outbound RTMPS. YouTube Live encoder setup · YouTube Live streaming guidance
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.
Connect the source and YouTube
- Prepare the container host. Install Docker on a host that can remain available for the intended schedule. Open the necessary inbound RTMP port only to the publishing source or networks that need access; avoid exposing an unauthenticated ingest endpoint more broadly than necessary.
- Start the relay. Run your selected image or build, configure the RTMP application and outbound push target, and check the container logs for startup or configuration errors. Keep credentials out of logs and shell history where possible.
- Set the YouTube destination. In YouTube Live Control Room, copy the server URL and stream key for the stream you are configuring. Add the exact destination to the relay’s outbound configuration using secret-aware handling. Do not rely on a URL copied from an unrelated tutorial or a presumed regional endpoint.
- Publish into the relay. In OBS or another compatible encoder, use the relay host as the server and publish to the application and stream name expected by your configuration, for example
rtmp://relay-host/live/stream-name. Keep this incoming publishing address distinct from YouTube’s outbound ingest destination. - Check the local path first. Use the image author’s OBS-to-container and VLC example, or an equivalent local publisher/player check, to verify that the relay receives the feed. This isolates source-to-relay problems before you troubleshoot YouTube delivery.
- Verify YouTube delivery. Check the Live Control Room preview and stream-health messages after publishing. Do not treat a running Docker container as proof that YouTube is receiving a healthy stream.
Set encoder quality to match the stream
Configure the encoder that creates the incoming feed. YouTube’s recommendations depend on resolution, frame rate, and codec, so select the matching row in its current bitrate table instead of applying one bitrate to every stream. The guidance includes H.264, H.265/HEVC, and AV1 among codec options, recommends constant bitrate (CBR), supports frame rates up to 60 fps, and recommends a two-second keyframe interval that should not exceed four seconds. Its advanced audio guidance recommends stereo AAC at 128 Kbps and 44.1 kHz. Follow the current settings shown for your chosen resolution, frame rate, and codec, then test with representative motion and audio and monitor stream health. YouTube recommended live encoder settings
A relay forwards a stream; it does not correct an encoder configuration that is unsuitable for YouTube. If the preview is unstable, inspect the selected bitrate row, CBR setting, keyframe interval, codec, audio format, and the source’s actual upload capacity rather than changing settings at random.
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
What you need for genuinely continuous operation
Docker and the RTMP module provide a relay mechanism, not an end-to-end 24/7 programming or uptime guarantee. A continuous channel also needs a source that keeps producing video and audio. A user who stops OBS, loses power, or ends the source feed has stopped the input even if the relay container remains running.
- Source process: Decide how the source will keep publishing without manual intervention and how it will restart after a crash or host reboot. The module documentation describes static pulls that start when NGINX starts and external program execution on events as possible building blocks; they are not a complete source workflow or a guarantee of recovery.
- Container and host: Plan for container restarts, host maintenance, storage, cooling, and power. Configure and verify a restart policy appropriate to your deployment, and make sure the host itself restarts after a power interruption if that is required.
- Network path: The source-to-relay connection and relay-to-YouTube path both need usable connectivity and enough upload capacity. Monitor the host and network, and decide how you will be alerted when the source disconnects or YouTube reports unhealthy delivery.
- Recovery behavior: Establish what happens when YouTube drops the connection or the source stops. A running container does not prove that the outbound connection reconnects or that the feed resumes correctly; test the behavior with your chosen image and configuration.
- Credentials and updates: Keep stream keys private, review access to secrets, and test image or module updates before applying them to an always-on deployment.
YouTube says streams under 12 hours are automatically archived. Do not assume one archive will cover a stream that runs beyond that threshold; check the platform’s current behavior and plan how to handle a long-running broadcast and its recordings. YouTube live stream archiving information
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 by checking each link in the chain
The container starts, but the publisher cannot connect
- Confirm Docker published port 1935 from the host and that the firewall permits access from the source.
- Check that the source uses the application and stream name expected by the NGINX configuration.
- Inspect container logs and configuration for syntax errors, a missing RTMP module, or a port conflict.
The relay receives video, but YouTube shows no preview
- Verify that the outbound server URL and stream key were copied from the correct YouTube Live Control Room stream.
- Check the outbound target syntax and whether the selected module/client supports the protocol configured. Do not assume an RTMP target is RTMPS.
- Review the container logs, YouTube preview, and stream-health messages to locate whether the failure is at relay egress or YouTube ingest.
The preview appears but is unstable or unhealthy
- Match bitrate to YouTube’s current table row for the actual resolution, frame rate, and codec.
- Check CBR, the recommended two-second keyframe interval (no more than four seconds), and the documented audio settings.
- Test representative motion and audio, then inspect the source upload connection and both network legs for capacity or interruptions.
The stream stops after a disconnect or reboot
- Determine which component stopped: source process, Docker container, host, network, or YouTube connection.
- Verify that the relevant process and container restart behavior works after a controlled test, then confirm YouTube receives the resumed feed.
- Add monitoring and alerts for the failure modes you need to detect; the module and example image do not establish a specific recovery policy.
DIY relay or a cloud service?
A Docker relay is appropriate when you want to control the host, module, source workflow, and recovery behavior yourself. It adds operational work: you must maintain the image and module, secure the ingest, keep the source and network available, and verify recovery. Existing suitable hardware can serve as the host; the sources do not establish a required model or minimum hardware specification. A compact computer is an optional host choice, not a YouTube requirement.
Or let it run in the cloud
StreamNeo is a cloud service for keeping a YouTube channel live from uploaded videos. Upload a recording or build a playlist, add your YouTube stream key once, and go live. The service loops the uploaded video from the cloud, so nothing has to stay on at home. It streams the files as uploaded, up to 4K 60fps, at one price per slot rather than quality tiers; it can automatically recover if YouTube drops the stream. The first day is free with no card. Monthly pricing is $9.99 per month. This is for uploaded video playback, not a live camera feed. Start a StreamNeo free day
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.




