Streaming Basics

OBS "Failed to Connect to Server": Fix It for YouTube, Facebook and Instagram

By the StreamLivestic team · · 13 min read

Connection Error Fixed — obs failed to connect to server

When OBS says "Failed to connect to server", your PC never finished the RTMP handshake with YouTube, Facebook or Instagram. Either something blocked the connection, or the platform refused it. Most cases of OBS failed to connect to server come down to three things: a stale stream key, the wrong protocol or URL (Facebook and Instagram only accept RTMPS on port 443), or a firewall, VPN or network setting stopping the traffic.

Quick fix: Copy a fresh stream key and server URL from the platform's live dashboard and paste both into OBS under Settings → Stream. For Facebook or Instagram, check the URL starts with rtmps:// and includes :443. Under Settings → Advanced → Network, set Bind to IP to Default and IP Family to IPv4 only. Turn off any VPN, then try again. If it still fails, run the port test further down to find out whether your network is the problem.

What the error actually means

When you press Start Streaming, OBS looks up the ingest server's address, opens a TCP connection to it (port 1935 for RTMP, 443 for RTMPS), runs a TLS handshake if it's RTMPS, and then sends your stream key as the "publish" path. The platform checks the key and either accepts the stream or hangs up.

OBS has a few different messages for where that process breaks. They're worth reading closely, because each one points somewhere different:

One lesson from running long streams: a dead key looks exactly like a broken network. When Facebook ended our live at its 8-hour limit, the old key stopped working that moment. Every reconnect failed within about 2 seconds, and FFmpeg only said Input/output error. Nothing pointed at the key. So if an OBS "failed to connect to server" error appears mid-stream on Facebook, check the key before you start blaming your router.

Why it happens

These are roughly in order of how often we see them:

  1. Stale stream key. You reset the key in YouTube Studio, made a new Facebook live post, or opened a new Instagram Live Producer session, and OBS still has the old key. Instagram makes a new key every time you use Live Producer.
  2. Facebook's single-use key. A normal (non-persistent) Facebook key belongs to one live video. Meta's Live Video API docs say a stream URL must be used within 24 hours of creation and, once used, can take a stream for up to 8 hours. After the broadcast ends, that key is finished.
  3. RTMP sent to an RTMPS server. Meta requires broadcasts to be encrypted with RTMPS. If you send plain rtmp://, or drop the :443, the connection times out. YouTube still accepts RTMP on 1935, but its RTMPS guide warns that sending cleartext to an RTMPS server causes a timeout, and that sending RTMPS to an RTMP-only host causes a certificate error.
  4. Wrong server URL or region. A typo, an old saved server, the key pasted into the server field, or a custom ingest that has gone away.
  5. Firewall, antivirus or ISP blocking port 1935. Office, college, hotel and some mobile networks block anything that isn't web traffic. Some antivirus "web shields" inspect or block RTMP. Port 443 almost always gets through, which is a good reason to use RTMPS.
  6. VPN or proxy. The VPN exit node may be blocked by the platform, may not support the port, or may simply be too slow. OBS doesn't use your system proxy settings for RTMP.
  7. Bind to IP set to a dead adapter. If you once picked a specific network adapter and later switched from Wi-Fi to Ethernet, or a VPN adapter disappeared, OBS keeps trying to send from an address that no longer exists.
  8. Broken IPv6. Your router hands out IPv6 but doesn't route it properly. OBS tries IPv6 first and stalls. This tends to show up on fibre and 4G/5G connections that run IPv6 alongside carrier-grade NAT.
  9. Service integration out of sync. With "Connect Account" in OBS, the key comes from your linked account and the selected broadcast. If the token expires or you schedule a different event, OBS can end up pushing to an event that isn't ready.
  10. Wrong system clock. RTMPS uses TLS certificates, and certificate checks depend on the date. If your clock is days off, or Windows is old enough to be missing current root certificates, the handshake fails.
  11. YouTube live streaming not enabled. New or unverified channels, or channels with a live-streaming restriction in the last 90 days, can't stream at all.

OBS failed to connect to server: decision table

Find the line that matches your message and your symptom, then go to the fix.

