Skip to content
MtrXTools

curl: (7) Failed to connect

The connection was refused or unreachable

Seen in curl

curl resolved the name but could not open a TCP connection to the port.

Common causes

  • Nothing is listening on that port (connection refused).
  • A firewall rejects the connection.
  • The host is down or unreachable.

How to fix it

  1. Check the service is running and listening on the expected port and interface.
  2. Check security groups and firewalls allow the port.
  3. Test the port from outside your network.
Check the port from outside

Got a different message? Paste it into the error explainer.

Related errors

All 34 Command line & code errors