---
title: "Safari can’t connect to the server on Mac: causes and fixes · Kilobat Guides"
url: "https://kilobat.app/guides/safari-cant-connect-to-server.html"
description: "Safari found the address of a site but could not connect to the server. Find whether the server, a firewall, a VPN or the IPv6 path is the cause."
---

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.

Applies to: Safari on macOS 13 Ventura and later. The text was checked on macOS 27.2. · Checked: 29 October 2026

## 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 `localhost` address, your own server must run. See [Port already in use on a Mac](https://kilobat.app/guides/port-already-in-use.html).
- **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

1. Open the same address on another device on the same network. If it fails there too, the problem is the network or the server.
2. Test the port from Terminal, with a 5-second timeout.

   ```
   nc -vz -G 5 example.com 443
   ```
3. Request the page and show each step of the connection.

   ```
   curl -v -o /dev/null https://example.com
   ```
4. Try IPv4 only, then IPv6 only. If only IPv6 fails, read [IPv6 problems on a Mac](https://kilobat.app/guides/ipv6-problems-mac.html).

   ```
   curl -4 -I https://example.com
   curl -6 -I https://example.com
   ```
5. For a local address, see if a server listens on the port.

   ```
   lsof -nP -iTCP:3000 -sTCP:LISTEN
   ```

## How to fix it

1. Reload the page after some minutes. A busy server can come back.
2. For a local server, start it. Then use the port that it prints.
3. If a VPN, proxy or security app is on, turn it off for a short test. Turn it on again after the test.
4. If only IPv6 fails, fix IPv6 or report it to your provider. See [IPv6 problems on a Mac](https://kilobat.app/guides/ipv6-problems-mac.html).
5. If a company network blocks the site, ask the administrator.

## With Kilobat

1. 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.com
   ```
2. Show DNS, connect, TLS and first-byte times for one URL.

   ```
   kilobat http-check https://example.com
   ```
3. These Kilobat checks are free. AI agents run them through MCP with `diagnose_connection` and `diagnose_network`. See [Find why one site or API won't connect](https://kilobat.app/guides/recipes/why-cant-it-connect.html).

## 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)](https://developer.apple.com/documentation/foundation/urlerror/code/cannotconnecttohost)
- [Apple Support: If Safari doesn't work as expected on Mac](https://support.apple.com/en-us/102564)
- 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.

## Related guides

- [Safari can’t find the server on a Mac](https://kilobat.app/guides/safari-cant-find-server.html): “Safari can’t find the server” usually means that the Mac could not get an address for the site name.
- [Port already in use on a Mac](https://kilobat.app/guides/port-already-in-use.html): Only one process can listen on a TCP port and address.
- [IPv6 problems on a Mac](https://kilobat.app/guides/ipv6-problems-mac.html): Most networks give a Mac both IPv4 and IPv6 addresses.
- [A website works on your phone but not on your Mac](https://kilobat.app/guides/site-works-on-phone-not-mac.html): When a site opens on your phone but not on your Mac, the problem is usually on the Mac.
- [Find why one site or API won't connect](https://kilobat.app/guides/recipes/why-cant-it-connect.html): When the internet works but one address fails, Kilobat checks each layer in turn.
