Database: Postgres & Redis
UIGraph stores its data in two places: Postgres holds all persistent data (organizations, users, diagrams, sessions, encrypted tokens), and Redis is the cache and background-job queue. Both ship as containers in the bundled docker-compose.yml, and the UIGraph API is the only service that talks to them.
The important thing to understand here is that these two containers are configured independently from the API, and the values have to line up on both sides:
- The Postgres container is configured with
POSTGRES_DB/POSTGRES_USER/POSTGRES_PASSWORD. These create the database and its login on first boot. - The API connects using a single
POSTGRES_URLDSN. The database name, user, and password inside that URL must match the three variables above. If you change the password on the Postgres container, you must change it inPOSTGRES_URLtoo, or the API won't be able to connect. - Redis needs no credentials in the bundled setup; the API simply points
REDIS_URLat it.
Postgres (postgres)
The bundled Postgres container reads the standard POSTGRES_* variables from the official Postgres image. They are only applied when the data volume is empty, that is, on the very first boot. Changing them later does not retroactively rename the database or change the password of an existing volume; you would need to reset the volume or alter the database manually.
| Variable | Required | Default | Description |
|---|---|---|---|
POSTGRES_DB | Yes | uigraph | Name of the database created on first boot. Must match the database in the API's POSTGRES_URL. |
POSTGRES_USER | Yes | uigraph | Superuser role created on first boot. Must match the user in the API's POSTGRES_URL. |
POSTGRES_PASSWORD | Yes | devpassword | Password for that role. Must match the password in the API's POSTGRES_URL. Replace this before exposing the stack. |
With the defaults above, the matching connection string on the API is:
POSTGRES_URL=postgres://uigraph:devpassword@postgres:5432/uigraph?sslmode=disable
To use a managed Postgres (RDS, Cloud SQL, Neon, …) instead of the bundled container, drop this container and point the API's POSTGRES_URL at your provider.
Redis (redis)
The bundled Redis container runs with persistence enabled (--save 60 1 --appendonly yes) and takes no UIGraph-specific environment variables. There is nothing to configure on the container itself; the API reaches it through REDIS_URL (default redis://redis:6379).
To use a managed Redis instead, drop this container and set the API's REDIS_URL to your provider's connection string (including a password, e.g. redis://:password@host:6379, if it requires one).