Back to templates
Hasura icon

Deploy Hasura on Sealos

Hasura GraphQL Engine with managed PostgreSQL metadata storage and the official Data Connector Agent.

Tools
Deploy Hasura in a few clicks from the Sealos App Store.Run a self-hosted open-source service on Kubernetes-backed infrastructure.Get automatic HTTPS, routing, and resource management from Sealos.Avoid manual YAML while keeping control of the deployed workload.

Why deploy on Sealos

Sealos makes deploying any app effortless, secure, and production-ready. From one-click launch to ongoing operations, we handle the heavy lifting so you can focus on what matters.

One-Click Deploy
Sealos logo
Compute
Networking
Storage
Security
Observability
Your Application is Live

One-Click Deployment

Deploy any app template in seconds. No compose setup, manual configure, and go live.

Managed Kubernetes Reliability

Built on Sealos Managed Kubernetes for high availability, auto-scaling, and self-healing by default.

Automatic HTTPS & Security

Every deployment includes a secure domain with automatic SSL. We handle certificates and text protection for you.

Persistent Storage

Attach persistent volumes with ease. Your data stays safe, durable, and always accessible.

Scale when needed

Adjust resources as your app grows, no downtime required.

You Get the Whole Stack

Sealos provisions and connects every resource your application needs. Everything is ready to use.

One-click, fully provisionedSecure by defaultProduction ready

App Service

Your application is running and ready to serve requests.

Public HTTPS URL

Secure, global endpoint to access your application.

Database

Managed database instance for your application.

Persistent Volume

Durable storage for uploads and application data.

Environment Variables

Configuration and secrets injected securely into your app.

Logs & Metrics

Centralized logs and basic metrics are enabled.

README

README.md

Deploy and Host Hasura on Sealos

Hasura turns PostgreSQL data into a GraphQL API with a browser-based Console for schema, metadata, permissions, and queries. This template deploys Hasura GraphQL Engine 2.49.5, the matching Data Connector Agent, and managed PostgreSQL 16.4 on Sealos Cloud.

Hasura Console on Sealos

About Hosting Hasura

Hasura builds a GraphQL schema from tracked database objects and stores its configuration as metadata. Teams can use the Console or metadata API to manage tables, relationships, permissions, actions, events, and remote schemas.

The Sealos template creates a public HTTPS endpoint for GraphQL Engine and keeps PostgreSQL plus the Data Connector Agent on the private cluster network. A fresh deployment automatically registers the managed PostgreSQL database as the default source.

Common Use Cases

  • Application Backends: Expose PostgreSQL tables through a typed GraphQL API.
  • Internal Data APIs: Give dashboards and internal tools a governed data layer.
  • API Prototyping: Create and query a schema quickly from the Hasura Console.
  • Event-Driven Workflows: Connect database changes to webhooks and asynchronous processing.
  • Composable Data Access: Add supported external systems through Hasura Data Connectors.

Dependencies for Hasura Hosting

The template includes every runtime component required for a fresh deployment.

Deployment Dependencies

Implementation Details

Architecture Components:

  • GraphQL Engine 2.49.5: One replica serving the Console and GraphQL API on port 8080.
  • Data Connector Agent 2.49.5: One private replica serving connector endpoints on port 8081.
  • Managed PostgreSQL 16.4: One KubeBlocks replica with a 1 GiB persistent volume.
  • HTTPS Ingress: A Sealos-managed public domain and TLS certificate for GraphQL Engine.

GraphQL Engine waits for the PostgreSQL TCP endpoint before starting. Startup, readiness, and liveness probes cover both application workloads. PostgreSQL credentials come from the KubeBlocks-managed connection Secret, and Kubernetes environment expansion builds the metadata and application database URLs.

The live-tested starter limits are 100m/256Mi for GraphQL Engine, 100m/256Mi for the Data Connector Agent, and 500m/512Mi for PostgreSQL. The database source is registered from HASURA_GRAPHQL_DATABASE_URL, while HASURA_GRAPHQL_METADATA_DATABASE_URL keeps Hasura metadata in the same managed cluster.

