Installing OpenClaw on the server
Most of this is identical to the local Linux install in chapter 2, with three additions: systemd, a reverse proxy, and a strict secrets file.
1. Repeat the Linux install
Use chapter 2's recipe under your claw user. Confirm openclaw start runs interactively before going further.
2. systemd unit
[Unit]
Description=OpenClaw VPS agent
After=network-online.target
[Service]
Type=simple
User=claw
WorkingDirectory=/home/claw/openclaw
EnvironmentFile=/home/claw/openclaw/.env
ExecStart=/home/claw/.nvm/versions/node/v20.x.x/bin/openclaw start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
3. Reverse proxy with Caddy
Caddy is dead simple and gives you HTTPS for free.
agent.your-domain.com {
reverse_proxy 127.0.0.1:7777
encode zstd gzip
log
}
OpenClaw never listens on a public port directly. Caddy fronts it; UFW (next chapter) blocks everything else.
4. Strict secrets file
chmod 600 /home/claw/openclaw/.env
chown claw:claw /home/claw/openclaw/.env
5. First boot
sudo systemctl daemon-reload
sudo systemctl enable --now openclaw
journalctl -u openclaw -f
Verify
https://agent.your-domain.com/healthreturns 200journalctl -u openclawshows a clean start- Telegram bot responds to
/start
You now have a real digital employee. Next chapter we lock the door behind it.