ERR_UNSAFE_PORT
The address uses a port Chrome won't send web requests to, because that port belongs to another kind of service and could be abused.
Quick checks
- Is it your own development server? Move it to another port (3000, 5173, 8000, 8080).
- Check the port in the address is the one you meant.
Fixes on Mac
Use a different port
- Restart your server on an allowed port, for example
npm run dev -- --port 5173.
- Restart your server on an allowed port, for example
Allow the port for testing only
- Launch Chrome from Terminal:
open -a "Google Chrome" --args --explicitly-allowed-ports=6000. - Use this only for local testing.
- Launch Chrome from Terminal:
Fixes on Windows
Same options
- Change the port, or start Chrome with
--explicitly-allowed-ports=PORTfor testing.
- Change the port, or start Chrome with
Other devices
Other browsers
- Firefox and Safari block similar port lists, so changing the port is the reliable fix.
Still not working?
Blocked ports include those for FTP, SSH, SMTP and other mail (25, 110, 143, 587, 993…), NFS (2049), SIP (5060), X11 (6000), IRC (6665–6669) and 10080. The list follows the WHATWG Fetch standard's “bad ports”.
See what’s happening
LightAtom's Ports view shows which port your local server listens on, so you can spot one that browsers block.
Frequently asked questions
Why does Chrome block port 6000?
6000 is the X11 display server's port. Letting web pages send requests there could be used to attack local services, so browsers block it.
Which ports does Chrome block?
The “bad ports” in the Fetch standard: dozens of service ports such as 25, 110, 143, 2049, 5060, 6000, 6665–6669 and 10080.
Can I unblock a port permanently?
Only with the --explicitly-allowed-ports flag each time Chrome starts, or with an enterprise policy. Changing the port is simpler.