Hasura Local Development
Tags: hasura, localdevelopment
Published: 2017-06-23 02:37:30

---
title: Hasura Local Development
published: true
description: Setting up local development for web-app in hasura
tags: hasura, local development
cover_image: https://thepracticaldev.s3.amazonaws.com/i/3c0cpib1zceolq23i2ht.jpg
---

As of my earlier posts about web app snipcode this is my next step to achieving that. I have to setup a local development server to test and build the web app and then push it to Github and deploy on hasura. To setup the local development server here are the prerequisites-

+ Virtualbox
+ Minimum Ram - 4GB and 64 bit system
+ Hasuractl
+ Kubectl

Extra for Windows user

+ git-bash installed

###Git Bash

Now let me go through the installation step for all of these. First git-bash in windows.

Go to the [link](https://git-scm.com/download/win) and download the .exe file for 64-bit git-bash and install on your PC. For Linux and Mac users this is not required.

###VirtualBox

Next is VirtualBox. You have to download VirtualBox according to your os from this [link](https://www.virtualbox.org/wiki/Downloads).

If you are on a Mac, you need the version for “OS X hosts”. Install it by double-clicking the file downloaded.

If you are on Windows, you need the version for "Windows hosts". Install that .exe file by double-clicking it.

If you are on Linux you need "Linux distributions" then choose the distros your PC running. After downloading the file you need some installing commands to be run in your terminal. For Debian users
> dpkg -i virtualboxfile.deb

For rpm installation

> rpm -i virtualboxfile.rpm

###Hasuractl

After installing all these this step is to install hasuractl.  For windows user download the [hasuractl.exe](https://storage.googleapis.com/hasuractl/v0.1.2/windows-amd64/hasuractl.exe) and install using this [video reference](https://drive.google.com/file/d/0B_G1GgYOqazYUDJFcVhmNHE1UnM/view).

For linux user 
>curl -Lo hasuractl https://storage.googleapis.com/hasuractl/v0.1.2/linux-amd64/hasuractl && chmod +x hasuractl && sudo mv hasuractl /usr/local/bin/

it will download hasuractl and set the path to usr/local/bin in your computer.
Same for Mac users also instead the command will be
>curl -Lo hasuractl https://storage.googleapis.com/hasuractl/v0.1.2/darwin-amd64/hasuractl && chmod +x hasuractl && sudo mv hasuractl /usr/local/bin/

###Kubectl

1. For Mac users
  
+ Download latest using curl

  > curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl

+ Make the kubectl binary executable
 
  > chmod +x ./kubectl

+ Move the binary into your PATH

  > sudo mv ./kubectl /usr/local/bin/kubectl


1. For Linux users
  
+ Download latest using curl

  >  curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl

+ Make the kubectl binary executable
 
  > chmod +x ./kubectl

+ Move the binary into your PATH

  > sudo mv ./kubectl /usr/local/bin/kubectl

3. For Windows users

+ Download the latest release v1.6.3 from [this link](https://storage.googleapis.com/kubernetes-release/release/v1.6.3/bin/windows/amd64/kubectl.exe).

+ Add the binary into your PATH.

###Starting Hasura

After installing all prerequisites now is the time to start hasura local dev. Windows users try these commands in git-bash. And make sure you have an account in hasura if not then go to [beta.hasura.io](https://beta.hasura.io) and signup.

> hasuractl login

![alt text](https://thepracticaldev.s3.amazonaws.com/i/3s67rrp5agtwkgcpsvg0.png "login")

-for logging into hasura account

> hasuractl local start

![alt text](https://thepracticaldev.s3.amazonaws.com/i/3s67rrp5agtwkgcpsvg0.png "start")

-for starting local development and downloading all the necessary tools. It will take time for the first time depending on internet connection.

> hasuractl local stop

![alt text](https://thepracticaldev.s3.amazonaws.com/i/iays9gcgbguigfmriop4.png "stop")

-for stopping the dev environment

In case of any errors restart the process by cleaning the local setup 
> hasuractl local clean

or by deleting all VM's and configuration 
> hasuractl local delete


*Here is the index of all the post regarding this series of snipcode developemnt*

[Part I: App Idea](https://dev.to/sroy8091/app-idea-for-hasura-internship)
[Part II: App prototype](https://dev.to/sroy8091/app-prototype)
[Part III: Local Development](https://dev.to/sroy8091/hasura-local-development)
[Part IV: G for Git](https://dev.to/sroy8091/g-for-git)
[Part V: Data Modeling](https://dev.to/sroy8091/its-modeling-time)
[Part VI: Data & Auth APIs](https://dev.to/sroy8091/postman-a-major-tool-for-developers)
[Part VII: Basic Functionalities](https://dev.to/sroy8091/i-love-cookies-expressjscookies)
[Part VIII: App Screen 1](https://dev.to/sroy8091/i-built-it-with-codemirror)
[Part IX: App Screen 2](https://dev.to/sroy8091/app-screen-2)
[Part X: App Screen 3](https://dev.to/sroy8091/search-page-using-postgres-full-text-search-feature)
[Part XI: User Reviews](https://dev.to/sroy8091/improvements-in-my-web-app)
[Part X: Final Submission](https://dev.to/sroy8091/final-app-submission)


|Liked my post?|
|---------------|
|  [![](https://thepracticaldev.s3.amazonaws.com/i/lsfkqfysa58u59627uy6.png)](https://ko-fi.com/A0A5WBC1)|