If OpenClaw is stuck, respawning, or ignoring your kill commands, you’re not alone. The key detail: OpenClaw runs a parent process that supervises the gateway. Kill only the child and it comes right back.
⚠️ Disclaimer
This guide includes terminal commands that stop running processes. These instructions are provided as-is and run at your own risk. OpenClaw builds and commands can change over time, so what worked for me may not work for everyone. Make sure you understand each command before running it, and take responsibility for any impact on your system.
⚠️ Why It Won’t Stop
The OpenClaw parent process respawns the openclaw-gateway child. You must stop the parent first or it will immediately restart the gateway.
Step 1: Check If OpenClaw Is Running
Optional port check:
Step 2: Identify Parent and Child PIDs
Pick a PID and locate the parent:
Step 3: Correct Manual Shutdown
Kill the parent first, then clean up any children:
Confirm it’s fully stopped:
Step 4: Use the Kill Script (Recommended)
Create a one-command kill script so you never hunt for PIDs again:
Paste the script:
Enable and run it:
Step 5: Restart OpenClaw
If you launch OpenClaw manually, start it with:
If you run the gateway as a service, use the built-in restart command:
Optional status check:
Step 6: Manual Start (When OpenClaw Won't Restart)
Sometimes OpenClaw won't start automatically. In this case, you'll need to start it manually and trigger a session spawn.
⚠️ Important
This is a temporary workaround. After triggering the session, you'll need to kill the manually-started processes and let OpenClaw run normally.
Start OpenClaw Manually
Launch the gateway with these flags:
Leave this running in the terminal.
Trigger Session Spawn
Open a new SSH session to your VPS and run:
This will show the terminal UI and trigger OpenClaw to spawn a new session on its own.
Identify Processes
Check which OpenClaw processes are running:
You may see multiple sessions like:
Kill Manual Processes
Kill the first two processes (manually started), but leave the last one running:
Note: Replace the PIDs with your actual process IDs from the previous step.
Verify Only One Process Remains
Confirm only the auto-spawned gateway is running:
Expected output (single process):
✅ Success
OpenClaw is now running normally with the auto-spawned gateway process.
Step 7: Verify After Restart
✅ Golden Rule
If OpenClaw respawns, you didn’t kill the parent.
Want More OpenClaw Troubleshooting?
Join Vibe Coding Academy for step-by-step guides, real-world fixes, and a community of builders shipping with AI.
Join the AcademyKey Takeaways
- OpenClaw is supervised by a parent process — kill the parent first
- Use
pgrepandpsto identify PIDs quickly - Automate shutdown with a kill script
- Restart using
openclaw tuiand verify port 18789