> ## Documentation Index
> Fetch the complete documentation index at: https://self-hosted-docs.relai.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Starting the services

> Bring the stack up with Docker Compose.

```sh theme={"system"}
docker compose up -d --remove-orphans
```

<Info>
  `--remove-orphans` cleans up containers from services that no longer
  exist in `docker-compose.yml` — handy if you're upgrading from an older
  version of this repo.
</Info>

## What happens on first startup

Compose brings services up in this order, waiting on each dependency:

<Steps>
  <Step title="db and redis start">
    MySQL and Redis start first.
  </Step>

  <Step title="app-migrations runs">
    Runs Django migrations against the database, then exits.
  </Step>

  <Step title="init-commands runs">
    Bootstraps your organization and admin user, then exits. This is what
    creates the organization from `ON_PREM_ORGANIZATION_NAME` and assigns
    your superuser the owner role — no manual Django Admin steps needed.
  </Step>

  <Step title="app, celery-worker, and dashboard start">
    The backend, background worker, and dashboard come up once the steps
    above complete successfully.
  </Step>
</Steps>

The first startup takes a little longer than subsequent restarts, since it
includes pulling images (if you haven't already) and running migrations.
Watch progress with:

```sh theme={"system"}
docker compose logs -f
```

Once everything is up, continue to [Verifying the deployment](/verifying-the-deployment).
