Linux · Connection Refused

Linux Error Code ECONNREFUSED (111)

The remote host actively refused the connection.

errorLast verified 2026-11-08Linux man-pages: errno(3)
Quick answer

The remote host actively refused the connection.

CodeECONNREFUSED (111)
ProductLinux
Company / originLinux community · International open source
CategoryOperating Systems
Platform / versionsLinux kernel 4.x and later · Architecture-dependent errno numbering
Severityerror
Official sourceLinux man-pages: errno(3) ↗
Last verified2026-11-08

What does Linux error ECONNREFUSED (111) mean?

ECONNREFUSED (errno 111) means the TCP connection reached the host but no process was listening on the port, or a firewall rejected it. It is different from a timeout, where no response arrives at all.

Common causes

  • The service is not running or is listening on a different port.
  • A firewall or security group is rejecting the connection.
  • The client is connecting to the wrong host or interface.

How to fix it

  1. Step 1

    Check that the service is running and listening on the expected address.

  2. Step 2

    Test the port locally with ss and remotely with nc or curl.

  3. Step 3

    Review firewall rules and security groups for the source and destination.

When to escalate

Before you escalate: If an errno persists after checking permissions, paths, mounts, and resource limits, collect the command, the full error, strace output around the failing syscall, and the kernel version, then contact the application or distribution maintainer.

Related codes

CodeNameWhat it means
EADDRINUSE (98)Address Already in UseThe network address or port is already bound.
EACCES (13)Permission DeniedThe process does not have permission to access the file or directory.
EBUSY (16)Device or Resource BusyThe resource is busy and cannot be used or released.
EEXIST (17)File ExistsThe file or directory already exists.
EINVAL (22)Invalid ArgumentA system call or library function received an invalid argument.

Source & verification

This page was checked against Linux man-pages: errno(3) on 2026-11-08. The code, product, and platform fields are kept separate from the explanation so corrections can be made without changing the URL.

Open Error Codes is independent and not affiliated with Linux community. Always confirm destructive or security-sensitive steps with the official documentation.