Skip to main content

Install With Docker

Objective: run Yew Search on your own machine with Docker Compose.

Done when: the Yew web app opens in your browser at http://localhost:3000.

Before You Start​

You need:

  • Docker Engine with Docker Compose v2.23.1 or newer. The Compose file below uses an inline configs block, which older versions don't support. Check with docker compose version.
  • An x86_64 (amd64) machine. The Yew images are built for x86_64 only.
  • Memory for OpenSearch. OpenSearch reserves 1 GB of heap by default, on top of what the other containers use.

The Six Containers​

ContainerWhat it does
postgresStores Yew's data. It also holds a second database, hatchet, for the task queue.
opensearchThe search index. It has no published port, so only the backend can reach it.
redisStores login sessions.
hatchetThe task queue that runs integration syncs.
backendThe API on port 8443, plus the workers that sync your integrations.
frontendThe web app on port 3000.

All data is kept in Docker named volumes, so it survives restarts and upgrades.

1. Create the Compose File​

Make a folder for Yew, and save the file below in it as docker-compose.yaml. Run every docker compose command on this page from this folder.

docker-compose.yaml
name: yew

networks:
yew:

volumes:
postgres:
redis:
opensearch:
hatchet-config:

configs:
# Runs once, when the postgres volume is first created.
create-hatchet-database:
content: |
CREATE DATABASE hatchet;

services:
postgres:
image: postgres:17
restart: unless-stopped
environment:
POSTGRES_USER: yew
POSTGRES_PASSWORD: REPLACE_WITH_POSTGRES_PASSWORD
POSTGRES_DB: yew
configs:
- source: create-hatchet-database
target: /docker-entrypoint-initdb.d/10-create-hatchet-database.sql
volumes:
- postgres:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U yew']
interval: 5s
timeout: 5s
retries: 20
networks:
yew:
aliases:
- yew-postgres

redis:
image: redis:7
restart: unless-stopped
volumes:
- redis:/data
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
timeout: 5s
retries: 20
networks:
yew:
aliases:
- yew-redis

opensearch:
image: opensearchproject/opensearch:3.5.0
restart: unless-stopped
environment:
discovery.type: single-node
# Only the backend can reach OpenSearch (no published port), so the
# security plugin is off.
DISABLE_SECURITY_PLUGIN: 'true'
DISABLE_INSTALL_DEMO_CONFIG: 'true'
OPENSEARCH_JAVA_OPTS: -Xms1g -Xmx1g
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
volumes:
- opensearch:/usr/share/opensearch/data
healthcheck:
test: ['CMD-SHELL', 'curl -sf http://localhost:9200/_cluster/health || exit 1']
interval: 10s
timeout: 5s
retries: 30
start_period: 30s
networks:
yew:
aliases:
- yew-opensearch

hatchet:
image: ghcr.io/hatchet-dev/hatchet/hatchet-lite:v0.114.2
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
environment:
DATABASE_URL: postgresql://yew:REPLACE_WITH_POSTGRES_PASSWORD@yew-postgres:5432/hatchet?sslmode=disable
SERVER_URL: http://localhost:8888
SERVER_AUTH_COOKIE_DOMAIN: localhost
SERVER_AUTH_SET_EMAIL_VERIFIED: 't'
SERVER_GRPC_BIND_ADDRESS: 0.0.0.0
SERVER_GRPC_PORT: 7077
SERVER_GRPC_INSECURE: 't'
SERVER_GRPC_BROADCAST_ADDRESS: yew-hatchet:7077
SERVER_INTERNAL_CLIENT_INTERNAL_GRPC_BROADCAST_ADDRESS: yew-hatchet:7077
volumes:
- hatchet-config:/config
networks:
yew:
aliases:
- yew-hatchet

backend:
image: registry.gitlab.com/alanjames1987/yew-monorepo/backend:latest
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
opensearch:
condition: service_healthy
hatchet:
condition: service_started
environment:
NODE_ENV: development
SERVICE_NAME: yew-backend
HTTP_PORT: 8443
INTEGRATIONS_ENABLED: 'true'

# The addresses your browser uses to reach Yew.
BACKEND_URL: http://localhost:8443
FRONTEND_URL: http://localhost:3000
CORS_ORIGINS: http://localhost:3000
# Where Google sends you back after you connect Gmail or Calendar.
OAUTH_REDIRECT_BASE_URL: http://localhost:8443

POSTGRES_URL: yew-postgres
POSTGRES_PORT: 5432
POSTGRES_USERNAME: yew
POSTGRES_PASSWORD: REPLACE_WITH_POSTGRES_PASSWORD
POSTGRES_DB: yew

REDIS_HOST: yew-redis
REDIS_PORT: 6379
REDIS_DB: 0

OPENSEARCH_HOST: yew-opensearch
OPENSEARCH_PORT: 9200

HATCHET_CLIENT_TOKEN: REPLACE_WITH_HATCHET_TOKEN
HATCHET_CLIENT_HOST_PORT: yew-hatchet:7077
HATCHET_CLIENT_TLS_STRATEGY: none
HATCHET_CLIENT_API_URL: http://yew-hatchet:8888

SESSION_SECRET: REPLACE_WITH_SESSION_SECRET

LOGGING_ENABLED: 'true'
TRACING_ENABLED: 'false'
METRICS_ENABLED: 'false'
ports:
- '8443:8443'
networks:
yew:
aliases:
- yew-backend

