Compose Deployment
The repository ships with a production-ready docker-compose.yml that wires LinkPeek to Postgres and the optional Cloudflared quick tunnel. Use this stack when you need durable storage, automated tunnel restarts, and health checks.
1. Prepare environment variables
Section titled “1. Prepare environment variables”Populate the required secrets before you launch the Compose stack; leave optional integrations blank until you are ready.
cp .env.example .env# Update the following keys:# LINKPEEK_ADMIN_PASSWORD=<strong secret># DATA_DIR=/absolute/path/to/data# POSTGRES_PASSWORD=<random># DBIP_API_KEY=<optional, for geo analytics>Ensure the DATA_DIR directory exists and is writable by Docker.
2. Start the stack
Section titled “2. Start the stack”docker compose up -d --buildThe command builds the Go binary, applies database migrations, and starts:
linkpeekon port9009postgreswith persistent volumelinkpeek_pgdatacloudflared(if enabled) with access to the Docker socket for restarts
3. Verify health
Section titled “3. Verify health”- Run
docker compose psand confirm all services showhealthy. - Tail logs with
docker compose logs -f linkpeek cloudflared. - In the UI, open the Tunnel tile to confirm the hostname and uptime banner update.
4. Maintenance commands
Section titled “4. Maintenance commands”| Task | Command |
|---|---|
| Apply updates | docker compose pull && docker compose up -d --build |
| Rotate admin password | Use the Access panel or update LINKPEEK_ADMIN_PASSWORD and restart. |
| Backup Postgres | docker compose exec postgres pg_dump -U linkpeek > backup.sql |
| Restart Quick Tunnel | Trigger /api/tunnel/restart or run docker compose restart cloudflared |
Keep the .env file out of version control. For production clusters, translate the Compose definitions into your platform equivalents (Kubernetes manifests, Nomad jobs, etc.) while retaining the same environment variables and volume mounts.