Deploy Hasura GraphQL Engine | (Just Updated) Instant GraphQL API on Postgres, Admin Secret Generated

Instant GraphQL API on Postgres. Admin secret generated.

Deploy Hasura GraphQL Engine | (Just Updated) Instant GraphQL API on Postgres, Admin Secret Generated

Just deployed

/var/lib/postgresql

Deploy and Host Hasura GraphQL Engine on Railway

Hasura GraphQL Engine turns a Postgres database into an instant GraphQL API with permissions, subscriptions and an admin console. This template deploys it together with its own Postgres database, with the admin secret and database password generated for you.

About Hosting Hasura

The template starts two services: hasura (the engine, public HTTPS domain) and postgres (private, on a persistent volume). The engine connects to Postgres over Railway's private network using a generated password, and the admin secret is generated per deploy, so nothing has to be filled in before you click Deploy. Hasura stores its metadata in the same Postgres database.

Machine-readable contract:

public_url:     https://${RAILWAY_PUBLIC_DOMAIN of service hasura}
internal_url:   http://hasura.railway.internal:8080
graphql:        POST /v1/graphql
sql:            POST /v2/query
console:        /console
health:         GET /healthz  (200 when ready)
credentials:    HASURA_GRAPHQL_ADMIN_SECRET (service hasura), POSTGRES_PASSWORD (service postgres)
database_url:   HASURA_GRAPHQL_DATABASE_URL (service hasura)
port:           8080 (HTTP)

Working check, run it after the deploy turns green:

curl -s -X POST https:///v1/graphql \
  -H 'content-type: application/json' \
  -H "x-hasura-admin-secret: $HASURA_GRAPHQL_ADMIN_SECRET" \
  -d '{"query":"{ __typename }"}'
# {"data":{"__typename":"query_root"}}

A request without the admin secret is rejected with access-denied. Open /console and enter the admin secret to create tables and permissions. Data lives on a volume mounted at /var/lib/postgresql, so it survives redeploys.

Why Deploy Hasura on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Hasura on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

  • GraphQL engine and Postgres in one click
  • Admin secret and database password generated automatically
  • Data kept on a persistent volume
  • Image pinned by digest, so redeploys do not change versions

Common Use Cases

  • Instant GraphQL API over a new or existing Postgres schema
  • Backend for web and mobile apps with row-level permissions
  • Data API for AI agents that need a typed, authenticated query surface
  • Real-time subscriptions for dashboards and live feeds

Dependencies for Hasura Hosting

Deployment Dependencies

Implementation Details

The start command is wrapped in /bin/sh -c and enables the console and binds all interfaces before running graphql-engine serve. The engine runs as the community edition with no license. Rotate the admin secret by editing HASURA_GRAPHQL_ADMIN_SECRET on the hasura service and redeploying.


Template Content

More templates in this category

View Template
Rocky Linux
Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
49
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
71
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
51