Quickstart with Docker

Introduction

This guide will help you get the Hasura GraphQL engine and Postgres running as Docker containers using Docker Compose. This is the easiest way to set up Hasura GraphQL engine on your local environment.

In case you’d like to run Hasura on an existing Postgres database, follow this guide to deploy the Hasura GraphQL engine as a standalone docker container and connect it to your Postgres instance.

Prerequisites

Step 1: Get the docker-compose file

The hasura/graphql-engine/install-manifests repo contains all installation manifests required to deploy Hasura anywhere. Get the docker compose file from there:

# in a new directory run
wget https://raw.githubusercontent.com/hasura/graphql-engine/stable/install-manifests/docker-compose/docker-compose.yaml
# or run
curl https://raw.githubusercontent.com/hasura/graphql-engine/stable/install-manifests/docker-compose/docker-compose.yaml -o docker-compose.yml

Step 2: Run Hasura GraphQL engine & Postgres

$ docker-compose up -d

Check if the containers are running:

$ docker ps

CONTAINER ID IMAGE                 ... CREATED STATUS PORTS          ...
097f58433a2b hasura/graphql-engine ... 1m ago  Up 1m  8080->8080/tcp ...
b0b1aac0508d postgres              ... 1m ago  Up 1m  5432/tcp       ...

Step 3: Open the Hasura console

Head to http://localhost:8080/console to open the Hasura console.

Step 4: Try Hasura out

Make your first graphql query or set up your first event trigger

You can also check out our 30-Minute Hasura Basics Course and other GraphQL & Hasura Courses for a more detailed introduction to Hasura.

Advanced

This was a quickstart guide to get the Hasura GraphQL engine up and running quickly. For more detailed instructions on deploying using Docker with an external database, check out Run Hasura GraphQL engine using Docker.