2.3 Setup Hasura for local development

Ankur Pandey
2 min readJul 22, 2017

--

About Hasura

What is Hasura?

Hasura is a platform that is installed on any Linux machine used for building and deploying powerful back ends. Instant APIs for data, auth & file handling (powered by Postgres). Hasura helps you deploy your custom code written in any language/framework. Runs anywhere: your laptop, your VM, your cluster on the cloud.

Hasura is a platform that comes with:

  1. Postgres
  2. Nginx + redis
  3. Data API service
  4. Auth API service
  5. File API service
  6. SSH service with git hooks (so that you can git push to deploy your code)

How are all these services put together?

The only dependency it needs is Kubernetes.

kubernetes: It is a tool that makes it easy for us to administer a system without actually going into the system. So I can create a server, without SSHing inside the server.

Minikube: A VM with kubernetes installed.

Documentation: Hasura platform

Visit official website of Hasura

Installed Hasura on your desktop (For Linux systems)with following steps:

Prerequisites

  1. Get a computer with min 4 GB RAM and a 64 bit OS
  2. Download and install virtual box
  3. Install Hasuractl using following command:
curl -Lo hasuractl https://storage.googleapis.com/hasuractl/v0.1.2/linux-amd64/hasuractl && chmod +x hasuractl && sudo mv hasuractl /usr/local/bin/

3. Install latest kubectl (>= 1.6.0)(https://kubernetes.io/docs/tasks/kubectl/install/)

Starting Hasura

  1. Create an account on beta.hasura.io if you do not have one
  2. Run:

hasuractl login

3. After you have successfully logged in, run this command:

NOTE: Please be advised that if you are running the next command for the first time, it will roughly download about 1–1.5GB of docker images.

hasuractl local start

It might take a long time for this to finish, depending on your internet connection. The command exits by pointing you to a url to login to the console. If download fails and you get an error like: EOF then run following commands:

hasuractl local clean
hasuractl local stop

Then repeat this step and make sure that you have fast internet connection and sufficient data for downloading.

Stopping Hasura

hasuractl local stop

What is virtual box and why we are using it?

A VirtualBox installs on an operating system as an application. VirtualBox allows additional operating systems to be installed on it, as a Guest OS, and run in a virtual environment.

But here we are using virttual box to run a Kubernetes cluster since hasuractl needs a Kubernetes cluster running locally in our system.

Tutorials to Run Hasura locally:

Next: 3.1 Data Modelling

--

--