Self-host Hasura on a VPS
An instant GraphQL and REST API on top of Postgres with permissions, subscriptions and an admin console.
levelrail-cli templates install hasura --name my-hasuraSpecification
- Status
- Listed
- Category
- Developer Tools
- Services
- db, hasura
- Ports
- 8080
- Volumes
- 1
- Memory
- about 512 MiB
- arm64
- image published
- amd64
- image published
- Settings to fill in
- none
- License
- Permissive license, Apache-2.0
About Hasura
An instant GraphQL and REST API on top of Postgres with permissions, subscriptions and an admin console.
What it deploys
Hasura runs as 2 services in a single Compose app, listening on port 8080, with 1 named volume mount.
| Service | Image | Tag | Ports | Volumes |
|---|---|---|---|---|
| db | postgres | 16-alpine | none | pgdata -> /var/lib/postgresql/data |
| hasura | hasura/graphql-engine | v2.51.0 | 8080 | none |
Before you install
- CPU architecture. arm64 listed. Every image lists linux/arm64 in its registry manifest. That is a manifest fact, not proof the app runs on Arm.
- Listed. It is in the catalog. Back up the data volume before changing an image tag.
Settings and environment
You do not have to fill in anything. 4 secrets are generated at deploy and stored encrypted. Values are never shown here.
| Service | Variable | Value |
|---|---|---|
| db | POSTGRES_DB | Preset by the template |
| db | POSTGRES_PASSWORD | Generated at deploy |
| db | POSTGRES_USER | Preset by the template |
| hasura | HASURA_GRAPHQL_ADMIN_SECRET | Generated at deploy |
| hasura | HASURA_GRAPHQL_DEV_MODE | Preset by the template |
| hasura | HASURA_GRAPHQL_ENABLED_LOG_TYPES | Preset by the template |
| hasura | HASURA_GRAPHQL_ENABLE_CONSOLE | Preset by the template |
| hasura | HASURA_GRAPHQL_METADATA_DATABASE_URL | Generated at deploy |
| hasura | PG_DATABASE_URL | Generated at deploy |
Install Hasura on a VPS
-
Install Levelrail on a fresh VPS
Run this as root on a Linux server (amd64 or arm64) with ports 80 and 443 reachable. The installer prints a setup link.
curl -fsSL https://levelrail.com/install.sh | sudo sh -
Sign in
Open the setup link, choose a password, then log the CLI in. The CLI install command is
curl -fsSL https://levelrail.com/install-cli.sh | shif the machine does not have it. See Getting started.levelrail-cli login --device -
Read the template
Shows the entry, including its full compose.yaml.
levelrail-cli templates get hasura -
Install it
This template has an install form, so the CLI fills each setting from --env, a generated secret or its default.
levelrail-cli templates install hasura --name my-hasuraTo put a service behind a domain at install, add
--domain SERVICE=HOST:levelrail-cli templates install hasura --name my-hasura --domain db=hasura.example.com
Without a domain the app gets an sslip.io address. You can also deploy it from the dashboard: Apps, New app, Browse templates, then Hasura.
Docs and upstream
More in Developer Tools
- HoppscotchAn open-source API development platform, a self-hosted alternative to Postman, backed by Postgres.
- GotenbergA stateless API for converting HTML, Markdown, Office, and PDF documents in the background.
- ImgCompressAn offline image compression, format conversion, and background-removal API for self-hosted pipelines.
- GogsA painless self-hosted Git service written in Go, light enough to run on a small VPS.
- GoCDA continuous delivery server with pipeline visualisation, running on a data volume. Needs about 1 GB of memory. Authentication is off until you set it up, so restrict access first.
- InbucketDisposable mail server that catches mail for any address and shows it in a web inbox, for testing apps without sending real email.