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

For FFmpeg running on a VPS and publishing directly to YouTube, allow outbound RTMPS over TCP port 443 if the VPS or provider firewall restricts outgoing traffic. You do not need to open inbound TCP port 1935 for this direct-to-YouTube setup. Port 1935 is relevant when the VPS itself accepts an incoming RTMP stream from another encoder.

First identify which way the stream travels

The firewall rules depend on whether FFmpeg sends the stream straight to YouTube or an external encoder sends it to a server on your VPS first. These are different network flows:

Setup Connection direction Firewall need Does the VPS need an incoming listener?
FFmpeg on the VPS publishes directly to YouTube Outbound from the VPS to YouTube over RTMPS Permit outbound TCP 443 if egress is restricted No
An encoder publishes to an RTMP service on the VPS Inbound from the encoder to the VPS, then onward from the VPS Permit inbound TCP 1935 only if the service listens on that port; configure onward connectivity separately Yes

YouTube’s RTMPS ingestion documentation says, “The connection must be made to port 443 on the ingestion server.” Google for Developers: Delivering Live YouTube Content via RTMPS FFmpeg documents 1935 as RTMP’s default port; that does not make it YouTube’s direct RTMPS publishing port. FFmpeg protocol documentation

Configure a VPS that publishes directly to YouTube

1. Get the current RTMPS address and key from YouTube

In YouTube Live Control Room, use the RTMPS server URL and stream key for the stream. Check that the URL uses the rtmps protocol and that you have copied the complete server address and path. Keep the key private; anyone who obtains it may be able to broadcast to your channel.

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.
#1 Best Overall
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
  • Includes Raspberry Pi 5 with 2.4Ghz 64-bit quad-core CPU (8GB RAM)
  • Includes 128GB Micro SD Card pre-loaded with 64-bit Raspberry Pi OS, USB MicroSD Card Reader
  • CanaKit Turbine Black Case for the Raspberry Pi 5
  • CanaKit Low Noise Bearing System Fan
  • Mega Heat Sink - Black Anodized

YouTube recommends RTMPS, its secure extension to RTMP. If a connection times out or TLS negotiation fails, YouTube advises checking the URL and port and confirming the encoder supports RTMPS. YouTube Help: Choose live encoder settings, bitrates, and resolutions

2. Check the VPS host firewall before changing it

Firewall commands depend on the operating system and firewall manager. On Ubuntu systems using UFW, inspect the current policy first:

Rank #2
CanaKit Raspberry Pi 5 16GB Starter Kit PRO - Turbine Black (128GB Edition) (16GB RAM)
  • Includes Raspberry Pi 5 16GB with 2.4Ghz 64-bit quad-core CPU (16GB RAM)
  • Includes 128GB Micro SD Card pre-loaded with 64-bit Raspberry Pi OS, USB MicroSD Card Reader
  • CanaKit Turbine Black Case for the Raspberry Pi 5
  • CanaKit Low Noise Bearing System Fan
  • Mega Heat Sink - Black Anodized

sudo ufw status

If you are connected over SSH and plan to enable or tighten inbound filtering, make sure a rule permits your actual SSH port—and, where practical, limits access to your trusted source addresses—before applying a restrictive policy. A mistake can lock you out of the VPS. UFW documents status checks, default policies, and port rules; its examples are not a complete security policy for every server. Ubuntu: Uncomplicated Firewall (UFW)

3. Permit outbound RTMPS only if outgoing traffic is restricted

When the host or provider blocks outbound connections by default, allow FFmpeg to connect to the RTMPS destination supplied by YouTube over TCP 443. Prefer a destination-specific egress rule if your firewall supports it and you can identify the required destination. If outbound traffic is already allowed, an extra broad allow rule may not be needed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
CanaKit Raspberry Pi 5 Essentials Starter Kit (4GB RAM)
  • CanaKit Raspberry Pi 5 Essentials Starter Kit

Do not substitute an inbound TCP 443 rule: inbound and outbound rules govern different directions. Do not open inbound 1935 merely because it appears in RTMP examples; direct publishing from FFmpeg on the VPS does not require an RTMP listener there.

4. Check the provider firewall as well

Some VPS vendors provide a separate network firewall in their control panel. A host-level allow rule cannot override a provider firewall that blocks the same traffic. Check the vendor’s current documentation for the names, defaults, and direction of its egress controls. The correct panel steps depend on the provider; there is no single Indian VPS firewall interface to follow here.

