Deploy Dgraph

Dgraph 25 graph database with Zero, Alpha and token-auth gateway.

Deploy Dgraph

Just deployed

Just deployed

/dgraph

Just deployed

/dgraph

Deploy and Host Dgraph on Railway

Dgraph is a distributed, open-source graph database with a native GraphQL API and its own query language, DQL. It stores data as a graph of nodes and edges, supports full-text, geo and vector indexes, and runs fast traversals and joins, which suits social graphs, knowledge graphs and recommendation engines.

About Hosting Dgraph

This template deploys Dgraph v25.4.1 as a Zero node, which runs cluster coordination, and an Alpha node, which stores and serves data, each with its own Railway volume, plus a Caddy gateway as the public entry point. The gateway requires a bearer token and removes it before forwarding. Schema changes and other admin operations additionally need the Alpha admin token in the X-Dgraph-AuthToken header. Data survived redeploys of both nodes in testing. The gRPC API stays private. Memory use grows with dataset size; start on Hobby and scale up. Back up both volumes regularly.

Common Use Cases

  • Knowledge graphs and recommendation engines with deep traversals
  • A GraphQL backend generated from a schema, without writing resolvers
  • Social graphs, access graphs and fraud detection with DQL

Dependencies for Dgraph Hosting

  • dgraph/dgraph:v25.4.1 (official image) for Zero and Alpha, each with a volume at /dgraph
  • caddy:2.11.4-alpine (official image) as the token gateway

Deployment Dependencies

Implementation Details

ServiceImageNetworkingStorage
zerodgraph/dgraph:v25.4.1private only (5080, 6080)volume at /dgraph
alphadgraph/dgraph:v25.4.1private: HTTP 8080, gRPC 9080volume at /dgraph
gatewaycaddy:2.11.4-alpinepublic domain on 8080none
# GraphQL schema (admin)
curl -X POST "$DGRAPH_URL/admin/schema" -H "Authorization: Bearer $DGRAPH_API_TOKEN" \
  -H "X-Dgraph-AuthToken: $DGRAPH_ADMIN_TOKEN" --data-binary 'type Task { id: ID! title: String! @search(by: [term]) }'
# GraphQL
curl -X POST "$DGRAPH_URL/graphql" -H "Authorization: Bearer $DGRAPH_API_TOKEN" \
  -H "Content-Type: application/json" -d '{"query": "{ queryTask { title } }"}'

Services on Railway can use ${{alpha.DGRAPH_PRIVATE_HTTP}} or gRPC ${{alpha.DGRAPH_PRIVATE_GRPC}} without the gateway token.

VariableServiceDefaultPurpose
DGRAPH_API_TOKENgatewaygeneratedBearer token for all public requests
DGRAPH_ADMIN_TOKENalphageneratedRequired for admin operations

Notes:

  • RDF mutations must put each triple on its own line.
  • Ratel, the old web UI, is not included; use any GraphQL client or the DQL HTTP API.

This is a community-maintained deployment package and does not imply affiliation with or endorsement by the Dgraph project or its maintainers.

Why Deploy Dgraph 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 Dgraph 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.


Template Content

More templates in this category

View Template
Garage S3 Storage
Ultra-light S3 server: fast, open-source, plug-and-play.

PROJETOS
8
View Template
Redis
Self Host Latest Redis with Railway

8
View Template
EasyImg
Simple self-hostable Nuxt.js personal image hosting system.

Muhammad Bilal
0