What you seeMost likely causeFix
"Failed to connect to server" straight away, every time, on Facebook/InstagramUsing rtmp:// or no :443Use the RTMPS URL shown in Live Producer (Fix 2)
"Failed to connect to server" after about 10–20 seconds, on any platformPort blocked, VPN, dead Bind to IP, broken IPv6Port test, Fixes 4–6
"Could not access the specified channel or stream key"Wrong, reset or expired keyCopy a fresh key (Fix 1)
Works once on Facebook, fails the next day with the same keySingle-use key was consumedNew key or a persistent key (Fix 1)
"Disconnected", then reconnects fail every ~2 secondsPlatform ended the broadcast (for example, Facebook's 8-hour cap)Start a new live and paste the new key
"Invalid Path or Connection URL"Malformed server URLRe-paste the URL, no spaces, key in its own box (Fix 3)
Log shows Cert verify failed or "invalid SSL certificate"Wrong clock, outdated Windows, or antivirus intercepting TLSSync the time, update Windows (Fix 8)
Works on mobile hotspot, fails on home/office Wi-FiNetwork or ISP blocking 1935Switch to RTMPS 443, or ask the ISP
YouTube: no stream key shown, or "Live streaming not available"Live not enabled on the channelVerify the channel and wait for activation (Fix 9)

Test your port before you change ten settings

This takes 30 seconds and tells you whether the problem is your network or your settings. If the port test fails, no OBS setting will help.

Windows (PowerShell):

Test-NetConnection a.rtmp.youtube.com -Port 1935
Test-NetConnection a.rtmps.youtube.com -Port 443
Test-NetConnection live-api-s.facebook.com -Port 443

Check the TcpTestSucceeded line. True means the port is open from your PC. False means something between you and the platform is blocking it.

macOS / Linux:

nc -vz a.rtmp.youtube.com 1935
nc -vz live-api-s.facebook.com 443
# check the TLS handshake and certificate too:
openssl s_client -connect live-api-s.facebook.com:443 -servername live-api-s.facebook.com </dev/null | head -20

If you prefer telnet (enable it under Windows Features first), use telnet a.rtmp.youtube.com 1935. A blank screen means it connected. "Could not open connection" means it's blocked.

How to read the results: if 1935 fails but 443 works, your network blocks RTMP, so switch YouTube to RTMPS. If both fail, turn off the VPN and firewall and test again. If they still fail, try a phone hotspot. If the hotspot works, the problem is your ISP or router. If every port test passes but OBS still fails, the problem is in OBS or the key, so work through Fixes 1–3 and 5–9.

How to fix it

1. Paste a fresh stream key (and understand each platform's key rules)

Every platform shows the key in a different place, and they all behave differently:

In OBS, go to Settings → Stream, choose Use Stream Key or Custom, and paste the key with no leading or trailing spaces. Pasting from some messaging apps adds an invisible line break, so if a key keeps failing, type the last few characters by hand to check.

Streamlabs Desktop: Settings → Stream → Stream Type: Streaming Services or Custom Streaming Server → paste the key. vMix: click the gear next to Stream → Destination → Custom RTMP Server → URL and Stream Name/Key.

2. Use RTMPS on port 443 for Facebook and Instagram

Meta doesn't accept unencrypted RTMP. Use the exact URL shown in Live Producer. For Facebook it's normally:

Server:     rtmps://live-api-s.facebook.com:443/rtmp/
Stream key: FB-1234567890-0-AbCdEf...

Instagram's URL looks different (typically an edgetee-upload style host on 443). Copy it exactly. Don't reuse the Facebook URL for Instagram.

For YouTube, both work:

RTMP:   rtmp://a.rtmp.youtube.com/live2
RTMPS:  rtmps://a.rtmps.youtube.com:443/live2
Backup: rtmp://b.rtmp.youtube.com/live2?backup=1

We suggest RTMPS for YouTube too. Port 443 is the same port as normal HTTPS, so it gets through almost any network, and YouTube's encoder guide calls it a good choice for most content.

FFmpeg users: your build needs TLS support (OpenSSL or GnuTLS). If it doesn't have it, you'll see Protocol not found for rtmps://. A working command looks like this:

ffmpeg -re -i input.mp4 -c:v libx264 -preset veryfast -b:v 4500k -maxrate 4500k -bufsize 9000k \
  -g 60 -keyint_min 60 -pix_fmt yuv420p -c:a aac -b:a 128k -ar 44100 \
  -f flv "rtmps://live-api-s.facebook.com:443/rtmp/YOUR-KEY"

Run ffmpeg -protocols | grep rtmps to check your build has RTMPS. Always wrap the URL in quotes, because keys can contain & and ?.

3. Fix the server URL

The "Invalid Path" error is nearly always a copy-paste problem. Check these:

4. Rule out firewall, antivirus and ISP blocks

  1. Run the port test above.
  2. Windows: Settings → Privacy & security → Windows Security → Firewall & network protection → Allow an app through firewall → tick obs64.exe for Private and Public.
  3. Third-party antivirus (Quick Heal, Kaspersky, Avast, Norton and others): turn off "web shield", "HTTPS scanning" or "network protection" for a minute and test. If that fixes it, add OBS as an exception and turn protection back on. The OBS KB suggests the same approach.
  4. Office or college network: ask IT to allow outbound TCP 1935, or use RTMPS on 443.
  5. Home ISP: if a phone hotspot works and your broadband doesn't, restart the router. If that doesn't help, ask the ISP whether they filter port 1935.

5. Turn off the VPN or proxy

Disconnect the VPN completely. Leaving it "paused" sometimes keeps its virtual adapter in place. If you need the VPN for other apps, use split tunnelling to keep obs64.exe outside it. A slow or far-away exit node can also cause "Disconnected" errors halfway through a stream, even when it connects at first.

6. Reset Bind to IP and try IPv4 only

In OBS, go to Settings → Advanced → Network:

7. Choose between the connected account and a custom server

Settings → Stream → Connect Account (recommended) for YouTube gets the key for you and adds the Manage Broadcast button. That's convenient, but it adds another way for things to go wrong: an expired login, the wrong channel when you have a Brand Account, or a scheduled event that isn't the one you think it is. If you see connection errors while using a connected account:

Facebook and Instagram work most reliably with Service: Custom and the exact URL and key from Live Producer.

8. Sync your clock and update Windows

RTMPS checks the server's certificate, and that check depends on your PC's date being right. Go to Settings → Time & language → Date & time → turn on Set time automatically, then click Sync now. On Linux, run timedatectl set-ntp true. On the OBS forum, the usual advice for "Cert verify failed" errors to Facebook is to install all pending Windows Updates, because older builds can be missing current root certificates.

9. Make sure YouTube live streaming is enabled

YouTube Help lists the requirements: a verified channel, no live-streaming restrictions in the past 90 days, and a minimum age of 16. The first time you ask for live access, it can take up to 24 hours to switch on. That wait is widely reported and appears in YouTube's go-live flow, but it isn't on the main requirements page. Until access is on, YouTube Studio won't give you a working key, and anything you paste from elsewhere will be refused.

10. Still stuck? Read the log

Go to Help → Log Files → Upload Current Log File, and look for lines near "Connecting to RTMP URL". Connection timed out points to a network block or RTMP being sent to an RTMPS server. Cert verify failed points to the clock or certificates. A connection that opens and then closes straight away points to the key. You can paste the log URL on the OBS forum if you need help.

PlatformProtocol / portServerKey behaviour
YouTubeRTMP 1935 or RTMPS 443rtmps://a.rtmps.youtube.com:443/live2Reusable until you reset it
FacebookRTMPS 443 onlyrtmps://live-api-s.facebook.com:443/rtmp/One broadcast unless persistent; max 8 hours per broadcast
InstagramRTMPS 443 onlyCopy from Live ProducerNew key every session

How to stop it coming back

Official references: OBS Stream Connection Troubleshooting, YouTube: Delivering Live Content via RTMPS, Meta Live Video API overview, Instagram Live Producer, YouTube: Get started with live streaming.

FAQ

Why does OBS say failed to connect to server?

OBS could not complete the connection to the ingest server. The usual causes are a stale stream key, sending RTMP to a server that only accepts RTMPS (Facebook and Instagram), or a firewall, VPN, Bind to IP or IPv6 problem blocking the traffic.

How do I fix OBS failed to connect to server on Facebook?

Use the RTMPS URL rtmps://live-api-s.facebook.com:443/rtmp/ and a fresh key from Live Producer. Normal Facebook keys belong to one broadcast, so turn on the persistent stream key if you go live regularly.

What does 'Could not access the specified channel or stream key' mean?

The server answered but refused your stream key. Copy a new key from the platform, paste it without spaces, and make sure you haven't reset it since you saved it in OBS.

How do I check if port 1935 is blocked?

On Windows, run Test-NetConnection a.rtmp.youtube.com -Port 1935 in PowerShell and look for TcpTestSucceeded : True. On macOS or Linux, use nc -vz a.rtmp.youtube.com 1935. If 1935 is blocked, switch to RTMPS on port 443.

Should I use RTMP or RTMPS for YouTube?

Both work on YouTube, but RTMPS on port 443 (rtmps://a.rtmps.youtube.com:443/live2) is encrypted and gets through far more firewalls. Facebook and Instagram accept only RTMPS.

Why does my Facebook stream keep failing to reconnect after hours of streaming?

Facebook allows one broadcast to run for up to 8 hours. When it ends, the key stops working right away and every reconnect fails within seconds, which looks like a network error. Start a new live and paste the new key.

Does a VPN cause OBS connection errors?

Often, yes. A VPN can block the RTMP port, send you through a slow or blocked exit node, or leave Bind to IP pointing at its adapter. Disconnect it fully, or use split tunnelling to keep OBS outside it.

OBS StudioFailed to connect to serverStream keyRTMPSYouTube LiveFacebook LiveInstagram LiveStreaming errorsPort 1935

Sources & official docs