How to Fix "Connection Refused" Errors in OpenClaw
TL;DR - Quick Fix
Use our Local Doctor Tool to auto-diagnose this issue in 30 seconds.
Run Diagnostic NowProblem Description
You're trying to start your OpenClaw agent, but you see one of these errors:
ECONNREFUSED 127.0.0.1:3000Error: connect ECONNREFUSEDConnection refused to localhost:3000
Why This Happens
This is the #1 most common error in OpenClaw setups. It means your client is trying to connect to the agent server, but:
- The agent isn't running
- The agent is running on a different port
- Network interface binding issues (IPv4 vs IPv6)
- Firewall blocking the connection
Solution 1: Quick Fix (Recommended)
Use ClawKit's Local Doctor
Our diagnostic tool automatically checks for this issue and suggests fixes.
Solution 2: Manual Fix
Step 1: Check if the Agent is Running
First, verify your agent is actually running:
docker psYou should see a container named openclaw or similar. If not, start your agent:
docker-compose up -dStep 2: Use 127.0.0.1 Instead of localhost
Node.js v18+ prefers IPv6, which can cause issues. Change your config:
{
"host": "localhost",
"port": 3000
}{
"host": "127.0.0.1",
"port": 3000
}Step 3: Check Firewall Settings
On Windows, ensure port 3000 is allowed:
- Open Windows Defender Firewall
- Click "Advanced settings"
- Add inbound rule for port 3000
Prevention
Avoid this error from the start by using our Config Wizard to generate error-free configs. It automatically:
- Uses
127.0.0.1instead oflocalhost - Validates port numbers
- Checks for common misconfigurations
Related Tools
Seeing Other Errors Too?
Connection issues often come with these related problems:
Last Updated: February 2026 | Time to Fix: 30 seconds (with Local Doctor) or 5-10 minutes (manual)