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.
| Variable | Default | Purpose |
|---|---|---|
| Core server settings | ||
SVYCORE_DATABASE_URL | PostgreSQL/PostGIS connection for the application role (required). | |
SVYCORE_MIGRATE_DATABASE_URL | SVYCORE_DATABASE_URL | Connection used to run schema migrations (owner role). |
SVYCORE_JWT_SECRET | Signing secret for sessions, at least 32 bytes (required). Keep it out of version control. | |
SVYCORE_HTTP_ADDR | :8080 | Address the API listens on. |
SVYCORE_PUBLIC_URL | http://localhost:8080 | External URL of the API, used in links and SSO callbacks. |
SVYCORE_WEB_URL | External URL of the web app, used in invitation and notification e-mails. | |
SVYCORE_DEPLOYMENT | self-host | self-host or saas. |
SVYCORE_REGISTRATION | first-user (self-host) | Who may sign up: open, first-user or invite. |
SVYCORE_DEMO_EMAIL | Enables 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_PAYMENTS | off | on|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_ID | Publishable 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_SECRET | Razorpay secret, used server-side to create orders and verify checkout signatures. Keep it in your secret store. | |
SVYCORE_RAZORPAY_WEBHOOK_SECRET | Verifies X-Razorpay-Signature on POST /billing/webhooks/razorpay, so captures that never reach the browser still land. | |
SVYCORE_RAZORPAY_BASE_URL | https://api.razorpay.com | Provider API base URL (tests point it at a stub). |
SVYCORE_BILLING_GSTIN | Seller GSTIN printed on tax invoices. Frozen into each invoice at capture time, so setting it later only affects future invoices. | |
SVYCORE_BILLING_ADDRESS | Seller address block printed on tax invoices (multi-line). | |
SVYCORE_BILLING_STATE_CODE | Seller state code (place of supply note on the invoice). | |
SVYCORE_TURNSTILE_SITE_KEY | Cloudflare 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_SECRET | Turnstile secret, used server-side against Cloudflare\'s siteverify endpoint. Never send this to the browser. Keep it in your secret store. | |
SVYCORE_TURNSTILE_VERIFY_URL | https://challenges.cloudflare.com/turnstile/v0/siteverify | Override for the siteverify endpoint: a test double, or a proxy where Cloudflare is unreachable. |
SVYCORE_CORS_ORIGINS | Comma-separated browser origins allowed to call the API directly. | |
SVYCORE_TRUSTED_PROXIES | Comma-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_TTL | 15m | Lifetime of access tokens. |
SVYCORE_REFRESH_TTL | 720h | Lifetime of refresh tokens (30 days). |
SVYCORE_SIGNED_URL_TTL | 15m | Lifetime of signed media and export download links. |
| Rate limit settings | ||
SVYCORE_AUTH_RATE_LIMIT | server default | Credential 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_LIMIT | server default | Session refresh and sign-out per client address, as N/duration or off. |
SVYCORE_OTP_SEND_RATE_LIMIT | 5/1h | One-time codes sent to one e-mail address or phone number, as N/duration or off. |
| Storage and queue settings | ||
SVYCORE_STORAGE_DRIVER | local | local or s3 (any S3-compatible object store). |
SVYCORE_STORAGE_DIR | ./data/objects | Directory for the local driver. |
SVYCORE_S3_BUCKET | Bucket for the s3 driver (required for s3). | |
SVYCORE_S3_REGION | us-east-1 | Region of the bucket. |
SVYCORE_S3_ENDPOINT | Endpoint for non-AWS object stores. | |
SVYCORE_S3_ACCESS_KEY | Access key for the bucket. | |
SVYCORE_S3_SECRET_KEY | Secret key for the bucket. | |
SVYCORE_S3_PATH_STYLE | true | Use path-style bucket addressing. |
SVYCORE_QUEUE_DRIVER | inline | inline (single process) or redis (separate worker). |
SVYCORE_REDIS_ADDR | localhost:6379 | Redis address for the redis queue. |
SVYCORE_WORKER_HEARTBEAT | /tmp/svycore-worker.alive | File the worker touches so health checks can see it is alive. |
| Import and export (GDAL) settings | ||
SVYCORE_OGR2OGR | ogr2ogr | Path to ogr2ogr when conversions run in-process. |
SVYCORE_GDAL_SANDBOX | bwrap in release builds | bwrap or none: sandbox for in-process conversions. |
SVYCORE_GDAL_URL | URL of the separate conversion worker; empty runs conversions in-process. | |
SVYCORE_GDAL_TOKEN | Shared token between API and conversion worker, at least 32 characters. | |
SVYCORE_GDAL_LISTEN | :8090 | Address the conversion worker listens on. |
SVYCORE_GDAL_TMPDIR | system temp | Scratch directory of the conversion worker. |
SVYCORE_GDAL_MAX_BYTES | Largest upload the conversion worker accepts, in bytes. | |
| E-mail and SMS settings | ||
SVYCORE_SMTP_ADDR | SMTP server host:port for invitations, sign-in codes and notifications. | |
SVYCORE_SMTP_FROM | Sender address for e-mail. | |
SVYCORE_SMTP_USERNAME | SMTP user name, if the server needs one. | |
SVYCORE_SMTP_PASSWORD | SMTP password, if the server needs one. | |
SVYCORE_RESEND_API_KEY | Resend API key, as an alternative to SMTP (do not configure both). Set together with the Resend sender address. | |
SVYCORE_RESEND_FROM | Sender address for e-mail sent through Resend, on a verified domain. | |
SVYCORE_RESEND_BASE_URL | Resend API | Override the Resend endpoint (testing). |
SVYCORE_MSG91_AUTH_KEY | MSG91 key for SMS sign-in codes and phone invitations (+91). Set together with the template id. | |
SVYCORE_MSG91_TEMPLATE_ID | MSG91 OTP template id. | |
SVYCORE_MSG91_BASE_URL | MSG91 API | Override the MSG91 endpoint (testing). |
SVYCORE_MESSAGING_LOG | false | Development only: write e-mail and SMS to the log instead of sending. Ignored in release builds. |
SVYCORE_OTP_LOG_CODES | false | Development only: log one-time codes. Ignored in release builds. |
| Privacy and audit settings | ||
SVYCORE_RETENTION_INACTIVE | report | Accounts idle for three years: report, erase (after a 48-hour notice) or off. |
SVYCORE_RETENTION_INTERVAL | 24h | How often the retention job runs (at least 1m; 0 disables). |
SVYCORE_AUDIT_ANCHOR_INTERVAL | 24h | How often each organisation's audit-log head hash is exported to object storage (at least 1m; 0 disables). |
| Teams, trials and webhooks | ||
SVYCORE_TRIAL_SWEEP | 6h | How often lapsed trial teams are flipped to past due (at least 1m; 0 disables). Also runs once at startup. |
SVYCORE_SALES_EMAIL | brand supportEmail | Where 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_SWEEP | 30s | How often queued webhook deliveries are sent (at least 1s; 0 pauses delivery — events stay queued). |
| License settings | ||
SVYCORE_LICENSE_KEY | License key text (or use the key file). | |
SVYCORE_LICENSE_KEY_FILE | Path to the license key file. | |
SVYCORE_LICENSE_STATE_DIR | ./data/license | Directory for license state. |
SVYCORE_LICENSE_INTERVAL | 15m | How often the license is re-checked (clamped to 1–15 minutes). |
SVYCORE_LICENSE_CLOCK_TOLERANCE | 10m | Allowed clock skew (clamped to 1–10 minutes). |
SVYCORE_LICENSE_ONLINE_URL | Optional online license check endpoint. | |
SVYCORE_INSTANCE_ID | Stable 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_URL | http://localhost:8080 | Where the web server reaches the API. |
SVYCORE_SITE_URL | http://localhost:3000 | Public 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.