Error messages
“Safari can’t connect to the server” on Mac
Safari found the address of the site, but the connection to the server did not open. DNS works. The server or the path to it fails.
Symptoms
- Safari says: “Safari can’t open the page … because Safari can’t connect to the server …”.
- Other sites open.
- The address is a local server, such as
localhost:3000, and the server does not run.
Likely causes
- The server is down or refuses connections. Nothing listens on the port, or the server refuses the connection.
- A local server that is not running. For a
localhostaddress, your own server must run. See Port already in use on a Mac. - A firewall or filter. A firewall, a content filter or a company network can block the port.
- A VPN or proxy. Traffic goes through a VPN or proxy that cannot reach the server.
- A broken IPv6 path. The site has an IPv6 address, but IPv6 does not work on your network.
How to check
Open the same address on another device on the same network. If it fails there too, the problem is the network or the server.
Test the port from Terminal, with a 5-second timeout.
nc -vz -G 5 example.com 443Request the page and show each step of the connection.
curl -v -o /dev/null https://example.comTry IPv4 only, then IPv6 only. If only IPv6 fails, read IPv6 problems on a Mac.
curl -4 -I https://example.com curl -6 -I https://example.comFor a local address, see if a server listens on the port.
lsof -nP -iTCP:3000 -sTCP:LISTEN
How to fix it
Reload the page after some minutes. A busy server can come back.
For a local server, start it. Then use the port that it prints.
If a VPN, proxy or security app is on, turn it off for a short test. Turn it on again after the test.
If only IPv6 fails, fix IPv6 or report it to your provider. See IPv6 problems on a Mac.
If a company network blocks the site, ask the administrator.
With Kilobat
Kilobat's connection doctor tests the site layer by layer: network, proxy, DNS, rules, IPv4, IPv6, TLS and the server. It names the layer that failed.
kilobat why https://example.comShow DNS, connect, TLS and first-byte times for one URL.
kilobat http-check https://example.comThese Kilobat checks are free. AI agents run them through MCP with
diagnose_connectionanddiagnose_network. See Find why one site or API won't connect.
Questions
Why does Safari find the server but not connect?
Finding the server is DNS. Connecting is a separate step. Here DNS worked, and the connection failed.
Sources
- Error text in Safari.framework, macOS 27.2 (Localizable.strings)
- Apple Developer: URLError.Code cannotConnectToHost (-1004)
- Apple Support: If Safari doesn't work as expected on Mac
- nc(1), curl(1) and lsof(8), man page installed with macOS 27.2
Sources checked on 29 October 2026. Man pages are the ones installed with macOS; open one with man <name> in Terminal.