staqlydocs

Configuration reference

Change how staqly runs with environment variables, and look up every setting and its default.

Edit on GitHub

Staqly Community Edition works without any configuration. Come here when you need to change something: a port, the public URL for phones, media storage, OAuth apps, log level or retention. All settings are environment variables; how you pass them depends on how you run staqly.

How to change a setting

Set the variable in the environment of staqly serve. The binary does not read a .env file.

LOG_LEVEL=debug PUBLIC_DASHBOARD_URL=http://192.168.1.23:8080 staqly serve --expose

For a long-running install, put them in your service definition (for systemd: Environment=LOG_LEVEL=debug). See Run the binary.

staqly serve sets a few variables itself, from its flags:

VariableSet by staqly serve to
DATA_DIR--data, else $STAQLY_DATA_DIR, else ~/.local/share/staqly
ADDR127.0.0.1:<--port> (default 3333)
DASHBOARD_ADDR127.0.0.1:<--dashboard-port>, or all interfaces with --expose
PUBLIC_API_URLhttp://localhost:<--port>, unless you set PUBLIC_API_URL
LOG_FORMATtext, unless you set LOG_FORMAT

Setting DATA_DIR, ADDR or DASHBOARD_ADDR yourself has no effect — use the flags.

Invalid values refuse to start instead of falling back silently: staqly exits with a config: <reason> error (see Troubleshooting).

Mode and access

VariableDefaultDescription
STAQLY_MODElocallocal: Staqly Community Edition, one workspace, no limits, every request with the access token, API for this machine only. Leave it unset: the other mode, cloud, runs the hosted Staqly Cloud and is not a supported self-hosting setup. Trimmed and case-insensitive; any other value refuses to start.
STAQLY_LOCAL_TOKEN—Community Edition (local mode): fixes the access token (stk_local_ and at least 32 characters in all) instead of the file DATA_DIR/access_token, which is made on first start (mode 0600). For tests and CI; server token --rotate then refuses. An invalid value refuses to start.
LOCAL_TRUSTED_PEERS, LOCAL_ALLOWED_HOSTS, LOCAL_ALLOWED_ORIGINS—No longer read: they guarded the keyless local mode of earlier versions. The Community Edition now needs the access token for every request; staqly warns at start when one of them is still set.
COOKIE_SECUREfalseMark session cookies Secure. Set true when browsers reach the dashboard only over HTTPS (your own reverse proxy).
TRUST_PROXYfalseTake the client IP from the right-most X-Forwarded-For entry (rate limits, logs). Only behind your own reverse proxy.
LOCAL_USER_NAMEyour login name with the binary (compose passes $USER), else Local (the Docker image without -e LOCAL_USER_NAME="$USER")Community Edition: the name shown for you in the activity log.
SESSION_TTL720hBrowser session lifetime (Go duration).
DASHBOARD_ADDR—Also serve the dashboard from the API process on this address. staqly serve sets it; the Docker image sets :8080.
DASHBOARD_EXPOSEDtrue if DASHBOARD_ADDR is not loopback, else false; true in the Docker imageThe dashboard is open to the network: Connect a device links opened as localhost point at this computer's Wi-Fi address instead. With the binary this follows --expose.

URLs and ports

VariableDefaultDescription
API_PORT3333Compose only: host port for the API (bound to 127.0.0.1). With docker run change the -p mapping and PUBLIC_API_URL; with the binary use --port.
DASHBOARD_PORT8080Dashboard port. Docker: the published host port (set it when you map the dashboard to another host port). Binary: follows --dashboard-port. Also part of sign-in links, such as the #token= link printed at start.
PUBLIC_API_URLhttp://localhost:3333Base of absolute media URLs in API responses and webhook payloads. Set it to what receivers can reach (e.g. http://api:3333 for n8n on the Docker network, or your public URL). The dashboard reads it from the API at runtime, so changing it needs only a restart. With the binary it defaults to http://localhost:<--port>.
PUBLIC_DASHBOARD_URL—Dashboard URL used in Connect a device QR codes, sign-in links and notification links — your LAN IP (http://192.168.1.23:8080) or domain. Without it, QR codes use the address you opened the dashboard at; an exposed staqly serve opened as localhost uses this computer's Wi-Fi address instead, and in Docker the dialog asks for that address once (kept in the browser). connect-link and notification links fall back to localhost.
ADDR127.0.0.1:3333Listen address of the API. The Docker image sets ADDR=:3333 (publish the port on 127.0.0.1 only); staqly serve sets 127.0.0.1:<--port>.

Storage and limits

VariableDefaultDescription
DATA_DIR./data; /data in Docker; ~/.local/share/staqly with the binaryData directory. With the binary use --data or STAQLY_DATA_DIR.
DATABASE_PATH$DATA_DIR/workspace.dbThe SQLite database file.
UPLOAD_DIR$DATA_DIR/uploadsMedia files, with STORAGE_DRIVER=disk.
STORAGE_DRIVERdiskWhere media files live: disk (UPLOAD_DIR) or s3, any S3-compatible bucket (AWS S3, Cloudflare R2, MaxIOFS...). See Media storage.
S3_ENDPOINT, S3_BUCKET, S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEYnoneRequired with STORAGE_DRIVER=s3; the server refuses to start without them.
S3_REGIONus-east-1The bucket's region.
S3_FORCE_PATH_STYLEfalsetrue puts the bucket in the URL path, as MaxIOFS, MinIO and most self-hosted servers need.
S3_PREFIXnoneA folder in the bucket for staqly's files, e.g. staqly/.
S3_PUBLIC_URLnonePublic URL of the bucket (usually a CDN). Platforms that fetch media get links there instead of signed links.
S3_CREATE_BUCKETfalseCreate a missing bucket on start. Otherwise a missing bucket stops the server with a clear message.
MAX_UPLOAD_MB100Maximum upload size.
JOB_CONCURRENCY4Background jobs (publishing, schedule runs, sign-in refreshes) run at once, at most 64; one workspace gets at most half while another waits.
PROCESSING_TIMEOUT1hServer default for how long a target on your own automation may wait for a reported result before it fails with No result reported in time (post.target_failed). A Go duration such as 30m or 6h; 0 turns it off. A collection can set its own value (Fail publishing if nothing is reported within in its settings, processing_timeout_seconds on PATCH /v1/collections/{id}, 1 minute to 24 hours), which wins over this default.

Channels and secrets

VariableDefaultDescription
STAQLY_SECRET_KEY—Seals channel credentials and developer app secrets (AES-256-GCM): 32 bytes, base64-encoded (openssl rand -base64 32). If unset, a key is generated into DATA_DIR/secret.key (mode 0600) on first start. Back it up with the database: without it every channel has to be reconnected. An invalid value refuses to start.
PROVIDER_<ID>_ENABLEDtruefalse turns one platform off on this server: no tile, no connecting, no publishing (e.g. PROVIDER_TIKTOK_ENABLED=false). See Developer apps.
PROVIDER_<ID>_CLIENT_ID, PROVIDER_<ID>_CLIENT_SECRET—The OAuth developer app of one platform, e.g. PROVIDER_X_CLIENT_ID / PROVIDER_X_CLIENT_SECRET. See Developer apps.

Media editor AI

VariableDefaultDescription
AI_DISABLEDfalsetrue turns the media editor's AI tools off for the whole server, whatever key a workspace added.
AI_OPENAI_BASE_URLhttps://api.openai.com/v1The OpenAI-compatible endpoint the AI tools call with the workspace's own key. Change it only for a compatible proxy or tests.

Webhooks and schedule endpoints

VariableDefaultDescription
WEBHOOK_ALLOW_PRIVATEtrueAllow webhook deliveries and schedule endpoint calls to private addresses (LAN, Docker networks, e.g. n8n).
WEBHOOK_ALLOW_LOOPBACKfalseAllow deliveries to 127.0.0.1 / ::1. Useful with the binary when a receiver (e.g. n8n) runs on the same computer.
WEBHOOK_RETRY_BASE15sFirst retry delay; doubles per attempt.
WEBHOOK_RETRY_MAX1hMaximum retry delay.

Alerts

VariableDefaultDescription
NOTIFY_SECRET_KEY—Encrypts alert secrets (bot tokens, SMTP passwords); at least 32 bytes (e.g. openssl rand -hex 32) — shorter values refuse to start. If unset, a key is generated into DATA_DIR/notify_secret.key — back it up with the database.
NOTIFY_ALLOW_PRIVATEfalseAllow alerts to post to LAN addresses (self-hosted ntfy, SMTP relay).
NOTIFY_DISABLED_GRACE24hHow long a disabled alert keeps its queued messages before they are skipped.
NOTIFY_ALLOW_LOOPBACKfalseAllow alerts to post to this machine (127.0.0.1), e.g. a local ntfy.
NOTIFY_MAX_ATTEMPTS5Attempts per message before it is marked failed.
NOTIFY_RETRY_BASE30sFirst retry delay; doubles with every attempt.
NOTIFY_MAX_FAILS10Consecutive failures after which an alert is disabled automatically.
NOTIFY_CONCURRENCY8Alerts sent to in parallel.
NOTIFY_POLL_INTERVAL2sHow often the alert worker checks for due messages.
TELEGRAM_API_BASEhttps://api.telegram.orgBase URL of the Telegram Bot API. Change it only for a self-hosted Bot API server or tests.
SLACK_API_BASEhttps://slack.com/apiBase URL of the Slack Web API. Change it only for tests.
DISCORD_API_BASEhttps://discord.com/api/v10Base URL of the Discord API. Change it only for tests.

compose.yml passes the NOTIFY_* settings through except NOTIFY_ALLOW_LOOPBACK and NOTIFY_POLL_INTERVAL; add those and the TELEGRAM_*, SLACK_* and DISCORD_* ones to the staqly service's environment: first. More in Alerts → Configuration.

Observability

VariableDefaultDescription
LOG_LEVELinfodebug, info, warn or error. Anything else refuses to start.
LOG_FORMATjson; text with the binaryjson (one object per line on stdout) or text. See Logs & tracing.
METRICS_TOKEN—Bearer token for /metrics from outside this machine (e.g. Prometheus in Docker).
SENTRY_DSN—Send errors (5xx, panics, failing workers) to Sentry. Off when empty. See Logs & tracing.
SENTRY_ENVIRONMENTproductionSentry environment name.
RATE_LIMIT_DISABLEDfalseTurn off rate limits.
RATE_LIMIT_PER_MINUTE10Sensitive unauthenticated endpoints, per IP. RATE_LIMIT_BURST defaults to the same value.

See Monitoring.

Retention

VariableDefaultDescription
RETENTION_DELIVERIES_DAYS30Delete finished webhook deliveries after N days (0 = keep).
RETENTION_EVENTS_DAYS0Delete events older than N days (0 = keep forever).
RETENTION_NOTIFICATIONS_DAYS30Delete finished alert outbox rows after N days (0 = keep).
RETENTION_AGENTS_DAYS30Remove agents and API connections (Integrations) not seen for N days; they come back when they talk again (0 = keep).

See Data export & privacy.

Containers and images

With docker run, the image tag, memory and process limits are part of the command (ghcr.io/staqly/staqly:v0.2.0, --memory 640m, --pids-limit 256); see Run with Docker. These variables are read by the Compose files of a checkout (Develop with Docker Compose):

VariableDefaultDescription
STAQLY_VERSIONlatestTag of the pre-built image ghcr.io/staqly/staqly that make up pulls: latest or a release such as v0.2.0. Pin one to stay on it.
STAQLY_MEM_LIMIT640mMemory limit of the staqly container (API_MEM_LIMIT, its older name, still works).
STAQLY_PIDS_LIMIT256Process limit of the staqly container (API_PIDS_LIMIT, its older name, still works).
API_INTERNAL_URLhttp://localhost:3333Development only: where pnpm --filter @staqly/platform dev proxies /api/*. The staqly image serves the dashboard from the same process and does not need it.
MAILPIT_PORT8025Development stack only (make dev): host port of the mailpit inbox. See Docker Compose.
MAXIOFS_PORT, MAXIOFS_CONSOLE_PORT9000, 9001Development stack only: host ports of the MaxIOFS S3 API and its web console.

Install script

Read by scripts/install.sh (the curl -fsSL https://raw.githubusercontent.com/staqly/staqly/main/scripts/install.sh | sh installer), not by staqly itself:

VariableDefaultDescription
STAQLY_VERSIONlatest releaseRelease tag to install, e.g. v0.2.0.
STAQLY_INSTALL_DIR~/.local/binWhere to put the staqly binary.

Tools and scripts

VariableUsed byDescription
STAQLY_DATA_DIRstaqly serveData directory when --data isn't given.
STAQLY_API_KEYstaqly CLI, the SDKs, scripts/seed.sh, integrations/n8n/setup-demo.shThe access token, or a Staqly Cloud API key.
STAQLY_ENDPOINT_SECRETyour own schedule endpointNot read by staqly: the secret your service verifies requests with.
STAQLY_API_URLstaqly CLI, scripts/seed.sh, setup-demo.shAPI base URL (default http://localhost:3333).
STAQLY_CONTAINERscripts/backup.sh, scripts/restore.shContainer name (default staqly).
STAQLY_VOLUMEscripts/backup.sh, scripts/restore.shData volume (default staqly_staqly-data).
FORCE=1scripts/restore.sh (make restore)Skip the confirmation prompt.
STAQLY_PROFILE, STAQLY_CONFIG, NO_COLORstaqly CLIProfile, config file and colours of the CLI. See CLI.

Next steps

On this page