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
- Check the service is running and listening on the expected port and interface.
- Check security groups and firewalls allow the port.
- Test the port from outside your network.
Got a different message? Paste it into the error explainer.
Related errors
- wrong version number · TLS spoken to something that isn't TLS
- curl: (52) Empty reply from server · The server closed the connection without replying
- Error: socket hang up · The server closed the connection before replying
- UND_ERR_CONNECT_TIMEOUT · fetch couldn't open a connection in time
- unable to get local issuer certificate · The client can't find the certificate's issuer
- unable to verify the first certificate · The intermediate certificate is missing
- certificate has expired · The server certificate has expired
- self signed certificate in certificate chain · The chain ends in an untrusted root
- curl: (6) Could not resolve host · The hostname doesn't resolve
- curl: (28) Operation timed out · The request timed out
- curl: (51) SSL: no alternative certificate subject name matches target host name · The certificate doesn't match the hostname
- curl: (3) URL using bad/illegal format or missing URL · curl could not parse the URL