Autostart
Usejarvis supports autostart/background-service installation on:
- Linux via
systemd --user - macOS via
launchd
This page is the manual reference for autostart. If you run the daemon in Docker, use Docker’s own restart policy instead (--restart unless-stopped). Windows has no daemon autostart (the daemon does not run on native Windows); the sidecar has its own start-at-login preference.
The dashboard can show autostart status and restart the service (GET /api/system/autostart, POST /api/system/autostart/restart), and jarvis uninstall removes the service automatically.
Why Use Autostart
Section titled “Why Use Autostart”- You run Usejarvis on your daily machine and want it available after reboot
- You host it on a home server and want it to come back automatically
- You do not want to manually run
jarvis startevery time
Linux: systemd --user
Section titled “Linux: systemd --user”Create this file:
~/.config/systemd/user/jarvis.serviceExample unit. Use absolute paths: a systemd user unit has a minimal PATH, so the ~/.bun/bin/jarvis wrapper (which needs bun on PATH) can fail. Point bun at the CLI entrypoint directly:
[Unit]Description=J.A.R.V.I.S. DaemonAfter=network.target
[Service]Type=simpleExecStart=/home/YOU/.bun/bin/bun /home/YOU/.bun/install/global/node_modules/@usejarvis/brain/bin/jarvis.ts start --foregroundRestart=on-failureRestartSec=5Environment=HOME=%hEnvironment=PATH=%h/.bun/bin:/usr/local/bin:/usr/bin:/bin
[Install]WantedBy=default.target(For a source checkout, point the second argument at your checkout’s bin/jarvis.ts instead.)
Then enable it:
systemctl --user daemon-reloadsystemctl --user enable jarvis.servicesystemctl --user start jarvis.serviceRecommended: keep the service running when you are not logged in:
loginctl enable-linger "$USER"Useful commands:
systemctl --user status jarvis.servicejournalctl --user -u jarvis.service -fWSL2 caveat: this requires a working user systemd manager. On WSL2 without systemd enabled, user services are unreachable; enable systemd in /etc/wsl.conf first.
macOS: launchd
Section titled “macOS: launchd”Create:
~/Library/LaunchAgents/ai.jarvis.daemon.plistExample plist. As on Linux, run bun with the CLI entrypoint, set PATH, and redirect logs so you have something to debug:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict> <key>Label</key> <string>ai.jarvis.daemon</string> <key>ProgramArguments</key> <array> <string>/Users/your-user/.bun/bin/bun</string> <string>/path/to/jarvis/bin/jarvis.ts</string> <string>start</string> <string>--foreground</string> </array> <key>RunAtLoad</key> <true/> <key>KeepAlive</key> <true/> <key>StandardOutPath</key> <string>/Users/your-user/.jarvis/logs/jarvis.log</string> <key>StandardErrorPath</key> <string>/Users/your-user/.jarvis/logs/jarvis-error.log</string> <key>EnvironmentVariables</key> <dict> <key>HOME</key> <string>/Users/your-user</string> <key>PATH</key> <string>/usr/local/bin:/usr/bin:/bin:/Users/your-user/.bun/bin</string> </dict></dict></plist>Then load it (modern macOS prefers bootstrap over the deprecated load):
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.jarvis.daemon.plistRunAtLoad and KeepAlive start it immediately; no separate launchctl start needed. Restart with:
launchctl kickstart -k gui/$(id -u)/ai.jarvis.daemonThe daemon writes to ~/.jarvis/logs/jarvis.log (also viewable with jarvis logs). Check there first if the service starts but the dashboard is unreachable.
Operational Advice
Section titled “Operational Advice”- Make sure your config is valid before enabling autostart: a config file with broken YAML is a fatal startup error
- Verify the dashboard is reachable after reboot
- Check logs first if the service appears to start but the dashboard is unavailable