Installing Hasura on Docker for Desktop

If you have a Mac or a Windows machine, you can install Docker for Mac or Docker for Windows (from Edge channel) to get a Kubernetes cluster. This is a zero-configuration single node Kubernetes cluster.


Kubernetes is only available in Edge releases.

Step 1: Install Docker for Mac/Windows


Install Docker CE for Mac (Edge) from Docker Store.


Install Docker CE for Windows (Edge) from Docker Store.


Requires Microsoft Windows 10 Professional or Enterprise 64-bit

Step 2: Enable Kubernetes

Once Docker for Desktop (Edge) is installed, click the Docker icon on the system tray/panel, goto Preferences and then to the Kubernetes tab. Check the box that says Enable Kubernetes.

Click Apply.

Step 3: Create data directory

Docker for Desktop mounts certain directories from the host on to the Kubernetes node. You can create Hasura data directory in any of these paths. These paths are listed under File Sharing tab in Docker Preferences.

On a Mac, the typical paths are /Users, /private, /Volumes and /tmp. You can add more paths here. These directories directly map to the same paths inside the VM.

Create a directory in any of these paths:

mkdir /Users/hasura-data

Step 4: Install Hasura platform

Now, you can use Hasura CLI to install Hasura platform on this cluster.

hasura cluster install \
  --name=docker-desktop-hasura-cluster \
  --provider=docker-for-desktop \
  --kube-context=docker-for-desktop \
  --data-path=/Users/hasura-data \

This could take around 5 minutes depending on your internet connection bandwidth.


Hasura platform requires a domain associated with a cluster for the subdomain based routing to work. For Docker for Desktop, we are making use of a service called which map domains with IP addresses in them to the given IP. We’ll be creating a Kubernetes ServiceType LoadBalancer and by default it binds on localhost, If you have any other services listening on port 80, 443 and 2022 installation might fail.

Step 4: Add this cluster to a project

Clone a new Hasura project using hasura clone or cd into an existing project. You can then use hasura cluster add command to add this cluster to the project.

hasura cluster add docker-desktop-hasura-cluster \
  -c dfd \

This command will add the cluster called docker-desktop-hasura-cluster (name we used with --name flag earlier in the install command), that can be contacted using the kube context docker-for-desktop, to the current project with an alias dfd.

Step 5: Configure domains in the project

Your current Hasura project is most likely to have the domain configured as "{{ }}" in conf/domains.yaml. This domain will only work for clusters provisioned through Hasura, not for user provisioned ones. Hence, you need to edit this file and change the domain configuration.

Edit conf/domains.yaml to make the following change:

- domain: ""
  ssl: null


SSL will not be available on Docker for Desktop clusters, as there is no public IP. Hence we disable SSL in the domain configuration.

Advanced: Handling multiple clusters in the same project

If you have multiple clusters in the same project, you will need the following template to handle domain configuration for Docker for Desktop as well as Hasura provisioned clusters.

{% if cluster.infra.provider == "docker-for-desktop" %}
- domain: ""
  ssl: null
{% else %}
- domain: "{{ }}"
    type: LetsEncrypt
    conf: {}
{% endif %}

Step 6: Commit and push to the new cluster

Commit the files and push to the newly added Docker for Desktop cluster:

git add clusters.yaml conf/domains.yaml
git commit -m "add new docker for desktop cluster"
git push dfd master

That’s it! Your Hasura project is now deployed on the Docker for Desktop cluster. You can see the microservices and their URLs by executing:

hasura microservices list -c dfd

Tearing down

You can delete all the resources Hasura created by executing the following commands:

kubectl delete namespace hasura
kubectl delete configmap hasura-conf hasura-status ssh-authorized-keys
kubectl delete secret hasura-secrets
kubectl delete clusterrolebinding hasura-cluster-admin-binding

# Next, delete the data directory:
rm -r /Users/hasura-data


The Hasura Kubernetes Platform is available under these Terms of Service.