Install with a Coding Agent
Let your coding agent handle binary installation, systemd units, Nginx/Caddy proxying, and deterministic JSON verification in one pass.
Prerequisites
- A coding agent with shell access on the target host (Claude Code, Codex, Antigravity, or Cursor).
- Root or
sudoaccess if installing a systemd unit or editing Nginx/Caddy configs. - Your site's domain name (and hub URL +
agent_tokenif adding an agent).
Recipe 1: Single-VPS standalone install
Use this when quarkd will run on the same server that already serves your website:
Prompt — Standalone VPS
Read https://quarkd.dev/llms.txt and install quarkd in standalone mode on this server. 1. Install the latest binary via scripts/install.sh and run quarkd init --mode standalone --config /etc/quarkd/server.toml. 2. Add my site (domain: example.com) and run quarkd geoip-update. 3. Configure Nginx/Caddy using `quarkd snippet nginx-proxy` (or `caddy-proxy`) so /_q.js and /_q are served first-party. 4. Enable the systemd unit from `quarkd snippet systemd-server`. 5. Run `quarkd --config /etc/quarkd/server.toml doctor --json` and `quarkd test-hit --json`, and show me the outputs.
Recipe 2: Add a web server to an existing hub
Use this to attach an web server (quarkd agent) to a central quarkd server hub while keeping raw visitor IPs on the origin host:
Prompt — Agent
Read https://quarkd.dev/llms.txt and install quarkd in agent mode on this web server. Hub URL: https://analytics.example.com Site ID: mysite (domain: mysite.com) 1. Install the binary via scripts/install.sh and run quarkd init --mode agent --config /etc/quarkd/agent.toml. 2. Configure log tailing and first-party local listener (`listen = "127.0.0.1:8091"`) behind Nginx/Caddy using `quarkd snippet nginx-proxy`. 3. Install the systemd service from `quarkd snippet systemd-agent`. 4. Verify with `quarkd --config /etc/quarkd/agent.toml doctor --json` and `quarkd status --json`.
Recipe 3: Day-2 operations over MCP (zero SSH)
Once your hub is running, connect your agent to POST https://<your-hub>/mcp with Authorization: Bearer <admin_token>. You never need to SSH into the analytics box to add sites, goals, or alerts:
Prompt — Day-2 MCP
Using the quarkd MCP server: 1. Call upsert_site to add "docs" for domain "docs.example.com". 2. Call upsert_goal to track path "/quickstart" as "Quickstart Reached". 3. Call probe_sites to confirm /_q.js is live on every configured domain.
Expected verification checks
A healthy agent install always passes these two JSON checks:
Expected output (quarkd status --json on agent)Output
{
"mode": "agent",
"hub_reachable": true,
"spool_depth": 0,
"version": "0.5.1"
}
Common gotcha — log file permissions: If
quarkd doctor --json reports the Nginx/Caddy access log is unreadable, add the quarkd system user to the adm (Debian/Ubuntu) or www-data group and restart the unit.