CLI-Based Setup
The GAIA CLI provides the easiest way to set up a self-hosted GAIA instance. It handles repository cloning, tool installation, environment configuration, and service startup through an interactive wizard.For installation instructions, see CLI Installation. For the full command reference, see CLI Commands.
Quick Start
What the Wizard Does
Thegaia init command walks you through:
Prerequisites Check
Verifies Git, Docker, and Mise are installed. Installs Mise automatically if missing. Checks for port conflicts and suggests alternatives.
Environment Configuration
Choose between Self-Host (Docker) or Developer Mode (Local), then configure environment variables either:
- Manually: Interactive prompts for each variable with descriptions and defaults
- Via Infisical: Enter your Infisical credentials for secret management
Project Setup
Runs
mise setup to install all dependencies, start Docker services, and seed the database.Already Have the Repo?
If you’ve already cloned GAIA and just need to configure it, usegaia setup instead:
Managing Services After Setup
Once setup is complete, manage your GAIA instance with:Environment Variable Auto-Discovery
The CLI automatically discovers environment variables from the codebase at runtime. When a developer adds a new variable to the API settings or web.env file, the CLI picks it up automatically — no CLI updates needed.
- API variables: Extracted from Python settings files using AST parsing
- Web variables: Parsed from
apps/web/.envat runtime
Monitoring Logs (Developer Mode)
In developer mode,gaia start runs services in the background. Logs are written to dev-start.log in the repo root — monitor them with:
Port Conflict Handling
If required ports are already in use, the CLI detects the conflict, shows which process is using the port, and suggests an alternative port. Infrastructure URLs in your.env files are automatically updated to use the alternative ports.
Port overrides are saved to infra/docker/.env inside your GAIA repo and persist across gaia start/gaia stop cycles — no need to re-run setup. gaia status automatically uses the same overridden ports.
To change port assignments after setup, edit infra/docker/.env directly:
| Variable | Service | Default |
|---|---|---|
API_HOST_PORT | API | 8000 |
WEB_HOST_PORT | Web | 3000 |
POSTGRES_HOST_PORT | PostgreSQL | 5432 |
REDIS_HOST_PORT | Redis | 6379 |
MONGO_HOST_PORT | MongoDB | 27017 |
RABBITMQ_HOST_PORT | RabbitMQ | 5672 |
CHROMA_HOST_PORT | ChromaDB | 8080 |
Restart services after editing:
gaia stop && gaia start
