Skip to main content

Prerequisites

  • Docker Engine 20.10 or later
  • Docker Compose v2 (docker compose command, not docker-compose)
  • A running PostgreSQL instance (version 16 recommended) accessible from the containers
  • Git

Services

The docker-compose.yml file defines the following services:

Service startup order

The depends_on declarations in docker-compose.yml define the following boot sequence:
agent-service additionally waits for agent-provisioning to log "Agent-Provisioning-Service Microservice is listening to NATS" before it starts.

Deployment

1

Clone the repository

2

Configure environment variables

Copy the sample file and fill in the required values:
The following variables must be set before any service will start correctly:
  • DATABASE_URL — PostgreSQL connection string, e.g. postgresql://postgres:password@host:5432/dbname?schema=public
  • POSTGRES_HOST, POSTGRES_PORT, POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DATABASE
  • NATS_URL — defaults to nats://0.0.0.0:4222
  • REDIS_HOST, REDIS_PORT
  • PLATFORM_ADMIN_EMAIL — used by the seed service to create the platform admin user
  • CRYPTO_PRIVATE_KEY — 32-character key used to encrypt wallet credentials; must match the value used by the Studio UI
  • KEYCLOAK_DOMAIN, KEYCLOAK_REALM, KEYCLOAK_MANAGEMENT_CLIENT_ID, KEYCLOAK_MANAGEMENT_CLIENT_SECRET
  • PLATFORM_ADMIN_KEYCLOAK_ID, PLATFORM_ADMIN_KEYCLOAK_SECRET
  • All *_NKEY_SEED variables — one per microservice (e.g. USER_NKEY_SEED, API_GATEWAY_NKEY_SEED, ORGANIZATION_NKEY_SEED, etc.)
  • AGENT_HOST — SSH connection string for the agent host VM, e.g. username@0.0.0.0
  • AFJ_VERSION — Docker image tag for Credo agents, e.g. afj-0.4.1:latest
3

Start infrastructure services

Bring up NATS and Redis before the application services:
Verify they are healthy:
4

Run the seed service

The seed service applies Prisma migrations and loads master data (org roles, agent types, ledger configs, platform config):
The container exits on completion. Check for errors before proceeding:
The seed service mounts ./libs/prisma-service/prisma/data/credebl-master-table.json into the container. Ensure this file is present in your checkout.
5

Create the agent.env file

The agent-provisioning service mounts ./agent.env into the container at /app/agent.env. This file is passed to each spawned agent container. Create it with at minimum the wallet storage credentials:
Add the values your agent containers require, for example:
agent.env
6

Start all platform services

To follow logs across all services:
7

Verify services are running

All services should show running status. The seed container will show exited 0 — that is expected.Confirm the API gateway is accepting requests:
A 200 or 301 response confirms the gateway is up.
8

Access the Swagger UI

Open your browser and navigate to:
The interactive API documentation lists all available endpoints grouped by microservice.

Port reference

Volume mounts

The agent-provisioning service requires the following mounts:
The Docker socket mount (/var/run/docker.sock) is required so agent-provisioning can spin up per-organization agent containers on the host. The agent-service also mounts the Docker socket and uses volumes_from: agent-provisioning to access the shared agent-config and endpoints directories.

Troubleshooting

Confirm DATABASE_URL in .env points to a reachable PostgreSQL instance. If PostgreSQL is running on the host machine, use the host’s LAN IP rather than localhost or 127.0.0.1, since services run inside Docker containers.
Check logs with docker compose logs api-gateway. Missing or malformed NKEY seed values are a common cause. Ensure all *_NKEY_SEED variables in .env are set.
agent-service waits for the log line "Agent-Provisioning-Service Microservice is listening to NATS" from agent-provisioning. If agent-provisioning fails to connect to NATS, agent-service will wait indefinitely. Run docker compose logs agent-provisioning to diagnose.
The .env.sample sets NATS_AUTH_TYPE=nkey. Each service has its own *_NKEY_SEED variable. Generate unique NKey seeds for each service and set them in .env. The NATS_CREDS_FILE variable is only required when NATS_AUTH_TYPE=creds.
Verify that /var/run/docker.sock is mounted into agent-provisioning and that the user running Docker has permission to access the socket. Also confirm that AGENT_HOST and AFJ_VERSION are set in .env.