---
title: "Install using Docker Compose"
description: "Set up RAGNA Studio by hand with the release's compose files."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ragna.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Install using Docker Compose

## Who this is for

This page is for operators who want full control over the setup, or want to see every step the installer takes. For a setup without manual steps, use the [installer](https://docs.ragna.io/self-hosting/install-options/one-line-setup). It does all of this automatically.

## Requirements

- A server that meets the [requirements](https://docs.ragna.io/self-hosting#server).
- Docker Engine with the Docker Compose v2 plugin. Check with `docker compose version`.
- `curl` and `openssl`.

> **Windows**
>
> Use WSL with Docker Desktop's WSL 2 integration. Keep the project folder in the WSL filesystem,
> not under `/mnt/c/...`. Folders on the Windows drive are slow to mount and cause permission
> problems.

## Step 1: Download the release files

Find the current version on [GitHub releases](https://github.com/ragna-ai/ragna-studio/releases). Replace `X.Y.Z` with it, without the `v`:

```bash
VERSION=X.Y.Z
mkdir -p ragna-studio/docker && cd ragna-studio
for file in docker/docker-compose.yml docker/docker-compose.selfhost.yml docker/postgres-init.sql .env.example; do
  curl -fsSL "https://raw.githubusercontent.com/ragna-ai/ragna-studio/v$VERSION/$file" -o "$file"
done
```

Always take the compose files and the images from the same release.

## Step 2: Create `.env`

```bash
cp .env.example .env
chmod 600 .env
```

Keep `.env` out of version control. Then set these values:

| Setting              | Value                                                                                                                               |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `RAGNA_VERSION`      | The release from step 1 (`X.Y.Z`). Add this line, `.env.example` doesn't have it.                                                   |
| `BETTER_AUTH_SECRET` | Output of `openssl rand -hex 32`                                                                                                    |
| `DB_PASSWORD`        | Output of `openssl rand -hex 24`                                                                                                    |
| `REDIS_PASSWORD`     | Output of `openssl rand -hex 24`                                                                                                    |
| OAuth client         | `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET`, or the `MICROSOFT_*` values. See [Configuration](https://docs.ragna.io/self-hosting/configuration#oauth). |
| AI key               | At least one of `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GOOGLE_GENAI_API_KEY` or `MISTRAL_API_KEY`                                  |

Use hex secrets. `DB_PASSWORD` becomes part of the database URL, so characters like `/` break the connection.

For localhost, the URLs in `.env.example` already fit. On a server, set the domains as in [Configuration](https://docs.ragna.io/self-hosting/configuration#domains). Storage is optional, see [Storage](https://docs.ragna.io/self-hosting/storage).

> **Never rotate BETTER_AUTH_SECRET**
>
> Pick the secrets once. Changing `BETTER_AUTH_SECRET` later makes stored OAuth tokens unreadable.

## Step 3: Start everything

Run this from the `ragna-studio` folder:

```bash
docker compose --project-directory . \
  -f docker/docker-compose.yml \
  -f docker/docker-compose.selfhost.yml \
  up -d --wait
```

`--project-directory .` matters. Without it, Compose looks for `.env` in the `docker` folder. `--wait` returns once every service is running and healthy.

The second file is the self-host override. It sets the in-network hosts for Postgres, Redis and the webbrowser, and publishes the frontend and backend on `127.0.0.1` only.

### What this sets up

| Service      | Role                                                            |
| ------------ | --------------------------------------------------------------- |
| `postgres`   | Database, with pgvector. Has a health check.                    |
| `redis`      | Queues                                                          |
| `migrate`    | Applies the schema once Postgres is healthy, then exits         |
| `seed`       | Adds the model catalog and a starter agent template, then exits |
| `backend`    | The API, on `127.0.0.1:3010`                                    |
| `worker`     | Background jobs and scheduled workflows                         |
| `frontend`   | The web app, on `127.0.0.1:3000`                                |
| `webbrowser` | Headless browser for agents. Not published.                     |

`migrate` and `seed` run on every start and are idempotent.

## Step 4: Verify it's working

```bash
docker compose -p ragna_studio ps -a
```

`migrate` and `seed` show `Exited (0)`. All other services are `Up`, and those with a health check are `healthy`.

```bash
curl http://127.0.0.1:3010/health
```

This returns `{"status":"ok"}`. Then open [localhost:3000](http://localhost:3000). On a server, set up the [reverse proxy](https://docs.ragna.io/self-hosting/reverse-proxy) next.

If something fails, see [Troubleshooting](https://docs.ragna.io/self-hosting/troubleshooting).

## Use the installer later

Because `.env` has `RAGNA_VERSION`, the installer recognizes this folder as its own. The installer can upgrade it from the parent folder, see [Upgrades and backups](https://docs.ragna.io/self-hosting/upgrades-and-backups).

Source: https://docs.ragna.io/self-hosting/install-options/docker-compose/index.mdx