Hasura GraphQL Engine is licensed under the Apache License 2.0.

Why Deploy Hasura on Sealos?

  • One-Click Stack: Create Hasura, PostgreSQL, networking, storage, and health checks from one template.
  • Automatic Data Source: Open the Console with the managed PostgreSQL source ready to use.
  • Required Admin Authentication: Set the Console and API admin secret during deployment.
  • Persistent Metadata: Keep Hasura metadata and application tables across pod restarts.
  • Automatic HTTPS: Receive a public domain and TLS certificate through Sealos.
  • Kubernetes Operations: Inspect logs, health, resources, and storage from Sealos Canvas.

Deployment Guide

  1. Open the Hasura template and click Deploy Now.
  2. Enter a strong, unique value for admin_secret and store it in a password manager.
  3. Click Deploy and wait for PostgreSQL, GraphQL Engine, and the Data Connector Agent to become Ready.
  4. Open the Hasura application entry shown in Sealos.

Initial PostgreSQL provisioning usually takes a few minutes. The GraphQL Engine startup gate waits for the database during this period.

Sign In to Hasura Console

  1. Open the generated application URL. The root path redirects to /console.
  2. Enter the same admin_secret value used in the deployment dialog.
  3. Select Remember on the browser on a trusted device when persistent browser access is useful.
  4. Open Data and confirm that the default PostgreSQL source appears.

Hasura uses the shared admin secret for Console and administrative API access. Anyone holding this value receives full administrator privileges.

For API requests, send the secret in the x-hasura-admin-secret header:

curl "https://<your-domain>/v1/graphql" \
  -H "content-type: application/json" \
  -H "x-hasura-admin-secret: <your-admin-secret>" \
  --data '{"query":"query { __typename }"}'

Create and Query a Table

  1. Open Data, expand default, and select the public schema.
  2. Click Create Table, define the columns and primary key, then create the table.
  3. Open Insert Row and add a record.
  4. Open API and query the tracked table from GraphiQL.

The SQL page can also create database objects. Enable Track this when the new table should join the GraphQL schema immediately.

Configuration

NameRequiredDescription
admin_secretYesShared secret for Hasura Console login and administrative API requests.

Important routes:

RoutePurpose
/consoleHasura Console login and administration
/v1/graphqlGraphQL API
/v1/metadataMetadata API
/healthzPublic health endpoint used by Kubernetes probes

Development mode is enabled for the starter deployment. Production environments should set HASURA_GRAPHQL_DEV_MODE=false after completing setup and configure CORS, JWT, webhook, or role permissions for their authentication model.

Persistence and Scaling

PostgreSQL stores Hasura metadata and application tables on its persistent volume. Back up this volume before database migrations or major version upgrades.

The starter topology uses one replica for GraphQL Engine, one Data Connector Agent replica, and one PostgreSQL replica. Increase CPU and memory in Sealos Canvas as query volume grows. A multi-replica or high-availability architecture requires the corresponding database, metadata, and workload design from the Hasura and PostgreSQL operations guides.

Troubleshooting

Console rejects the admin secret

Use the exact admin_secret value entered during deployment. Browser password managers and copied whitespace can change the submitted value.

GraphQL Engine remains in initialization

Check the PostgreSQL Cluster status and the wait-for-postgresql init container in Sealos Canvas. GraphQL Engine starts after the managed database accepts TCP connections.

An API request returns 401

Add the x-hasura-admin-secret header and confirm that its value matches the deployment input.

The default database source disappears after customization

Preserve HASURA_GRAPHQL_DATABASE_URL, HASURA_GRAPHQL_METADATA_DATABASE_URL, and PG_DATABASE_URL when editing the Deployment environment. These values are assembled from the KubeBlocks connection Secret.

Data Connector Agent remains unready

Review its startup probe and logs in Sealos Canvas. The validated starter memory limit is 256Mi; a 128Mi limit causes an out-of-memory startup failure.

Getting Help

License

This Sealos template follows the licensing terms of the templates repository. Hasura GraphQL Engine is distributed under the Apache License 2.0.

Related templates

Explore more production-ready templates.

More