Run PicoClaw as a systemd service on Linux
For production assistants, you want PicoClaw to survive reboots, crashes, and unattended operation. systemd is the standard way to do that on most Linux servers and on Raspberry Pi OS.
1. Directory layout
Create a working directory (for example /opt/picoclaw) that holds config, optional workspace files, and logs if you redirect them. Keep secrets out of world-readable paths; use chmod and a dedicated service user when possible.
2. Example unit sketch
Your exact ExecStart depends on whether you run the gateway, agent loop, or another subcommand. A minimal pattern:
# /etc/systemd/system/picoclaw.service (adapt ExecStart to your setup)
[Unit]
Description=PicoClaw AI assistant
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
WorkingDirectory=/opt/picoclaw
ExecStart=/usr/local/bin/picoclaw <your-subcommand-and-flags>
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
Reload systemd, enable the unit, then start it:
sudo systemctl daemon-reload
sudo systemctl enable --now picoclaw.service
sudo systemctl status picoclaw.service
3. Logs and debugging
Use journalctl -u picoclaw.service -f to tail logs. If you need log rotation, prefer journald settings or ship logs to your existing stack.
4. Hardening
Consider User=, Group=, NoNewPrivileges=yes, and filesystem protections appropriate to your distro. Pair with firewall rules if the service listens on a port—see Security.
5. Related guides
- Raspberry Pi assistant for ARM install notes.
- Self-hosted assistant for broader architecture.
- Heartbeat for scheduled health and prompts.