Deploying quark on Coolify
quark is a single binary. This repository ships a multi-stage Dockerfile that
Coolify auto-detects: no Nixpacks, no buildpack needed.
Step by step (Coolify)
- Push the repository to GitHub (see the commands in the README / at the end of this doc).
- In Coolify: New Resource → Application → from your GitHub repository.
- Build Pack: Dockerfile (Coolify detects the
Dockerfileat the repo root). - Exposed port:
8080(the container listens on0.0.0.0:8080). - Environment variables:
| var | value | required |
|—|—|—|
|
QUARK_KEY| a randomu64: generate one withopenssl rand -hex 8and convert to decimal, or use any large number. Set it as a secret. | yes (without it quark falls back to a dev key and logs a warning) | |QUARK_ADDR|0.0.0.0:8080| already the image default | |QUARK_DATA|/data| already the image default | |QUARK_STRICT_CLUSTER| any non-empty value (e.g.1) to fail fast unless BOTHQUARK_DATABASE_URLandQUARK_VALKEY_URLare set. Leave unset for single-node. See SCALING. | no (single-node default) | - Persistent storage: add a Persistent Storage / Volume mounted at
/data. This is where LMDB keeps the links; without it, links disappear on every redeploy. - Health check: path
/health(quark responds200 ok). Point Coolify’s HTTP health check at that path on port 8080. - Deploy. Coolify builds the image and brings it up. The domain it gives you already serves the redirects.
Testing after deploy
# create a link (replace <URL> with the domain Coolify gave you)
curl -s -XPOST https://<URL>/ -H 'content-type: application/json' \
-d '{"url":"https://example.com"}'
# -> {"code":"XXXXXXX","url":"https://example.com"}
# follow the redirect
curl -si https://<URL>/XXXXXXX # should respond 302 Location: https://example.com
# health
curl -s https://<URL>/health # -> ok
Operating notes
- One key per instance: changing
QUARK_KEYremaps the entire code space. Keep it stable in production (rotating it invalidates every code already issued) and out of version control. - Backup: just copy the
/datavolume (it’s the whole LMDB database). - Scale: the pure LMDB binary is single-node by design. For multiple replicas, point them all at a shared Postgres (
QUARK_DATABASE_URL) and Valkey (QUARK_VALKEY_URL), and setQUARK_STRICT_CLUSTER=1so a missing dependency fails fast. Seedocs/SCALING.md.