Local HASH

Learn how to set up a local instance of HASH


What it is

HASH can be run locally on a single machine via Docker. We provide a simple, single Docker Compose file which orchestrates a series of Docker containers, inside of which everything HASH requires is built and runs. This abstracts away much of the complexity involved in running a production instance of HASH, which comprises various services: the frontend, API, hgres, various so-called "workers", plus underlying infrastructure (including Postgres, Redis, Kratos, Temporal, Vault, and MinIO).

When to use it

If you're a solo user working with incredibly sensitive information that should remain on a single device, or if you're simply looking to evaluate HASH, then running HASH locally may be appropriate.

We recommended using Hosted HASH in almost all other cases.

When not to use it

The instructions outlined below are not recommended for those seeking to modify and develop the HASH codebase itself. For this, we provide separate instructions (which can be found in the repository README), explaining how to run HASH natively with hot-reload support.

Setup instructions

1. Prerequisites

To get started, you'll need the following installed:

  • Git (≥ 2.17)
  • Docker (≥ 20.10) with Docker Compose (≥ 2.17) and Docker Buildx (≥ 0.10)
  • At least 8 GB RAM allocated to Docker (Preferences → Resources)
  • Around 15 GB free disk space for images and volumes

No language toolchains are required.

2. Start the stack

git clone https://github.com/hashintel/hash.git
cd hash/infra/compose
docker compose --profile hash up -d

This builds the images on first run and starts the full application stack. Building hash-graph from Rust takes 10–20 minutes from cold; subsequent starts reuse the cached images. After pulling changes from upstream, add --build to rebuild.

The Compose file is self-contained — it ships working defaults for every value, so no .env file is needed. AI features (and only those) require real provider keys; export them before starting, otherwise the placeholders let everything else run:

export OPENAI_API_KEY=sk-…
export ANTHROPIC_API_KEY=sk-…
docker compose --profile hash up -d

3. Create an account

The containerized API runs in production mode and does not seed any users. To use HASH locally you'll therefore need to create a new account. To do so, open http://localhost:3000 and sign up. Verification emails are captured by the bundled MailSlurper, rather than sent, and can be accessed at http://localhost:4436.

ServiceURL
HASH frontendhttp://localhost:3000
MailSlurper (captured email)http://localhost:4436
Temporal UI (HASH namespace)http://localhost:3100/namespaces/HASH

4. Specify an instance admin

A fresh signup has no special permissions. Instance admin is what unlocks the admin panel (top-right account menu) where you enable feature flags such as AI and Worker capabilities. To promote a user, run the setup script against the running stack:

docker compose --profile hash exec api yarn setup:admin

You'll be prompted for the email (your signup email) and, if no user with that email exists yet, a password (input is masked). The same flow works non-interactively by passing them as arguments:

docker compose --profile hash exec api yarn setup:admin you@example.com

The script is idempotent — if the user is already an admin, it exits with already an instance admin. Nothing to do.

Additional information

Observability

Add the observability profile to bring up the Grafana stack (Loki, Tempo, Mimir) alongside either profile above:

docker compose --profile hash --profile observability up -d

Grafana is then available at http://localhost:3001 with logs, traces and metrics from every service pre-wired through the OpenTelemetry collector.

Resetting the local state

docker compose --profile hash down -v   # stop services and drop the volumes
docker compose --profile hash up -d

The -v flag drops the Docker volumes, clearing the database, object store and all other persisted state.

Join our community of HASH developers