Error Codes Wiki

Linux Error ECONNREFUSED (errno 111) Fix

Criticallinux errno

Overview

Linux errno 111 ECONNREFUSED means the connection was refused. The target service is not listening.

Key Details

  • Error: ECONNREFUSED (errno 111)
  • Message: Connection refused
  • No service is listening on the target port
  • The host is reachable but the port is closed

Common Causes

  • Service is not running
  • Service is listening on a different port
  • Firewall blocking the connection
  • Service crashed and needs restart

Steps

  1. 1Check if service is running: systemctl status service-name
  2. 2Verify listening port: ss -tlnp | grep PORT
  3. 3Check firewall rules: sudo iptables -L or sudo ufw status
  4. 4Restart the service: sudo systemctl restart service-name

Tags

linuxlinux-errnolinux errno 111ubuntuterminal

More in Linux Errno

Frequently Asked Questions

ECONNREFUSED means the port is closed (host reachable). ETIMEDOUT means the host is unreachable.