Windsurf 'Restarting server failed' ECONNREFUSED on Mac
Windsurf shows "Restarting server failed … ECONNREFUSED 127.0.0.1:51557" on a Mac. What the error means, fixes to try in order, and what to send Windsurf.
TroubleshootingUpdated 5 min read
On this page
You updated Windsurf, opened Cascade, and got this:
Restarting server failed
Error: connect ECONNREFUSED 127.0.0.1:51557We don't have a confirmed fix, and we won't pretend otherwise. The three GitHub issues where people reported this error end without one, and the Codeium tracker that hosted them was archived on October 13, 2026. The first reports came from M3 MacBooks after the 3 March 2025 update. The order below follows what the message says and ordinary Mac troubleshooting, not a Windsurf-documented procedure.
Why it happens
127.0.0.1 is your own Mac. ECONNREFUSED means something tried to connect to that address and port, and nothing was listening. So a local background server that Cascade depends on either never started or started and died. That much is certain from the message. The reason is not. The threads don't say.
Likely candidates, most common first:
- A stale process from before the update. Closing the window doesn't quit a Mac app. An old helper may still be running and block the new one. This is our guess from how apps behave, not something Windsurf has confirmed.
- A half-finished update. The app or its bundled server files may be in an inconsistent state.
- Something else holding the port or blocking local connections. Rare, but possible with security or network-filter tools.
- A real bug in that Windsurf build. If nothing below helps, this is the most honest explanation, and only Windsurf can fix it.
We also can't tell from the reports whether port 51557 is fixed or changes per launch. Your error may show a different number. Use the one from your own message wherever the steps mention a port.
| Cause | What you'd see | Fix to try |
|---|---|---|
| Leftover process | Error right after an update | Fix 1 |
| Stuck system state | Error persists after relaunch | Fix 2 |
| Server not running | lsof prints nothing | Fixes 3 and 4 |
| Another program on the port | lsof lists a non-Windsurf process | Fix 3 |
| VPN or security tool | Works with the tool paused | Fix 5 |
| Bug in the build | Nothing helps | Contact Windsurf |
Step-by-step fixes
Fix 1: Quit fully and clear leftover processes
- In Windsurf, choose Quit from the app menu (⌘Q), not just the red close button.
- Open Activity Monitor (press ⌘Space and type "Activity Monitor").
- Type
windsurfin the search field. Then trycodeiumandlanguage, since process names can vary. - Select any leftover process that clearly belongs to Windsurf and click the stop button in the toolbar. Choose Quit first, and Force Quit only if it won't end.
- Reopen Windsurf and open Cascade.
Fix 2: Restart the Mac
A restart clears stuck processes you can't easily find, and it costs a minute. Restart, open Windsurf first, and test Cascade before launching anything else. This also rules out another app grabbing the port during startup.
Fix 3: Check whether anything is listening on the port
This tells you whether the server is down or something else holds the port. Reproduce the error first, then run this in Terminal, replacing 51557 with the port from your message:
lsof -nP -iTCP:51557 -sTCP:LISTENIt lists any process listening on that TCP port. It only reads information, so there is nothing to undo.
- No output: nothing is listening, so the server isn't running. Continue with Fixes 4 and 5.
- A process that isn't Windsurf is listed: another program holds that port. Quit it and relaunch Windsurf.
- A Windsurf process is listed: the server may have started after the error appeared. Reopen Cascade or restart Windsurf and test again.
Fix 4: Install a fresh copy
An update can leave an app in a bad state, and a clean download also gets you the latest build. We can't say this is the cause, but it is cheap to rule out.
- Check your chip: Apple menu, then About This Mac.
- Quit Windsurf (⌘Q).
- Download the build for your Mac from Windsurf's official download page. It offers an Intel (x64) build as well as an Apple silicon one, so pick the one that matches your chip.
- Install it into Applications, choosing Replace if asked, then open it from there and test Cascade.
As of November 2026, Windsurf's Mac download information says it supports macOS versions that still get Apple security updates, usually the latest release and the two before it. If your macOS is older than that, the app may not run correctly.
Fix 5: Rule out VPN, proxy and security software
This is a long shot, because connections to your own Mac rarely pass through a VPN. Some security and network-filter tools do interfere with local connections, though.
- Disconnect your VPN, or pause the security tool, temporarily.
- Quit and reopen Windsurf.
- If Cascade now works, turn your tools back on one at a time to find the culprit, and look for an exclusion option for Windsurf.
Checklist before you report it
- You quit with ⌘Q and checked Activity Monitor for leftover Windsurf processes.
- You restarted the Mac and opened Windsurf first.
- You ran the
lsofcheck with the port from your own error. - You reinstalled the correct build for your chip.
- You tested once with VPN and security tools paused.
Don't confuse it with these errors
The same threads mention two other errors that look similar but are different problems:
- "Language server failed - too many open files" was reported on Linux, not on a Mac.
- "Unknown: Model provider is currently unavailable (error ID: …)" was reported with GPT-5.2. The wording points to the model provider's side, so retrying later or picking a different model is a better test than the fixes above.
If nothing works
Report it through Windsurf's own site or support, since the old Codeium tracker is archived. Windsurf's changelog also says the product is now called Devin Desktop, so look for that name too. Include:
- your macOS version and chip (Apple menu, About This Mac)
- the Windsurf version shown in the app's About window
- the exact error text, with your port
- when it started, for example after which update
- which fixes above you tried, and what the
lsofcheck showed
Subject: Cascade "Restarting server failed" after update (macOS)
After updating Windsurf, Cascade shows:
Restarting server failed Error: connect ECONNREFUSED 127.0.0.1:51557
Mac: (model and chip), macOS (version)
Windsurf version: (from About)
Started: (date, and which update)
Tried: full quit and relaunch, Mac restart, clean reinstall,
VPN/security tools paused. `lsof -nP -iTCP:51557 -sTCP:LISTEN`
printed: (nothing / a process name).
Please advise, or tell me which logs to attach.Common questions
Is port 51557 always the same?
We can't confirm that. The reports we found all quote 51557, but they don't say whether it is fixed or chosen per launch. Run the lsof check with whatever port your own message shows.
Does reinstalling delete my projects or settings?
Replacing the app in Applications doesn't touch your project folders. We can't say what happens to Windsurf's own settings and sign-in, so note anything you rely on before you reinstall.
Is this the same as the Linux "too many open files" error?
No. That error was reported on Linux and points to a file-handle limit. The Mac error is a refused connection to a local port, so a different cause is likely.
Will the fix come from a Windsurf update?
Possibly, but we found no statement from Windsurf either way. Check for a newer version, since a clean reinstall also installs the latest one.