Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To relay a continuous YouTube stream through Docker, run NGINX with the third-party nginx-rtmp-module, publish your video and audio to its RTMP application, and configure that application to push the stream to the exact ingest server YouTube provides for your broadcast. Docker keeps the relay process isolated; it does not generate the program, guarantee uptime, or make an ordinary RTMP push encrypted.

How the relay works

The setup has three separate parts: a source that continuously produces audio and video, an NGINX RTMP relay running in a container, and YouTube Live. Your source publishes to the relay, and the relay pushes the stream to YouTube’s supplied ingest endpoint. If the source stops, the host loses power or network access, or the path to YouTube fails, the relay alone cannot keep the program going.

NGINX Open Source does not include RTMP support by default. The nginx-rtmp-module is a third-party module. NGINX documents adding third-party modules when building Open Source; its separate RTMP installation instructions for NGINX Plus concern the Plus package, not a free Open Source add-on.

Choose an image or build the module

Use a community Docker image for a smoke test

The community tiangolo/nginx-rtmp repository documents this basic container launch:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • 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 is a demonstration command, not a universal production recommendation. The repository is not an official NGINX image; before using it for a long-running service, inspect its maintenance status, the NGINX base version, and compatibility with the bundled module. The repository demonstrates publishing from OBS and checking playback in VLC, which is useful for confirming local ingest before involving YouTube.

Build a compatible image for tighter control

For a deployment where versions and configuration matter, build NGINX Open Source with a compatible copy of nginx-rtmp-module. NGINX’s documented third-party module approach uses --add-module=<PATH> during the build. Pin the NGINX and module versions you select, and rebuild deliberately when updating them. The sources cited here do not establish a particular version pairing or tested Dockerfile, so verify compatibility against the versions you choose rather than copying an assumed production recipe.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 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 an RTMP application and YouTube push

The module’s documented relay pattern is an RTMP application with live on; and one or more push targets. In concept, your publisher connects to rtmp://relay-host/live/stream-name; NGINX accepts that stream and forwards it to the configured destination.

A minimal configuration shape is shown below. Replace the destination with the exact server URL and stream key shown for your broadcast in YouTube Live Control Room. Treat this as a pattern, not a complete production configuration: the correct destination syntax depends on the endpoint YouTube gives you and on the relay client’s protocol support.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • 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.
rtmp {
    server {
        listen 1935;

        application live {
            live on;
            push rtmp://YOUTUBE_INGEST_SERVER/YOUR_STREAM_KEY;
        }
    }
}

Do not commit a real stream key to a public repository, bake it into a broadly shared image, or expose it in logs or screenshots. Use a deployment mechanism that can supply secrets at runtime and restrict access to the configuration and container logs. If a key is exposed, replace it in YouTube Live Control Room.

RTMP is not automatically RTMPS

YouTube recommends RTMPS, the encrypted extension to RTMP. A configuration that begins with rtmp:// is not encrypted just because YouTube supports RTMPS. Confirm that the chosen relay client and destination protocol actually establish TLS; do not assume this module’s ordinary push target handles RTMPS. Use the exact ingest URL YouTube displays and verify that your chosen relay can negotiate its protocol. YouTube’s encoder workflow is to copy the server URL and stream key from Live Control Room.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • 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 path before making it continuous

  1. Start the container and confirm the listener. Publish a test stream to the relay’s live application using an OBS output URL such as rtmp://RELAY_HOST/live and a stream name such as test. The full publishing path is then rtmp://RELAY_HOST/live/test. Restrict port 1935 to trusted publishers; do not expose an unauthenticated ingest to the public internet without an access-control plan.
  2. Check local playback. Follow the community image’s OBS-to-container example and use VLC or a comparable player to confirm the relay receives and serves the stream. This isolates local ingest problems from YouTube destination, credential, and protocol problems.
  3. Set the YouTube destination. Copy the current server URL and stream key from Live Control Room, configure the outbound target, and keep the key secret. Prefer RTMPS only where the relay path is confirmed to support it.
  4. Confirm YouTube receives the picture and sound. Use the Live Control Room preview and stream-health messages. Do not treat a successful local VLC test as proof that YouTube ingest or the stream key is correct.
  5. Test representative content. Send the actual kind of motion and audio you plan to run, check stream health, and correct encoder or network issues before relying on the stream.