Rank #4
SANOOV Raspberry Pi 5 4GB Kit, 4GB RAM Single Board Computer with Active Cooler and ABS Case, Complete Raspberry Pi 5 Starter Kit for IoT Robotics Retro Gaming
  • All-in-One Complete Kit: This SANOOV RPi 5 bundle comes with Raspberry Pi 5 4GB RAM single board, active cooler, durable ABS case and screwdriver. No extra parts needed, ready to use right out of the box for beginners and hobbyists
  • Powerful Single Board Computer: Equipped with 4GB RAM and high-performance processor, delivers fast running speed for 4K playback, AI projects, programming and daily computing tasks. SANOOV for raspberry pi 5 4GB is equipped with broadcom 64 quad-core Arm Cortex A76 processor with gigabit ethernet and upgraded with IEEE 802.11ac Wi-Fi, Bluetooth 5.0 dual-band 2.4Ghz and 5Ghz and Power Over Ethernet (POE). Upgrading delivers 2-3 x speed vs Pi 4, redefining the experience
  • Efficient Active Cooler: Effectively lowers operating temperature and prevents performance throttling. Runs quietly even under long-time heavy load, ensures stable operation all day long. SANOOV RPi 5 4GB kit offer an active cooler, which combines an aluminium heatsink with a high-performance PWM fan. Active cooler is fully compatible with the Pi OS, which can effectively reduce the temperature of RPi5 and ensure its good performance during long-term high load operation
  • Sturdy ABS Protective Case: Well-fitted for Raspberry Pi 5 board, can be secured with 4 screws to effectively protect the Pi 5 motherboard from damage, reserves full access to all ports and buttons. SANOOV uses ABS material to produce the case, which has a softer texture and feel. Meanwhile, SANOOV case adopts a layered design for easy disassembly and installation. (Tip: The Case cannot install M.2 HAT Add on Board and Solid State Drive!)
  • Wide Application & Full Compatibility: Seamlessly compatible with official OS and mainstream peripheral accessories for Raspberry Pi 5. Whether you are a beginner, student, electronics hobbyist or professional developer, this all-in-one kit meets your diverse needs. It excels in IoT projects, robotics design, retro gaming devices, home media servers and other DIY creations. Backed by a large global community, you can easily find guides, technical support and shared projects online

5. Test the connection, then monitor YouTube’s stream health

Start with the RTMPS address and key from Live Control Room, then test a representative stream before relying on it. A firewall only establishes network reachability; it does not confirm that the key, video encoding, bitrate, or stream configuration is correct. YouTube recommends testing and monitoring stream health. Its encoder guidance recommends CBR and a 2-second keyframe interval (no more than 4 seconds). For H.264 at 1080p30 it lists 4 Mbps minimum and 10 Mbps recommended; at 1080p60 it lists 6 Mbps minimum and 17 Mbps recommended. These are YouTube’s listed encoder recommendations, not measurements of VPS network performance. YouTube Help: Choose live encoder settings, bitrates, and resolutions

If the VPS is an RTMP ingest server instead

Use this branch only when an encoder outside the VPS publishes to an RTMP service running on the VPS. In that design, the VPS needs a configured listening service, and the firewall must permit inbound connections to the listener. If it uses the documented RTMP default, that commonly means TCP 1935; confirm the service’s actual bind address and port before adding a rule.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
RasTech Raspberry Pi 5 8GB Kit with Active Cooler and Pi5 Case
  • 【What you Get】You will get 1*Pi 5 8GB Single Board,1*RasTech Case,1*Active Cooler,1*Screwdriver,1*Installation instructions,12-month free warranty, lifetime service, 24-hour prompt and friendly response.
  • 【More Connectors】There are two USB 3.0 ports(5Gbps simultaneously) and two USB 2.0 ports, which triple total bandwidth ,support any combination of up to two cameras or displays. Peak SD card performance is doubled through support for the SDR104 high-speed mode. It provides a smooth desktop experience for you. Offer Gigabit Ethernet and a PCIe interface, along with dual-band Wi-Fi and Bluetooth 5.0/BLE wireless capability. The RasTech Pi 5 Kit use the new 27W 5.1V 5A USB-C power connector.
  • 【 Support Dual 4Kp60 Display 】Each of the two microHDMI sockets can control a 4K display at 60 Hertz, now support HDR, offering super HD video for media streaming projects. RPi 5 is the first RPi model that comes with a PCI Express port (PCIe 2.0 x1 with 500 MB/s) to attach SSDs (requires separate M.2 HAT).
  • 【 Excellent Chips And Applications】Pi 5 is a full-size Pi computer using silicon built in-house at Pi. The RP1 “southbridge” provides the bulk of the I/O capabilities for Pi 5. Pi 5 is more friendly and convenient in the development of Internet of Things, Web development, machine identification, automatic control and other electronic equipment applications and network.
  • 【 Faster CPU, Better GPU 】 Pi 5 features a Broadcom BCM2712 64-bit quad-core Arm Cortex-A76 processor running at 2.4GHz, it delivers a 2–3× increase in CPU performance relative to RaspberryPi 4. The 800MHz VideoCore VII GPU is compatible to OpenGL ES 3.1 and Vulkan 1.2, substantial uplift in graphics performance. Pi 5 Offers lightning-fast CPU speed, a PCI Express interface, a Real Time Clock (RTC) and a power button and runs significantly cooler than Pi 4.
  • Restrict the inbound source addresses to the encoder’s known addresses where practical.
  • Do not expose monitoring, administration, or other service endpoints publicly unless you have a specific need and have secured them.
  • Check both the host firewall and the provider network firewall for the inbound path.
  • Configure and verify the VPS’s separate outbound path to YouTube; accepting an incoming stream does not by itself establish that onward publishing works.

