linq is configured entirely through environment variables. In local development, set them in aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/org-quicko/linq/llms.txt
Use this file to discover all available pages before exploring further.
.env file at the repository root (copy from .env.example); in Docker, pass them to the container at runtime. linq validates its configuration at startup and exits with a descriptive error if a required value is missing or invalid — there is no partial boot with a broken config. Every variable except DATABASE_URL has a working default, so a minimal .env for local development needs only one line.
Database
DATABASE_URL
DATABASE_URL
| Type | String (PostgreSQL connection URL) |
| Default | (none — required) |
| Example | postgres://linq:s3cr3t@localhost:5432/linq |
psql or your preferred client. Migrations are applied automatically at boot.If the connection string contains URL-reserved characters in the password (such as @, #, or %), percent-encode those characters.LINQ_DB_SCHEMA
LINQ_DB_SCHEMA
| Type | String |
| Default | public |
| Example | linq |
public schema. Set this when linq shares a database with another application so their tables do not collide. linq creates the schema automatically if it does not already exist.POSTGRES_USER / POSTGRES_PASSWORD / POSTGRES_DB
POSTGRES_USER / POSTGRES_PASSWORD / POSTGRES_DB
| Type | String |
| Default | linq / linq / linq |
| Scope | Docker Compose (bundled-Postgres examples only) |
DATABASE_URL. The Compose file constructs DATABASE_URL from them at container startup.Ports & Paths
LINQ_PORT
LINQ_PORT
| Type | Integer |
| Default | 3000 |
| Example | 4000 |
LINQ_CLIENT_PORT
LINQ_CLIENT_PORT
| Type | Integer |
| Default | 3001 |
| Example | 4001 |
bun run dev:client) and the published host port in the standalone client Docker Compose example. The combined Docker image serves the UI on LINQ_PORT instead and does not use this value at runtime.LINQ_CLIENT_BASE_PATH
LINQ_CLIENT_BASE_PATH
| Type | String (URL path) |
| Default | /home |
| Example | /admin |
/, use lowercase path segments, and have no trailing slash. The root path / is only valid when LINQ_APP_HOST is also set.LINQ_APP_HOST
LINQ_APP_HOST
| Type | String (hostname, optionally with port) |
| Default | (unset) |
| Example | linq.example.com |
LINQ_CLIENT_BASE_PATH to be /. The REST API still answers on every host. This is how you put the UI at https://linq.example.com/ while short links live on https://link.example.com/<slug>.LINQ_APP_HOST must differ from LINQ_DEFAULT_DOMAIN and from every domain row in the database. linq refuses to start — or to create the conflicting domain — if this constraint is violated. Behind a reverse proxy, send both hosts to the same linq port and preserve the Host header so linq can tell them apart. See docs/adr/0019 for the full reasoning.LINQ_DEFAULT_DOMAIN
LINQ_DEFAULT_DOMAIN
| Type | String (host with optional port) |
| Default | localhost:${LINQ_PORT} |
| Example | link.example.com |
domains table is empty. This is a shortening domain — short links read as https://<this host>/<slug>. It is never the app host. If you change this value after the database has been initialised, update the existing domain through the UI; this variable only acts on an empty database.Redirect Cache
linq caches slug-to-destination lookups to avoid a Postgres round-trip on every redirect hit. Every create, update, archive, and purge operation clears its own cache entry immediately; the TTL is a backstop for missed invalidations only.LINQ_CACHE_BACKEND
LINQ_CACHE_BACKEND
| Type | memory | redis | none |
| Default | memory (or redis when LINQ_REDIS_URL is set) |
LINQ_REDIS_URL: a URL present selects redis; nothing at all selects memory.| Value | Behaviour |
|---|---|
memory | In-process LRU. Nothing else to run. Invalidations only reach this process. |
redis | Shared store across all linq processes pointing at the same Redis instance. Invalidations from one process reach all others. |
none | No caching. Every redirect reads Postgres directly. |
LINQ_REDIS_URL
LINQ_REDIS_URL
| Type | String (Redis connection URL) |
| Default | (unset) |
| Example | redis://localhost:6379 |
redis cache backend unless LINQ_CACHE_BACKEND=none is also set. A Redis instance that is unreachable at startup causes linq to exit; one that goes down later degrades transparently to Postgres rather than failing requests.LINQ_CACHE_TTL
LINQ_CACHE_TTL
| Type | Integer (seconds) |
| Default | 300 |
LINQ_CACHE_SWEEP_INTERVAL
LINQ_CACHE_SWEEP_INTERVAL
| Type | Integer (seconds, 1–3600) |
| Default | 60 |
memory backend physically reclaims expired entries. This does not change when an entry expires — expiry on read is still exact — it only controls how often the background sweep frees memory. Redis ignores this setting; use maxmemory in redis.conf for Redis instead.LINQ_CACHE_MAX_ENTRIES
LINQ_CACHE_MAX_ENTRIES
| Type | Integer |
| Default | 10000 |
memory backend holds before evicting the least recently used. This is a count of entries, not bytes — the actual memory footprint depends on destination URL lengths. Redis ignores this setting.Logging
LINQ_DATA_DIR
LINQ_DATA_DIR
| Type | String (directory path) |
| Default | ./data |
| Example | /data |
$LINQ_DATA_DIR/logs/linq.log). In Docker, /data is the volume mount — it is the one thing worth backing up.LINQ_LOG_LEVEL
LINQ_LOG_LEVEL
| Type | trace | debug | info | warn | error | fatal | silent |
| Default | info |
debug level additionally logs request parameters, query keys (never values), and span input/output. Client IP addresses are never logged regardless of level — see docs/adr/0003.LINQ_LOG_FILE
LINQ_LOG_FILE
| Type | String (file path) |
| Default | $LINQ_DATA_DIR/logs/linq.log |
LINQ_LOG_MAX_SIZE
LINQ_LOG_MAX_SIZE
| Type | String (size with unit, e.g. 20m) |
| Default | 20m |
LINQ_LOG_MAX_SIZE × (LINQ_LOG_RETAIN + 1).LINQ_LOG_RETAIN
LINQ_LOG_RETAIN
| Type | Integer |
| Default | 5 |
20m max size and 5 retained files, logs occupy at most 120 MB.Features
LINQ_FETCH_LINK_METADATA
LINQ_FETCH_LINK_METADATA
| Type | Boolean |
| Default | false |
true, linq fetches a link’s destination URL to extract its title, description, and icon for display in the UI and OG previews. Disabled by default because it makes outbound HTTP requests to arbitrary URLs supplied by API callers.LINQ_SLUG_LENGTH
LINQ_SLUG_LENGTH
| Type | Integer |
| Default | 6 |
Rate Limiting
LINQ_API_RATE_LIMIT_PER_MINUTE
LINQ_API_RATE_LIMIT_PER_MINUTE
| Type | Integer |
| Default | (unset — no limit) |
| Example | 1000 |
X-Forwarded-For headers itself.LINQ_VISIT_MAX_PENDING
LINQ_VISIT_MAX_PENDING
| Type | Integer |
| Default | (unset — no limit) |
| Example | 1000 |
Caddy Integration
linq can sync domain routes to a Caddy reverse proxy automatically. When enabled, every domain create, patch, archive, and purge pushes the corresponding route to Caddy — adding a domain in linq is enough to make it resolve over HTTPS without any manual Caddy configuration.LINQ_CADDY_ADMIN_URL
LINQ_CADDY_ADMIN_URL
| Type | String (URL) |
| Default | (unset) |
| Example | http://caddy:2019 |
2019) is never published to the host — only linq reaches it over the internal compose network.LINQ_CADDY_UPSTREAM
LINQ_CADDY_UPSTREAM
| Type | String (host:port) |
| Default | (unset) |
| Example | linq:3000 |
LINQ_CADDY_ADMIN_URL is set. In a Docker Compose stack, this is the linq service name and its container port.Example .env
A realistic configuration for local development with Redis caching and Caddy integration disabled:
LINQ_APP_HOST, and Caddy sync: