Self-hosting

Run SurveyGIS on your own server with Docker Compose: required services, every server setting, e-mail and SMS providers, backups and upgrades.

What you need

PostgreSQL with PostGIS, the API server, the web app and object storage (a local directory or any S3-compatible store). Redis and the separate conversion worker are optional for larger installations.

Start with the Docker Compose quick start in the repository, set the settings below, and put a TLS-terminating proxy in front of the web app.

Settings

All settings are environment variables. Secrets (database passwords, the session secret, provider keys and license keys) belong in your secret store, never in version control.

Server settings
VariableDefaultPurpose
Core server settings
SVYCORE_DATABASE_URLPostgreSQL/PostGIS connection for the application role (required).
SVYCORE_MIGRATE_DATABASE_URLSVYCORE_DATABASE_URLConnection used to run schema migrations (owner role).
SVYCORE_JWT_SECRETSigning secret for sessions, at least 32 bytes (required). Keep it out of version control.
SVYCORE_HTTP_ADDR:8080Address the API listens on.
SVYCORE_PUBLIC_URLhttp://localhost:8080External URL of the API, used in links and SSO callbacks.
SVYCORE_WEB_URLExternal URL of the web app, used in invitation and notification e-mails.
SVYCORE_DEPLOYMENTself-hostself-host or saas.
SVYCORE_REGISTRATIONfirst-user (self-host)Who may sign up: open, first-user or invite.
SVYCORE_DEMO_EMAILEnables the public "Try the demo" sign-in for this account. Seed it with `svycore-server demo seed`; the API refuses the sign-in unless the account is a viewer everywhere. Leave empty to disable.
SVYCORE_PAYMENTSoffon|off. Master switch for the response-pack checkout (SaaS edition only). Off mounts no billing routes at all; on needs a Razorpay key pair for self-serve checkout, or offers the manual-invoice path without one.
SVYCORE_RAZORPAY_KEY_IDPublishable Razorpay key. With the key secret, enables self-serve checkout for response packs; empty leaves billing in manual-invoice mode (the checkout endpoints answer 503).
SVYCORE_RAZORPAY_KEY_SECRETRazorpay secret, used server-side to create orders and verify checkout signatures. Keep it in your secret store.
SVYCORE_RAZORPAY_WEBHOOK_SECRETVerifies X-Razorpay-Signature on POST /billing/webhooks/razorpay, so captures that never reach the browser still land.
SVYCORE_RAZORPAY_BASE_URLhttps://api.razorpay.comProvider API base URL (tests point it at a stub).
SVYCORE_BILLING_GSTINSeller GSTIN printed on tax invoices. Frozen into each invoice at capture time, so setting it later only affects future invoices.
SVYCORE_BILLING_ADDRESSSeller address block printed on tax invoices (multi-line).
SVYCORE_BILLING_STATE_CODESeller state code (place of supply note on the invoice).
SVYCORE_TURNSTILE_SITE_KEYCloudflare Turnstile site key. With the secret, puts a human check on the anonymous fill link; the fill-link response then carries `captcha_site_key` and the API verifies each `captcha_token` before storing a response. Set both keys or neither — the API refuses to start with one. Empty leaves the per-address rate limit as the only guard.
SVYCORE_TURNSTILE_SECRETTurnstile secret, used server-side against Cloudflare\'s siteverify endpoint. Never send this to the browser. Keep it in your secret store.
SVYCORE_TURNSTILE_VERIFY_URLhttps://challenges.cloudflare.com/turnstile/v0/siteverifyOverride for the siteverify endpoint: a test double, or a proxy where Cloudflare is unreachable.
SVYCORE_CORS_ORIGINSComma-separated browser origins allowed to call the API directly.
SVYCORE_TRUSTED_PROXIESComma-separated CIDRs, addresses or dns:<name> entries whose X-Forwarded-For is trusted. Leave empty when the API is not behind a proxy.
SVYCORE_ACCESS_TTL15mLifetime of access tokens.
SVYCORE_REFRESH_TTL720hLifetime of refresh tokens (30 days).
SVYCORE_SIGNED_URL_TTL15mLifetime of signed media and export download links.
Rate limit settings
SVYCORE_AUTH_RATE_LIMITserver defaultCredential attempts (sign-in, sign-up, codes, two-step, SSO) per client address and per account, as N/duration (e.g. 10/1m) or off.
SVYCORE_SESSION_RATE_LIMITserver defaultSession refresh and sign-out per client address, as N/duration or off.
SVYCORE_OTP_SEND_RATE_LIMIT5/1hOne-time codes sent to one e-mail address or phone number, as N/duration or off.
Storage and queue settings
SVYCORE_STORAGE_DRIVERlocallocal or s3 (any S3-compatible object store).
SVYCORE_STORAGE_DIR./data/objectsDirectory for the local driver.
SVYCORE_S3_BUCKETBucket for the s3 driver (required for s3).
SVYCORE_S3_REGIONus-east-1Region of the bucket.
SVYCORE_S3_ENDPOINTEndpoint for non-AWS object stores.
SVYCORE_S3_ACCESS_KEYAccess key for the bucket.
SVYCORE_S3_SECRET_KEYSecret key for the bucket.
SVYCORE_S3_PATH_STYLEtrueUse path-style bucket addressing.
SVYCORE_QUEUE_DRIVERinlineinline (single process) or redis (separate worker).
SVYCORE_REDIS_ADDRlocalhost:6379Redis address for the redis queue.
SVYCORE_WORKER_HEARTBEAT/tmp/svycore-worker.aliveFile the worker touches so health checks can see it is alive.
Import and export (GDAL) settings
SVYCORE_OGR2OGRogr2ogrPath to ogr2ogr when conversions run in-process.
SVYCORE_GDAL_SANDBOXbwrap in release buildsbwrap or none: sandbox for in-process conversions.
SVYCORE_GDAL_URLURL of the separate conversion worker; empty runs conversions in-process.
SVYCORE_GDAL_TOKENShared token between API and conversion worker, at least 32 characters.
SVYCORE_GDAL_LISTEN:8090Address the conversion worker listens on.
SVYCORE_GDAL_TMPDIRsystem tempScratch directory of the conversion worker.
SVYCORE_GDAL_MAX_BYTESLargest upload the conversion worker accepts, in bytes.
E-mail and SMS settings
SVYCORE_SMTP_ADDRSMTP server host:port for invitations, sign-in codes and notifications.
SVYCORE_SMTP_FROMSender address for e-mail.
SVYCORE_SMTP_USERNAMESMTP user name, if the server needs one.
SVYCORE_SMTP_PASSWORDSMTP password, if the server needs one.
SVYCORE_RESEND_API_KEYResend API key, as an alternative to SMTP (do not configure both). Set together with the Resend sender address.
SVYCORE_RESEND_FROMSender address for e-mail sent through Resend, on a verified domain.
SVYCORE_RESEND_BASE_URLResend APIOverride the Resend endpoint (testing).
SVYCORE_MSG91_AUTH_KEYMSG91 key for SMS sign-in codes and phone invitations (+91). Set together with the template id.
SVYCORE_MSG91_TEMPLATE_IDMSG91 OTP template id.
SVYCORE_MSG91_BASE_URLMSG91 APIOverride the MSG91 endpoint (testing).
SVYCORE_MESSAGING_LOGfalseDevelopment only: write e-mail and SMS to the log instead of sending. Ignored in release builds.
SVYCORE_OTP_LOG_CODESfalseDevelopment only: log one-time codes. Ignored in release builds.
Privacy and audit settings
SVYCORE_RETENTION_INACTIVEreportAccounts idle for three years: report, erase (after a 48-hour notice) or off.
SVYCORE_RETENTION_INTERVAL24hHow often the retention job runs (at least 1m; 0 disables).
SVYCORE_AUDIT_ANCHOR_INTERVAL24hHow often each organisation's audit-log head hash is exported to object storage (at least 1m; 0 disables).
Teams, trials and webhooks
SVYCORE_TRIAL_SWEEP6hHow often lapsed trial teams are flipped to past due (at least 1m; 0 disables). Also runs once at startup.
SVYCORE_SALES_EMAILbrand supportEmailWhere plan requests go when SVYCORE_PAYMENTS is off. The request is stored first, then mailed; the API reports notified:false if the mail could not be handed over.
SVYCORE_WEBHOOK_SWEEP30sHow often queued webhook deliveries are sent (at least 1s; 0 pauses delivery — events stay queued).
License settings
SVYCORE_LICENSE_KEYLicense key text (or use the key file).
SVYCORE_LICENSE_KEY_FILEPath to the license key file.
SVYCORE_LICENSE_STATE_DIR./data/licenseDirectory for license state.
SVYCORE_LICENSE_INTERVAL15mHow often the license is re-checked (clamped to 1–15 minutes).
SVYCORE_LICENSE_CLOCK_TOLERANCE10mAllowed clock skew (clamped to 1–10 minutes).
SVYCORE_LICENSE_ONLINE_URLOptional online license check endpoint.
SVYCORE_INSTANCE_IDStable id of this installation for online checks.
SVYCORE_LICENSE_HOST_ROOT/Development only: host root for machine binding. Ignored in release builds.
Web app settings
SVYCORE_API_URLhttp://localhost:8080Where the web server reaches the API.
SVYCORE_SITE_URLhttp://localhost:3000Public URL of the web app: canonical links, sitemap and same-origin checks. Set it when a proxy rewrites the Host header.

E-mail and SMS

Invitations, sign-in codes and notifications are sent through SMTP and, for Indian mobile numbers, MSG91. Without a provider those features stay off; in development the messaging log writes messages to the server log instead.

Upgrades and backups

Migrations run automatically on start-up. Back up the database and object storage before upgrading; see the upgrade and release notes in the repository.