Streaming Basics
OBS "Failed to Connect to Server": Fix It for YouTube, Facebook and Instagram
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.
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:
- "Failed to connect to server": the TCP or TLS connection never came up. You couldn't reach the server, or the server cut you off before the key was checked. Older OBS builds added "Please make sure you have configured a valid streaming service and no firewall is blocking the connection."
- "Could not access the specified channel or stream key, please double-check your stream key. If it is correct, there may be a problem connecting to the server.": the server answered but turned down the publish request. The usual cause is a bad, expired or already-used key.
- "Invalid Path or Connection URL. Please check your settings to confirm that they are valid.": OBS couldn't even parse the server URL. Look for a typo, a missing
rtmp://, a space, or the key pasted into the URL box. - "Disconnected from server." / status bar "Disconnected, reconnecting in N second(s)": you were live and lost the connection. If every reconnect fails right away, the platform has probably ended the broadcast and killed the key.
- "An unexpected error occurred when trying to connect to the server. More information in the log file.": the details are in Help → Log Files → View Current Log. Lines like
Cert verify failedpoint to a TLS or certificate problem.
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:
- 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.
- 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.
- 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. - 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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 see | Most likely cause | Fix |
|---|---|---|
| "Failed to connect to server" straight away, every time, on Facebook/Instagram | Using rtmp:// or no :443 | Use the RTMPS URL shown in Live Producer (Fix 2) |
| "Failed to connect to server" after about 10–20 seconds, on any platform | Port blocked, VPN, dead Bind to IP, broken IPv6 | Port test, Fixes 4–6 |
| "Could not access the specified channel or stream key" | Wrong, reset or expired key | Copy a fresh key (Fix 1) |
| Works once on Facebook, fails the next day with the same key | Single-use key was consumed | New key or a persistent key (Fix 1) |
| "Disconnected", then reconnects fail every ~2 seconds | Platform 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 URL | Re-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 TLS | Sync the time, update Windows (Fix 8) |
| Works on mobile hotspot, fails on home/office Wi-Fi | Network or ISP blocking 1935 | Switch to RTMPS 443, or ask the ISP |
| YouTube: no stream key shown, or "Live streaming not available" | Live not enabled on the channel | Verify 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:
- YouTube: YouTube Studio → Create → Go live → Stream tab. The default key can be reused across streams, but clicking Reset kills the old one straight away. If you made a custom key under "Select stream key", make sure the broadcast you're watching uses that same key.
- Facebook: Live Producer → Streaming software. By default the key belongs to that one live video. For a recurring show, turn on the persistent stream key option in the stream setup, so the key stays the same between broadcasts. Even a persistent key can't get around the per-broadcast time limit.
- Instagram: On instagram.com, click + → Live, add a title and audience, then copy the stream URL and key. Instagram's own guidance says the key refreshes every time you use Live Producer, so last week's key is always dead. Start with the "Practice" audience to test without going public.
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:
- The URL starts with
rtmp://orrtmps://. Nothttps://, and not a bare hostname. - The key goes in the Stream Key box, not on the end of the URL. FFmpeg and some cloud tools are the exception: they take one combined URL with the key on the end.
- No space at the end of the URL.
- With the YouTube service preset, pick Primary YouTube ingest server rather than an old regional entry. YouTube routes you to the nearest ingest by itself, so you don't need to pick a region.
4. Rule out firewall, antivirus and ISP blocks
- Run the port test above.
- Windows: Settings → Privacy & security → Windows Security → Firewall & network protection → Allow an app through firewall → tick
obs64.exefor Private and Public. - 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.
- Office or college network: ask IT to allow outbound TCP 1935, or use RTMPS on 443.
- 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:
- Bind to IP: set it to Default. Choose a specific adapter only if you have more than one connection and know which one you want to use. If you choose one and it later disappears (Wi-Fi to cable, or a VPN closing), every connection fails.
- IP Family: try IPv4 only. The OBS KB suggests trying this and going back to "IPv4 and IPv6" if it makes no difference. If your OBS doesn't have this option, update OBS, or turn off IPv6 on the network adapter as a test (Control Panel → Network Connections → adapter → Properties → untick Internet Protocol Version 6).
- Leave Dynamically change bitrate off for now. It helps with dropped frames, not with failure to connect.
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:
- Click Disconnect Account, then connect again and pick the right channel.
- Or switch to Use Stream Key and paste the key yourself. This is simpler and easier to debug, and it's what we use for 24/7 streams.
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.
Recommended connection settings by platform
| Platform | Protocol / port | Server | Key behaviour |
|---|---|---|---|
| YouTube | RTMP 1935 or RTMPS 443 | rtmps://a.rtmps.youtube.com:443/live2 | Reusable until you reset it |
| RTMPS 443 only | rtmps://live-api-s.facebook.com:443/rtmp/ | One broadcast unless persistent; max 8 hours per broadcast | |
| RTMPS 443 only | Copy from Live Producer | New key every session |
How to stop it coming back
- Use RTMPS on 443 everywhere you can. It avoids most firewall and ISP blocks.
- For Facebook shows, turn on the persistent stream key, and plan for the 8-hour cap: end the broadcast and start a new one before you hit it.
- Copy a fresh Instagram key every session, and test with the "Practice" audience first.
- Don't click "Reset stream key" on YouTube unless the key has leaked, and update every encoder that uses it straight away.
- Leave Bind to IP on Default, and keep IP Family on IPv4 only if that fixed it for you.
- Use a wired connection, and keep OBS out of the VPN with split tunnelling.
- Keep the system clock on automatic sync, and keep Windows and OBS up to date.
- Save the three port-test commands in a text file, so the next time OBS fails to connect to the server you can check the network in 30 seconds.
- For unattended 24/7 streams, use a tool that can tell a dead key from a dead network. StreamLivestic spots repeated refusals and tells you to paste a fresh key instead of retrying forever.
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.
Sources & official docs
- OBS Knowledge Base: Stream Connection Troubleshooting
- OBS Studio en-US locale strings (error message text)
- YouTube: Delivering Live YouTube Content via RTMPS
- YouTube Help: Get started with live streaming
- Meta Live Video API overview
- Instagram Live Producer
- OBS Forum: dual-stack IPv4/IPv6 failed to connect
- OBS Forum: The RTMP server sent an invalid SSL certificate