FFmpeg’s protocol documentation describes RTMP and its default port, but the actual listener and firewall syntax depend on the RTMP service, operating system, and provider. FFmpeg protocol documentation

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot firewall and connection failures

  • FFmpeg times out connecting to YouTube: Check whether outbound TCP 443 is permitted at both the VPS host and provider firewall. Confirm the destination URL and port from YouTube.
  • TLS or secure-connection error: Verify the URL uses rtmps, the full server address and path are correct, and the FFmpeg build supports RTMPS.
  • You opened inbound 1935 but direct publishing still fails: That rule is for incoming RTMP connections to a VPS listener. Direct FFmpeg-to-YouTube publishing needs the outbound RTMPS path instead.
  • Remote encoder cannot reach your VPS: This applies to the ingest-server design. Confirm that an RTMP service is actually listening on the expected port, then check inbound rules at both firewall layers and any source-address restrictions.
  • Firewall allows the connection, but YouTube does not accept the stream: Recheck the stream key, RTMPS URL, and encoder settings, then inspect YouTube’s stream-health information. Network access alone does not validate the broadcast configuration.
  • You lost SSH access after changing policy: Avoid enabling a restrictive inbound policy until the actual SSH port has an allow rule. Recovery options depend on the VPS provider; consult its console or rescue-access documentation.

Copyright and reused-content checks still matter

A working firewall does not grant rights to the video or music you stream. Before broadcasting, confirm you have the necessary rights and review YouTube’s applicable policies, especially if you plan to loop prerecorded material. Use the copyright safety checklist as a practical pre-stream check.

Or let it run in the cloud

If the goal is to keep prerecorded video live on YouTube without maintaining a VPS firewall and FFmpeg process, StreamNeo runs the loop from the cloud: upload a recording or build a playlist, add your YouTube stream key, and go live. Nothing has to stay on at home; it streams the upload as made, up to 4K 60fps, at one price per slot, and automatically recovers if YouTube drops the stream. The first day is free with no card. Monthly billing is $9.99 per month. StreamNeo plays uploaded videos to YouTube; it is not a camera-based live setup. Start the free first day.

Quick Recap

Bestseller No. 1
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
Includes Raspberry Pi 5 with 2.4Ghz 64-bit quad-core CPU (8GB RAM); CanaKit Turbine Black Case for the Raspberry Pi 5
$259.95
Bestseller No. 2
CanaKit Raspberry Pi 5 16GB Starter Kit PRO - Turbine Black (128GB Edition) (16GB RAM)
CanaKit Raspberry Pi 5 16GB Starter Kit PRO - Turbine Black (128GB Edition) (16GB RAM)
Includes Raspberry Pi 5 16GB with 2.4Ghz 64-bit quad-core CPU (16GB RAM); CanaKit Turbine Black Case for the Raspberry Pi 5
$419.99
Bestseller No. 3
CanaKit Raspberry Pi 5 Essentials Starter Kit (4GB RAM)
CanaKit Raspberry Pi 5 Essentials Starter Kit (4GB RAM)
CanaKit Raspberry Pi 5 Essentials Starter Kit
$189.99

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.

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