-
-
Notifications
You must be signed in to change notification settings - Fork 2
Config Hasura
Hasura GraphQL Engine is the primary API layer in every ɳSelf stack. It sits in front of PostgreSQL and exposes an auto-generated GraphQL API, handles JWT-based authorization, and supports remote schemas for federating external GraphQL services. This page covers every HASURA_* environment variable, explains how JWT secrets are constructed, and describes how to access the Hasura Console.
All Hasura configuration is driven by HASURA_* variables in your .env files. Required variables must be set before nself start, the CLI will refuse to start if they are missing.
| Variable | Type | Default | Required | Description |
|---|---|---|---|---|
HASURA_VERSION |
string | v2.44.0 |
No | Docker image tag for the Hasura container |
HASURA_GRAPHQL_ADMIN_SECRET |
string | (none) | Yes | Admin API secret (minimum 32 characters). Required to access the Hasura Console and the admin API endpoint. |
HASURA_JWT_KEY |
string | (none) | Yes | JWT signing key (minimum 32 characters). Used to verify tokens issued by the Auth service. |
HASURA_JWT_TYPE |
string | HS256 |
No | JWT algorithm. Supported values: HS256, RS256, and other algorithms supported by Hasura. |
HASURA_GRAPHQL_JWT_SECRET |
JSON | auto-computed | No | Full JWT secret JSON object passed to Hasura. Auto-built from HASURA_JWT_KEY and HASURA_JWT_TYPE. Do not set this manually , see JWT Configuration below. |
HASURA_GRAPHQL_ENABLE_CONSOLE |
bool |
true (dev) / false (prod) |
No | Enable the Hasura web console. Should be disabled in production. |
HASURA_GRAPHQL_DEV_MODE |
bool |
true (dev) / false (prod) |
No | Developer mode. When enabled, Hasura returns detailed error messages including internal query details. Disable in production. |
HASURA_DEV_MODE |
bool | (alias) | No | Backward-compatible alias for HASURA_GRAPHQL_DEV_MODE. Both variables are recognised; HASURA_GRAPHQL_DEV_MODE takes precedence if both are set. |
HASURA_GRAPHQL_ENABLE_TELEMETRY |
bool | false |
No | Hasura telemetry reporting. Always off by default in ɳSelf projects. |
HASURA_GRAPHQL_CORS_DOMAIN |
string |
http://localhost:* (dev) |
No | Allowed CORS origins. Use a comma-separated list of exact origins in production , wildcards are not safe in production. |
HASURA_GRAPHQL_UNAUTHORIZED_ROLE |
string | public |
No | The Hasura role assigned to unauthenticated requests. |
HASURA_GRAPHQL_LOG_LEVEL |
string | warn |
No | Hasura log verbosity. Valid values: debug, info, warn, error. |
HASURA_PORT |
int | 8080 |
No | Internal container port for the Hasura HTTP service. |
HASURA_CONSOLE_PORT |
int | 9695 |
No | Port used by the hasura-cli console proxy (dev mode only). |
HASURA_ROUTE |
string | api |
No | Nginx subdomain prefix. With BASE_DOMAIN=example.com, Hasura is exposed at api.example.com. |
HASURA_MEM_LIMIT |
string | 1g |
No | Docker memory limit for the Hasura container. |
HASURA_CPU_LIMIT |
string | 1.0 |
No | Docker CPU quota for the Hasura container. |
HASURA_GRAPHQL_ADMIN_SECRET is the master credential for your Hasura instance. It grants unrestricted access to all data, metadata, and the Hasura Console. Treat it like a database root password.
Requirements:
- Minimum 32 characters
- Must be set before the stack starts, ɳSelf will not start without it
- Use a randomly generated value; do not reuse the same secret across projects or environments
Where to set it:
# .env.secrets (production — gitignored)
HASURA_GRAPHQL_ADMIN_SECRET=your-randomly-generated-secret-here
# .env.local (personal dev override — gitignored)
HASURA_GRAPHQL_ADMIN_SECRET=your-dev-secret-hereNever put the admin secret in .env.dev, that file is committed to version control and shared with your team.
Hasura verifies JWT tokens using a JSON configuration object passed as HASURA_GRAPHQL_JWT_SECRET. Rather than making you write this JSON yourself, ɳSelf builds it automatically from two simpler variables:
| Input variable | Example value |
|---|---|
HASURA_JWT_KEY |
my-super-secret-signing-key-32chars |
HASURA_JWT_TYPE |
HS256 |
ɳSelf computes and injects the following into Hasura at startup:
{
"type": "HS256",
"key": "my-super-secret-signing-key-32chars"
}This value is assigned to HASURA_GRAPHQL_JWT_SECRET automatically. You do not need to set HASURA_GRAPHQL_JWT_SECRET yourself, setting HASURA_JWT_KEY and HASURA_JWT_TYPE is sufficient.
The JWT key must match the Auth service. ɳSelf configures the Auth service to sign tokens with the same HASURA_JWT_KEY. If you ever rotate this key, you must restart both services and all existing sessions will be invalidated.
Algorithm selection:
| Algorithm | Use case |
|---|---|
HS256 |
Default. Symmetric HMAC , the same key signs and verifies. Simplest to configure. |
RS256 |
Asymmetric RSA. Use this when the signing service (Auth) and the verifying service (Hasura) are owned by different parties, or when you need to publish the public key. |
For most self-hosted ɳSelf projects, HS256 with a strong random key is the right choice.
Remote schemas let you federate external GraphQL services into your Hasura API. ɳSelf supports up to 20 remote schema slots, numbered 1 through 20.
Each slot uses three variables:
| Variable | Description |
|---|---|
REMOTE_SCHEMA_N_NAME |
Schema name as it appears in Hasura (e.g., payments) |
REMOTE_SCHEMA_N_URL |
GraphQL endpoint URL (e.g., https://payments.example.com/graphql) |
REMOTE_SCHEMA_N_HEADERS |
Request headers in key:value,key:value format (e.g., Authorization:Bearer secret) |
Replace N with a slot number from 1 to 20.
# .env.dev
REMOTE_SCHEMA_1_NAME=payments
REMOTE_SCHEMA_1_URL=https://payments.example.com/graphql
REMOTE_SCHEMA_1_HEADERS=Authorization:Bearer my-payments-token
REMOTE_SCHEMA_2_NAME=search
REMOTE_SCHEMA_2_URL=https://search.example.com/graphql
REMOTE_SCHEMA_2_HEADERS=ɳSelf reads all REMOTE_SCHEMA_N_* variables at startup and registers them with Hasura via the metadata API. You do not need to configure remote schemas inside the Hasura Console manually, they are declared in your env files and applied automatically on every nself start.
Slots with no REMOTE_SCHEMA_N_NAME set are silently skipped.
The table above lists the HASURA_GRAPHQL_* variables ɳSelf builds into a curated compose value (admin secret, JWT secret, console/dev-mode toggles, CORS, log level). Beyond that curated set, every other HASURA_GRAPHQL_* variable you set in any .env file is forwarded verbatim into the Hasura container at nself build time — you do not need to add support for it first.
This covers real Hasura engine config surface that ɳSelf does not wrap in its own typed setting, for example:
# .env.dev — allow-list mode and engine limits
HASURA_GRAPHQL_ENABLE_ALLOWLIST=true
HASURA_GRAPHQL_NODE_LIMIT=5000
HASURA_GRAPHQL_DEPTH_LIMIT=10
HASURA_GRAPHQL_BATCH_SIZE=10
HASURA_GRAPHQL_LIVE_QUERIES_MULTIPLEXED_BATCH_SIZE=100
HASURA_GRAPHQL_LIVE_QUERIES_MULTIPLEXED_REFETCH_INTERVAL=1000Rules:
- The forward is additive only. If a variable is already curated by ɳSelf (
HASURA_GRAPHQL_ADMIN_SECRET,_JWT_SECRET,_ENABLE_CONSOLE,_DEV_MODE,_ENABLE_TELEMETRY,_CORS_DOMAIN,_LOG_LEVEL,_UNAUTHORIZED_ROLE,_DATABASE_URL), your.envvalue is ignored for that key — use the dedicated variable (or theHASURA_JWT_KEY/HASURA_JWT_TYPEpair for JWT) instead, so it goes through validation. - Everything else in the
HASURA_GRAPHQL_*namespace reaches the container untouched — no allow-list of names to keep in sync in the CLI itself. - Run
nself build(ornself restart) after adding or changing one of these vars so the regenerated compose picks it up. - The same additive-forwarding rule applies to hasura-auth's own
AUTH_*/HASURA_AUTH_*namespace — see Config-Auth.
The Hasura Console is a web UI for browsing your schema, running GraphQL queries, managing metadata, and configuring permissions.
nself urlsThis prints all service URLs for your current stack, including the Hasura Console URL. The console is typically available at:
https://api.<BASE_DOMAIN>/console
For local development this is usually http://localhost:8080/console (direct) or via your Nginx proxy if configured.
When the console loads it will prompt for the admin secret. Enter the value from HASURA_GRAPHQL_ADMIN_SECRET.
| Environment | Default state | Variable |
|---|---|---|
| Development | Enabled | HASURA_GRAPHQL_ENABLE_CONSOLE=true |
| Production | Disabled | HASURA_GRAPHQL_ENABLE_CONSOLE=false |
Always disable the console in production. Leaving it enabled exposes your schema and metadata to anyone who can reach the URL.
Before going live, verify the following Hasura settings:
-
HASURA_GRAPHQL_ADMIN_SECRETis at least 32 characters and randomly generated -
HASURA_JWT_KEYis at least 32 characters and randomly generated -
HASURA_GRAPHQL_ENABLE_CONSOLE=false -
HASURA_GRAPHQL_DEV_MODE=false -
HASURA_GRAPHQL_ENABLE_TELEMETRY=false -
HASURA_GRAPHQL_CORS_DOMAINlists only exact origins, no wildcards - Neither secret appears in any committed file (
.env.dev,.env.prod, etc.)
Run nself config validate --env prod to catch common mistakes before deploying.
← Config-Postgres | Configuration | Config-Auth →
ɳSelf CLI v1.0.9. MIT licensed. Docs CC BY 4.0.
GitHub · Issues · Discussions · nself.org · nself.org/docs
Getting Started
Commands
- Commands, Overview
- Lifecycle: cmd-init · cmd-build · cmd-start · cmd-stop · cmd-restart · cmd-dev
- Monitoring: cmd-status · cmd-logs · cmd-health · cmd-urls · cmd-doctor · cmd-monitor · cmd-alerts · cmd-sentry · cmd-watchdog
- Data: cmd-db · cmd-backup · cmd-dr · cmd-queue · cmd-webhooks
- Config: cmd-config · cmd-service · cmd-env · cmd-promote
- Networking: cmd-ssl · cmd-trust · cmd-dns-setup
- Security: cmd-access · cmd-security · cmd-secrets
- Tenancy: cmd-tenant · cmd-billing
- Plugins: cmd-plugin · cmd-license · cmd-dogfood (extracted, CLI-R11) · cmd-k8s (extracted, CLI-R11) · cmd-encryption (extracted, CLI-R11) · cmd-waf (extracted, CLI-R11) · cmd-federation (extracted, CLI-R11) · cmd-mail (extracted, CLI-R11) · cmd-dlq (extracted, CLI-R11)
- AI: cmd-ai · cmd-claw · cmd-model
- Templates: cmd-template
- Utilities: cmd-exec · cmd-clean · cmd-reset · cmd-update · cmd-upgrade · cmd-version · cmd-admin · cmd-migrate · cmd-migrate-firebase · cmd-migrate-supabase · cmd-completion
Features
- Features, Overview
- Feature-Auth
- Feature-Storage
- Feature-Search
- Feature-Functions
- Feature-Email
- Feature-Monitoring
- Feature-Plugins
- Feature-nClaw, AI Assistant
- Feature-nChat, Messaging
- Feature-nTV, Media Player
- Feature-nFamily, Family Social
- Feature-nCloud, Managed Hosting
- Feature-Memory-Rooms, Knowledge Organization
- Feature-Agent-Dashboard, Agent Metrics
- Feature-Image-Generation, AI Image Generation
Configuration
- Configuration, Overview
- Config-Env-Vars
- Config-Postgres
- Config-Hasura
- Config-Auth
- Config-Nginx
- Config-Optional-Services
- Config-Custom-Services
- Config-System
Plugins (87 + 10 monitoring)
Free (25)
- plugin-backup
- plugin-content-acquisition
- plugin-content-progress
- plugin-cron
- plugin-donorbox
- plugin-feature-flags
- plugin-github
- plugin-github-runner
- plugin-invitations
- plugin-jobs
- plugin-link-preview
- plugin-mdns
- plugin-mlflow
- plugin-monitoring
- plugin-notifications
- plugin-notify
- plugin-paypal
- plugin-search
- plugin-shopify
- plugin-stripe
- plugin-subtitle-manager
- plugin-tokens
- plugin-torrent-manager
- plugin-vpn
- plugin-webhooks
Pro (62)
- plugin-access-controls
- plugin-activity-feed
- plugin-admin-api
- plugin-nself-ai-gateway
- plugin-nself-ai-mcp
- plugin-nself-ai-mcp
- plugin-analytics
- plugin-auth
- plugin-backup-pro
- plugin-bots
- plugin-browser
- plugin-calendar
- plugin-cdn
- plugin-chat
- plugin-claw
- plugin-claw-budget
- plugin-claw-news
- plugin-claw-web
- plugin-cloudflare
- plugin-cms
- plugin-compliance
- plugin-cron-pro
- plugin-ddns
- plugin-devices
- plugin-documents
- plugin-donorbox-pro
- plugin-entitlements
- plugin-epg
- plugin-file-processing
- plugin-game-metadata
- plugin-geocoding
- plugin-geolocation
- plugin-google
- plugin-home
- plugin-idme
- plugin-knowledge-base
- plugin-linkedin
- plugin-livekit
- plugin-media-processing
- plugin-meetings
- plugin-moderation
- plugin-mux
- plugin-notify-pro
- plugin-object-storage
- plugin-observability
- plugin-paypal-pro
- plugin-photos
- plugin-podcast
- plugin-post
- plugin-realtime
- plugin-recording
- plugin-retro-gaming
- plugin-rom-discovery
- plugin-shopify-pro
- plugin-social
- plugin-sports
- plugin-stream-gateway
- plugin-streaming
- plugin-stripe-pro
- plugin-support
- plugin-tmdb
- plugin-voice
- plugin-web3
- plugin-workflows
Planned (26)
plugin-auditplugin-blogplugin-checkoutplugin-commerceplugin-drmplugin-exportplugin-flowplugin-importplugin-ldapplugin-mailgunplugin-mediaplugin-oauth-providersplugin-pagesplugin-postmarkplugin-rate-limitplugin-reportsplugin-samlplugin-schedulerplugin-sendgridplugin-ssoplugin-subscriptionplugin-thumbplugin-transcoderplugin-twilioplugin-wafplugin-watermark
Guides
- Guide-Production-Deployment
- Guide-SSL-Setup
- Guide-Multi-Tenancy
- Guide-Security-Hardening
- Guide-Monitoring-Setup
- Guide-Backup-Restore
- Guide-Custom-Services
- Guide-Migration-from-v1
Architecture
Reference
- API-Reference
- error-codes, Error Codes
Licensing
Security
Brand
Operations
- operations/release-cascade, Release Cascade
- operations/self-healing, Self-Healing Schema
- operations/redis-tuning, Redis Pool Tuning
- operations/meilisearch-warmup, MeiliSearch Warm-Up
- operations/jwt-rotation, JWT Key Rotation
- operations/windows-wsl2-setup, Windows / WSL2 Setup
- operations/gemini-oauth-reauth, Gemini OAuth Reauth
Contributing
Admin
- USER-ACTION-QUEUE, Pending Admin Actions
All commands (52)
- A: cmd-access · cmd-account · cmd-admin
- B: cmd-backup · cmd-build · cmd-bundle
- C: cmd-ci · cmd-clean · cmd-completion · cmd-config
- D: cmd-db · cmd-deploy · cmd-dev · cmd-doctor
- E: cmd-env · cmd-exec
- F: cmd-functions
- G: cmd-generate
- H: cmd-health · cmd-help-topics
- I: cmd-init · cmd-install
- L: cmd-license · cmd-login · cmd-logout · cmd-logs
- M: cmd-man · cmd-mcp · cmd-migrate
- O: cmd-oauth · cmd-ops
- P: cmd-plugin · cmd-promote
- R: cmd-remove · cmd-reset · cmd-restart · cmd-runner
- S: cmd-secrets · cmd-security · cmd-self-heal · cmd-server · cmd-service · cmd-start · cmd-status · cmd-stop
- T: cmd-telemetry · cmd-template · cmd-trust
- U: cmd-update · cmd-urls
- V: cmd-verify-sbom · cmd-version