We use cookies

We use cookies to ensure you get the best experience on our website. For more information on how we use cookies, please see our cookie policy.

By clicking "Accept", you agree to our use of cookies.
Learn more.

Self HostingHatchet Lite

Hatchet Lite Deployment

To get up and running quickly, you can deploy via the hatchet-lite image. This image is designed for development and low-volume use-cases.

Prerequisites

This deployment requires Docker installed locally to work.

Getting Hatchet Lite Running

To use Postgres as both your DB and message queue, copy the following docker-compose.hatchet.yml file to the root of your repository:

If you have an existing Postgres instance already running, you can simply point DATABASE_URL to that instance and ignore the postgres service deployment in the following docker-compose file.

docker-compose.hatchet.yml
version: "3.8"
name: hatchet-lite
services:
  postgres:
    image: postgres:15.6
    command: postgres -c 'max_connections=200'
    restart: always
    environment:
      - POSTGRES_USER=hatchet
      - POSTGRES_PASSWORD=hatchet
      - POSTGRES_DB=hatchet
    volumes:
      - hatchet_lite_postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -d hatchet -U hatchet"]
      interval: 10s
      timeout: 10s
      retries: 5
      start_period: 10s
  hatchet-lite:
    image: ghcr.io/hatchet-dev/hatchet/hatchet-lite:latest
    ports:
      - "8888:8888"
      - "7077:7077"
    depends_on:
      postgres:
        condition: service_healthy
    environment:
      # Refer to https://docs.hatchet.run/self-hosting/configuration-options
      # for a list of all supported environment variables
      DATABASE_URL: "postgresql://hatchet:hatchet@postgres:5432/hatchet?sslmode=disable"
      SERVER_AUTH_COOKIE_DOMAIN: localhost
      SERVER_AUTH_COOKIE_INSECURE: "t"
      SERVER_GRPC_BIND_ADDRESS: "0.0.0.0"
      SERVER_GRPC_INSECURE: "t"
      SERVER_GRPC_BROADCAST_ADDRESS: localhost:7077
      SERVER_GRPC_PORT: "7077"
      SERVER_URL: http://localhost:8888
      SERVER_AUTH_SET_EMAIL_VERIFIED: "t"
      SERVER_DEFAULT_ENGINE_VERSION: "V1"
      SERVER_INTERNAL_CLIENT_INTERNAL_GRPC_BROADCAST_ADDRESS: localhost:7077
    volumes:
      - "hatchet_lite_config:/config"
 
volumes:
  hatchet_lite_postgres_data:
  hatchet_lite_config:

Then run docker-compose -f docker-compose.hatchet.yml up to get the Hatchet Lite instance running.

Accessing Hatchet Lite

Once the Hatchet Lite instance is running, you can access the Hatchet Lite UI at http://localhost:8888.

By default, a user is created with the following credentials:

Email: admin@example.com
Password: Admin123!!

Run tasks against the Hatchet instance

To run tasks against this instance, you will first need to create an API token for your worker. There are two ways to do this:

  1. Using a CLI command:

    You can run the following command to create a token:

    docker compose -f docker-compose.hatchet.yml exec hatchet-lite /hatchet-admin token create --config /config --tenant-id 707d0855-80ab-4e1f-a156-f1c4546cbf52 | xargs
  2. Using the Hatchet dashboard:

    • Log in to the Hatchet dashboard.
    • Navigate to the “Settings” page.
    • Click on the “API Tokens” tab.
    • Click on “Create API Token”.

Now that you have an API token, see the guide here for how to run your first task.