| Command | Starts PostgreSQL? | Starts app? | Best for |
|---|---|---|---|
aegra dev | Yes (Docker) | Yes (host, hot reload) | Local development |
aegra up | Yes (Docker) | Yes (Docker) | Self-hosted production |
aegra serve | No | Yes (host) | PaaS, containers, bare metal |
Local development
- Finds or generates
docker-compose.ymlwith PostgreSQL - Starts the PostgreSQL container
- Loads your
.envfile - Runs uvicorn with
--reloadfor hot reloading - Applies database migrations automatically on startup
aegra dev options
aegra dev options
| Option | Default | Description |
|---|---|---|
--host | 127.0.0.1 | Host to bind to |
--port | 8000 | Port to bind to |
--config / -c | Auto-detected | Path to aegra.json |
--env-file / -e | .env | Path to .env file |
--file / -f | Auto-detected | Path to docker-compose.yml |
--no-db-check | — | Skip database readiness check |
Self-hosted with Docker
- Finds or generates
docker-compose.ymlwith PostgreSQL + app service - Builds the Docker image from your
Dockerfile - Starts all containers
- The app container runs
aegra serveinternally - Migrations apply automatically on startup
docker-compose.yml includes:
- PostgreSQL with pgvector
- Your app container built from
Dockerfile - Health checks on PostgreSQL
- Volume mounts for your graphs and config
aegra up options
aegra up options
| Option | Default | Description |
|---|---|---|
--build / --no-build | Build on | Build images before starting |
--file / -f | Auto-detected | Path to compose file |
SERVICE... | All | Specific services to start |
PaaS deployment
For platforms like Railway, Render, or Fly.io — useaegra serve:
Create a PostgreSQL addon on your platform
Most PaaS platforms offer managed PostgreSQL. Create one and get the connection URL.
aegra serve options
aegra serve options
| Option | Default | Description |
|---|---|---|
--host | 0.0.0.0 | Host to bind to |
--port | From env or 8000 | Port to bind to |
--config / -c | Auto-detected | Path to aegra.json |
Kubernetes
Useaegra serve as the container command in your pod spec:
Database configuration
Two ways to configure the database connection:- Connection string (recommended for production)
- Individual fields
?sslmode=require) are preserved.DATABASE_URL takes precedence. When set, individual POSTGRES_* variables are ignored.Migrations
Migrations run automatically on startup for all deployment methods. You do not need to run them manually.Health checks
Aegra provides health check endpoints for load balancers, Docker, and Kubernetes probes:| Endpoint | Purpose |
|---|---|
GET /health | Overall health status |
GET /ready | Readiness check |
GET /live | Liveness check |
GET /info | Server info |
Troubleshooting
Connection refused on startup
Connection refused on startup
PostgreSQL is not reachable. If using
aegra dev or aegra up, make sure Docker is running. If using aegra serve, verify your DATABASE_URL or POSTGRES_* variables in .env.Password authentication failed
Password authentication failed
Wrong database credentials. Check that
POSTGRES_USER and POSTGRES_PASSWORD in your .env match what PostgreSQL was initialized with.Relation does not exist
Relation does not exist
Migrations haven’t been applied. This usually means the server couldn’t connect to PostgreSQL during startup. Check the logs for connection errors, fix the connection, and restart.
Migrations hang on startup
Migrations hang on startup
Check if another process holds a lock on the database, if the database is reachable but slow, or check server logs for specific migration errors.