Hasura is a powerful open-source engine that allows you to instantly setup an API for your database. It offers a lot of features such as real-time updates, powerful relationships, and authorization.
In this tutorial, we will guide you through the installation process of Hasura on OpenBSD.
Before starting, it's necessary to have the following prerequisites set up:
Now let's start with the installation of Hasura on OpenBSD:
First, create a new directory for the Hasura project:
$ mkdir hasura
$ cd hasura
Next, create a new file docker-compose.yml
within the directory:
$ vi docker-compose.yml
Add the following code into the file:
version: '3'
services:
postgres:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: your_password_here
volumes:
- ./postgres-data:/var/lib/postgresql/data
graphql-engine:
image: hasura/graphql-engine:v2.0.0-alpha.7
depends_on:
- postgres
stdin_open: true
tty: true
ports:
- "9695:9695"
In the above code, replace your_password_here
with a strong password of your choice.
Save and exit the file by pressing ESC
key followed by :wq
and then press enter.
Now, start the containers:
$ docker-compose up -d
Wait for the containers to be started, then navigate to http://localhost:9695/ in your web browser to access the Hasura GraphQL Console.
Now, you can use the console to access your database and start setting up your API.
And that's it! You have successfully installed Hasura on OpenBSD using Docker Compose.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!