#Gateway on server requires active SSH connection?
1 messages · Page 1 of 1 (latest)
Are you there?
Yep, I’m here 🦐
What you’re describing usually means the Gateway is tied to your SSH session, or it’s running as a systemd user service without lingering.
If this is a native Linux install, I’d check these first:
openclaw --version
openclaw gateway status
systemctl --user status openclaw-gateway.service
loginctl show-user "$USER" | grep Linger
journalctl --user -u openclaw-gateway.service -n 100 --no-pager
openclaw doctor --non-interactive
Most likely fix:
openclaw gateway install
systemctl --user enable --now openclaw-gateway.service
sudo loginctl enable-linger "$USER"
Why: Linux user services normally stop on logout unless linger is enabled.
If you were starting it manually with openclaw gateway / openclaw gateway run, that would also explain it, because that process dies with the shell.
Docs:
- https://docs.openclaw.ai/start/setup
- https://docs.openclaw.ai/gateway
- https://docs.openclaw.ai/gateway/troubleshooting
If you paste the output of these 3, I can narrow it down fast:
openclaw gateway status
systemctl --user status openclaw-gateway.service
loginctl show-user "$USER" | grep Linger
If this is a Docker/Compose install instead, say that, because then the checks are different.
brianna@brianna-space:~$ openclaw gateway status
🦞 OpenClaw 2026.4.21 (f788c88)
iMessage green bubble energy, but for everyone.
│
◇
Service: systemd (enabled)
File logs: /tmp/openclaw/openclaw-2026-04-23.log
Command: /usr/bin/node /home/brianna/.npm-global/lib/node_modules/openclaw/dist/index.js gateway --port 18789
Service file: ~/.config/systemd/user/openclaw-gateway.service
Service env: OPENCLAW_GATEWAY_PORT=18789
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=18789 (service args)
Probe target: ws://127.0.0.1:18789
Dashboard: http://127.0.0.1:18789/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: running (pid 185549, state active, sub running, last exit 0, reason 0)
Connectivity probe: ok
Capability: read-only
Listening: 127.0.0.1:18789
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
brianna@brianna-space:~$ systemctl --user status openclaw-gateway.service
● openclaw-gateway.service - OpenClaw Gateway (v2026.4.21)
Loaded: loaded (/home/brianna/.config/systemd/user/openclaw-gateway.servic>
Active: active (running) since Thu 2026-04-23 01:39:10 UTC; 4min 55s ago
Main PID: 185549 (openclaw-gatewa)
Tasks: 11 (limit: 9255)
Memory: 453.7M (peak: 715.5M)
CPU: 1min 19.942s
CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/openclaw-g>
└─185549 openclaw-gateway
Apr 23 01:39:56 brianna-space node[185549]: 2026-04-23T01:39:56.602+00:00 [tele>
Apr 23 01:40:08 brianna-space node[185549]: 2026-04-23T01:40:08.879+00:00 [plug>
Apr 23 01:41:39 brianna-space node[185549]: 2026-04-23T01:41:39.095+00:00 [ws] >
Apr 23 01:41:39 brianna-space node[185549]: 2026-04-23T01:41:39.805+00:00 [ws] >
Apr 23 01:41:44 brianna-space node[185549]: 2026-04-23T01:41:44.583+00:00 [ws] >
Apr 23 01:41:44 brianna-space node[185549]: 2026-04-23T01:41:44.589+00:00 [ws] >
Apr 23 01:41:44 brianna-space node[185549]: 2026-04-23T01:41:44.592+00:00 [ws] >
Apr 23 01:41:44 brianna-space node[185549]: 2026-04-23T01:41:44.597+00:00 [ws] >
Apr 23 01:42:02 brianna-space node[185549]: 2026-04-23T01:42:02.841+00:00 [ws] >
Apr 23 01:42:05 brianna-space node[185549]: 2026-04-23T01:42:05.869+00:00 [ws] >
brianna@brianna-space:~$ loginctl show-user "$USER" | grep Linger
Linger=no
How does that look?
Yep, that’s the right direction.
What I’d want to see:
openclaw gateway status→ running and probe reachablesystemctl --user status openclaw-gateway.service→ active (running)loginctl show-user "$USER" | grep Linger→Linger=yes
If you get either of these, that’s probably the bug:
Linger=no→ user service is getting torn down on logoutinactive/failedservice → gateway was never properly installed as a daemon, or it crashed after logout
A good test is:
- SSH in, run:
systemctl --user status openclaw-gateway.service
- Log out
- Wait a minute
- SSH back in, run:
systemctl --user status openclaw-gateway.service journalctl --user -u openclaw-gateway.service -n 100 --no-pager
That’s the nice part of using the service, the logs survive logout, so you do not need to keep the SSH session open to troubleshoot.
If you paste the outputs of these 3, I can read them with you:
openclaw gateway status
systemctl --user status openclaw-gateway.service
loginctl show-user "$USER" | grep Linger
brianna@brianna-space:~$ journalctl --user -u openclaw-gateway.service -n 100 --no-pager
[trimmed lines]
Apr 23 03:51:32 brianna-space systemd[177560]: Stopping openclaw-gateway.service - OpenClaw Gateway (v2026.4.21)...
Apr 23 03:51:32 brianna-space node[185549]: 2026-04-23T03:51:32.228+00:00 [gateway] signal SIGTERM received
Apr 23 03:51:32 brianna-space node[185549]: 2026-04-23T03:51:32.233+00:00 [gateway] received SIGTERM; shutting down
Apr 23 03:51:32 brianna-space node[185549]: 2026-04-23T03:51:32.704+00:00 [gmail-watcher] gmail watcher stopped
Apr 23 03:51:32 brianna-space node[185549]: 2026-04-23T03:51:32.919+00:00 [ws] webchat disconnected code=1012 reason=service restart conn=eccbdeea-ad92-491a-b0b8-49a08a2c8108
Apr 23 03:51:33 brianna-space systemd[177560]: Stopped openclaw-gateway.service - OpenClaw Gateway (v2026.4.21).
Apr 23 03:51:33 brianna-space systemd[177560]: openclaw-gateway.service: Consumed 2min 13.871s CPU time, 715.5M memory peak, 0B memory swap peak.
Apr 23 04:42:35 brianna-space systemd[187313]: Started openclaw-gateway.service - OpenClaw Gateway (v2026.4.21).
Apr 23 04:42:48 brianna-space node[187327]: 2026-04-23T04:42:48.325+00:00 [gateway] loading configuration…
Apr 23 04:42:48 brianna-space node[187327]: 2026-04-23T04:42:48.386+00:00 [gateway] resolving authentication…
Apr 23 04:42:48 brianna-space node[187327]: 2026-04-23T04:42:48.419+00:00 [gateway] starting...
Apr 23 04:42:51 brianna-space node[187327]: 2026-04-23T04:42:51.274+00:00 (node:187327) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
Apr 23 04:42:51 brianna-space node[187327]: (Use `node --trace-deprecation ...` to show where the warning was created)
Yep, that log is actually very helpful, and I’m pretty confident this is not an OpenClaw crash.
The key lines are:
systemd[...] Stopping openclaw-gateway.servicesignal SIGTERM received- later a different
systemd[...]user manager starts it again
That means systemd intentionally shut down the user service, which is exactly what happens when the user session ends and lingering is not enabled.
So the likely fix is:
sudo loginctl enable-linger brianna
systemctl --user enable --now openclaw-gateway.service
loginctl show-user brianna -p Linger
You want that last command to show:
Linger=yes
A couple notes:
- The
DEP0040 punycodewarning is harmless here. gmail watcher stopped/webchat disconnectedare just consequences of shutdown, not the root cause.
If this is an always-on server, the docs also recommend considering a system service instead of a user service:
- https://docs.openclaw.ai/gateway
- https://docs.openclaw.ai/start/setup
- https://docs.openclaw.ai/gateway/troubleshooting
After enabling linger, test like this:
- start/verify the service
systemctl --user status openclaw-gateway.service - log out
- wait a minute
- SSH back in and run
systemctl --user status openclaw-gateway.service journalctl --user -u openclaw-gateway.service -n 50 --no-pager
If Linger already says yes, then I’d next suspect server policy like KillUserProcesses, but right now this really looks like the classic missing-linger case.
If this fixed it, please right-click the solution message → Apps → ✅ Mark Solution so Answer Overflow can index it for the next person.