Error Codes Wiki

Linux Error ECONNREFUSED (errno 111) Fix

Criticallinux errno

About Linux Error ECONNREFUSED (errno 111) Fix

Linux errno 111 ECONNREFUSED means the connection was refused. The target service is not listening. This guide covers everything you need to know about this topic, including common causes, step-by-step solutions, and answers to frequently asked questions.

Here are the key things to understand: Error: ECONNREFUSED (errno 111). Message: Connection refused. No service is listening on the target port. The host is reachable but the port is closed. Understanding these fundamentals will help you diagnose and resolve this issue more effectively.

The most common reasons this occurs include: Service is not running. Service is listening on a different port. Firewall blocking the connection. Service crashed and needs restart. Identifying the root cause is the first step toward finding the right solution.

To resolve this, follow these recommended steps: Check if service is running: systemctl status service-name. Verify listening port: ss -tlnp | grep PORT. Check firewall rules: sudo iptables -L or sudo ufw status. Restart the service: sudo systemctl restart service-name. If these steps do not resolve the issue, consider consulting additional resources or a qualified professional.

This article is part of our Linux Error Codes collection on Error Codes Wiki. We provide comprehensive, up-to-date information to help you find solutions quickly.

Quick Answer

ECONNREFUSED vs ETIMEDOUT?

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

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.