Systemd Service: Run PocketPaw as a Daemon
Run PocketPaw as a background service on Linux with systemd for automatic startup and restart.
Service File
Create /etc/systemd/system/pocketpaw.service:
[Unit]Description=PocketPaw AI AgentAfter=network.target
[Service]Type=simpleUser=pocketpawGroup=pocketpawWorkingDirectory=/home/pocketpawExecStart=/usr/local/bin/pocketpawRestart=on-failureRestartSec=10
# EnvironmentEnvironmentFile=/etc/pocketpaw/env
# Security hardeningNoNewPrivileges=yesProtectSystem=strictProtectHome=read-onlyReadWritePaths=/home/pocketpaw/.pocketpawPrivateTmp=yes
[Install]WantedBy=multi-user.targetEnvironment File
Create /etc/pocketpaw/env:
POCKETPAW_ANTHROPIC_API_KEY=sk-ant-your-keyPOCKETPAW_DASHBOARD_HOST=127.0.0.1POCKETPAW_DASHBOARD_PORT=8000POCKETPAW_AGENT_BACKEND=claude_agent_sdkPOCKETPAW_TOOL_PROFILE=codingSet permissions:
sudo chmod 600 /etc/pocketpaw/envsudo chown pocketpaw:pocketpaw /etc/pocketpaw/envSetup
# Create dedicated usersudo useradd -m -s /bin/bash pocketpaw
# Install PocketPawsudo -u pocketpaw pip install --user pocketpaw[recommended]
# Create config directorysudo mkdir -p /etc/pocketpawsudo chown pocketpaw:pocketpaw /etc/pocketpaw
# Enable and start servicesudo systemctl daemon-reloadsudo systemctl enable pocketpawsudo systemctl start pocketpawManaging the Service
# Startsudo systemctl start pocketpaw
# Stopsudo systemctl stop pocketpaw
# Restartsudo systemctl restart pocketpaw
# Check statussudo systemctl status pocketpaw
# View logssudo journalctl -u pocketpaw -f
# View recent logssudo journalctl -u pocketpaw --since "1 hour ago"Log Rotation
Systemd handles log rotation via journald. For the audit log, add a logrotate config:
/home/pocketpaw/.pocketpaw/audit.jsonl { weekly rotate 12 compress missingok notifempty copytruncate}Auto-Updates
Create a timer for periodic updates:
[Unit]Description=Update PocketPaw weekly
[Timer]OnCalendar=weeklyPersistent=true
[Install]WantedBy=timers.target[Unit]Description=Update PocketPaw
[Service]Type=oneshotUser=pocketpawExecStart=/usr/local/bin/pip install --upgrade pocketpaw[recommended]ExecStartPost=/bin/systemctl restart pocketpawRelated
Self-Hosting
Reverse proxy, SSL, and production hardening for your PocketPaw server.
Docker Deployment
Run PocketPaw in containers with Docker Compose for easier isolation.
Was this page helpful?