Docs / Troubleshooting / How to Fix "Connection Refused" Errors

How to Fix "Connection Refused" Errors

By Admin · Feb 25, 2026 · Updated Apr 23, 2026 · 339 views · 1 min read

A "Connection refused" error means the service isn't running or the port is blocked.

1. Check If the Service Is Running

systemctl status nginx
systemctl status mysql
systemctl status sshd

2. Check If the Port Is Listening

ss -tuln | grep :80
ss -tuln | grep :22

3. Check Firewall

ufw status
# or
firewall-cmd --list-all

4. Check Logs

journalctl -u nginx --no-pager -n 50

Common Solutions

  • Start the service: systemctl start nginx
  • Open the firewall port: ufw allow 80/tcp
  • Check the service's bind address (should be 0.0.0.0 not 127.0.0.1 for remote access)

Was this article helpful?