frontend:
image: registry.gitlab.com/alanjames1987/yew-monorepo/frontend:latest
restart: unless-stopped
depends_on:
- backend
environment:
NODE_ENV: production
# The backend address your browser uses. Same as BACKEND_URL above.
BACKEND_URL: http://localhost:8443
ports:
- '3000:3000'
networks:
- yew

2. Fill In the Two Secrets​

Generate two values:

uuidgen   # use this for the Postgres password
uuidgen # use this for the session secret

In docker-compose.yaml:

  • Replace all three REPLACE_WITH_POSTGRES_PASSWORD with the first value. They must match.
  • Replace REPLACE_WITH_SESSION_SECRET with the second value.

Leave REPLACE_WITH_HATCHET_TOKEN for now. You create the token in step 4.

The Postgres password is also part of Hatchet's database URL, where characters like @, : and / break the URL. A UUID only contains letters, numbers and dashes, so it's safe there.

3. Set OpenSearch's Memory Limit (Linux Only)​

OpenSearch won't start unless the host allows enough memory maps:

sudo sysctl -w vm.max_map_count=262144

To keep the setting after a reboot, add vm.max_map_count=262144 to /etc/sysctl.conf. Docker Desktop on macOS and Windows already has a high enough value.

4. Create the Hatchet Token​

The backend needs a token to talk to Hatchet. Hatchet generates the keys that sign the token on its first start, so the token can only be created once Hatchet is running.

Start Postgres and Hatchet on their own:

docker compose up -d postgres hatchet

Check that Hatchet is running:

docker compose ps hatchet

Its status should be Up. Then create the token:

docker compose exec hatchet /hatchet-admin token create \
--config /config --tenant-id 707d0855-80ab-4e1f-a156-f1c4546cbf52 --name yew

The tenant id is Hatchet's built-in default tenant, so use it exactly as written. The command prints a long token. Replace REPLACE_WITH_HATCHET_TOKEN in docker-compose.yaml with it.

You only do this once. The token keeps working as long as the hatchet-config volume exists.

5. Start Yew​

docker compose up -d

This starts the remaining containers. The backend waits for Postgres, Redis and OpenSearch to report healthy, then runs its database migrations before it starts serving. Check that everything is up:

docker compose ps

Every container should be Up, and postgres, redis and opensearch should be healthy. If the backend keeps restarting, read its log:

docker compose logs backend --tail 100

6. Open Yew​

Go to http://localhost:3000. On a new install, Yew takes you to a page to create your first user. Continue with First-Time Setup.

Reaching Yew From Another Machine​

The web app runs in your browser and calls the backend directly, so the addresses in the Compose file must be ones your browser can reach. They're set in five places:

SettingServiceDefault
BACKEND_URLbackendhttp://localhost:8443
OAUTH_REDIRECT_BASE_URLbackendhttp://localhost:8443
FRONTEND_URLbackendhttp://localhost:3000
CORS_ORIGINSbackendhttp://localhost:3000
BACKEND_URLfrontendhttp://localhost:8443

To use Yew from other devices, change the 8443 addresses to the backend's address and the 3000 addresses to the web app's, using the machine's LAN address (for example http://192.168.1.50:8443 and http://192.168.1.50:3000). Then run docker compose up -d again.

For HTTPS or a domain name, put a reverse proxy (Traefik, Caddy, nginx) in front of the two ports and use the addresses the proxy serves. The Compose file doesn't include a proxy, because it depends on how you expose your network.

Gmail and Google Calendar need HTTPS or localhost

Google only sends you back to an https address or to localhost, never to a plain LAN IP. If you plan to connect Gmail or Google Calendar from another device, give the backend an HTTPS address first. See Gmail and Google Calendar.

To publish on different host ports, change the left side of the ports entries (for example '9000:3000'), and update the addresses to match.

Updating​

docker compose pull
docker compose up -d

Database migrations run automatically when the backend starts.

The latest image tags always get the newest release. To control when you upgrade, replace latest on the backend and frontend images with a release, such as 2026.11.26.0, and keep both on the same release. Versions are dates: 2026.11.26.0 is the first build on 26 November 2026 and 2026.11.26.1 the second.

If you use the agent, also set YEW_VERSION=2026.11.26.0 (your release) in the .env file next to docker-compose.yaml. agent.yaml takes the agent's image version from YEW_VERSION, not from the tags in docker-compose.yaml, so without it the agent stays on latest. The web crawler doesn't use YEW_VERSION: its browser image is always latest, and its proxy image follows CRAWLER_PROXY_VERSION (default latest).

The add-ons read a .env file

This page's Compose file keeps every setting inline. The add-on files (agent.yaml, crawler.yaml) read some of their settings from a file named .env in the same folder as docker-compose.yaml. Docker Compose loads that file on its own. Create it when an add-on page tells you to.

Backing Up​

Everything lives in four named volumes. Back up these two:

  • postgres: all of Yew's data, plus Hatchet's database.
  • hatchet-config: Hatchet's signing keys. Without them, the Hatchet token in your Compose file stops working.

The opensearch volume holds the search index, which Yew rebuilds from Postgres. The redis volume holds login sessions, so losing it only logs everyone out.

Keep a copy of your docker-compose.yaml as well, since it holds your secrets.

Troubleshooting​

If a container won't start, read its log, replacing backend with the container's name:

docker compose logs backend --tail 100

Still stuck? Ask at answers.yewsearch.com. It searches these docs with Yew Search and writes an answer with links to the pages it used.

Next Steps​