Set encoder output to YouTube’s current guidance

Choose the bitrate row for your intended resolution, frame rate, and codec from YouTube’s current live-encoder guidance; there is no single bitrate appropriate for every stream. YouTube’s guidance includes H.264, H.265/HEVC, and AV1 among protocol and 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.

For advanced audio settings, YouTube recommends stereo AAC at 128 Kbps and 44.1 kHz. Verify that the encoder’s selected codec and settings match the guidance for the ingest workflow you are using. Monitor Live Control Room’s stream-health feedback rather than assuming that a configured bitrate guarantees a healthy stream.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What you need for a genuine 24/7 stream

A continuous relay is a system, not a single Docker command. The module can relay a live publisher’s stream, but continuity depends on the source continuing to generate audio and video, the host and container staying available, the network path remaining usable, and the selected encoder and relay recovering appropriately after interruptions.

  • Continuous source: Keep the encoder or media-generation process running. The RTMP module’s documented static-pull and event-program features can be building blocks for unattended flows, but they do not themselves establish an always-playing source.
  • Container recovery: Decide how the container should restart after a process or host failure, and test what happens to the incoming publisher and outbound push after a restart. A restart policy is not a guarantee that the stream resumes correctly.
  • Host and network: Monitor host availability, storage, network connectivity, and outbound access to YouTube. A physical host must remain powered and connected; a Docker container cannot compensate for home or server connectivity loss.
  • Credential and access control: Protect the YouTube key, limit who can publish to the relay, and avoid leaving an open ingest endpoint accessible to untrusted sources.
  • Alerting: Arrange a way to notice when the source, container, or YouTube connection has stopped. The cited module and Docker examples do not promise a particular monitoring or recovery policy.

YouTube says streams under 12 hours are automatically archived. Do not assume that one archive will cover a stream that runs beyond that threshold; plan the broadcast and archive workflow accordingly.

Common problems and what to check

Symptom Likely area What to check
Publisher cannot connect to the relay Container, port, or publishing path Confirm the container is running, port 1935 is mapped and reachable from the publisher, the RTMP application is named live, and the publisher URL includes the intended stream name.
VLC cannot play the local test stream Local ingest or relay configuration First confirm OBS is publishing to the expected application and stream name. Check the NGINX RTMP configuration and container logs before troubleshooting YouTube.
Local playback works but YouTube does not receive the stream Destination, key, or protocol Re-copy the current server URL and key from Live Control Room, check the outbound target syntax, and verify that the relay supports the selected protocol. A plain RTMP push does not prove an RTMPS connection.
YouTube reports poor stream health Encoder settings or connection quality Check the chosen resolution-specific bitrate guidance, CBR setting, keyframe interval, audio settings, and the host’s network path. Use YouTube’s health messages and test representative content.
Stream stops after a source or host interruption Recovery design Check whether the source resumed publishing, whether the container restarted, and whether the outbound push reconnected. Test these failure cases; the module’s relay feature is not an uptime guarantee.

Docker relay or cloud-managed playback?

A Docker relay is appropriate when you want to control the host, module build, and relay configuration, and can operate the source, networking, credential handling, and recovery plan. A spare or rented host may be suitable if it can run the selected container and remain connected; the cited material does not establish a minimum hardware specification or recommend a particular server.

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, and go live. Nothing has to stay on at home. It loops what you uploaded, supports any uploaded quality up to 4K 60fps at one flat price per slot, and automatically recovers if YouTube drops the stream. The first day is free with no card required. Monthly pricing is $9.99 per month.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Start your free first day with StreamNeo.

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.