Self-host Acclimate
Set up a single Linux server with PostgreSQL, Keycloak and Caddy in three commands, then deliver a bundle to your application.
Run the service, the console, PostgreSQL, Keycloak for sign-in and Caddy for HTTPS on one Linux server with Docker Compose. If you already run Keycloak, read Use an existing Keycloak first. Before you plan for production, read Limits of this deployment. For a disposable stack on your laptop, see The local stack.
backend and executor networks are internal, so PostgreSQL and the executor listener have no route out. The console, the service and a co-hosted Keycloak reach the identity issuer, the optimizer and mail over a separate outbound network, and Caddy also serves Keycloak's sign-in pages. The Docker socket gives the executor administrator authority on the host.Prepare the server and DNS
The server needs:
- 64-bit Linux on x86-64 (amd64) or AArch64 (arm64), with Git.
- Docker Engine 28 or newer and the Compose plugin v2.39 or newer.
- 4 vCPUs, 8 GiB RAM and 40 GiB of SSD storage to start, with more as bundle history and backups grow.
Point DNS A records for console., api. and auth. under your domain at the server. Add AAAA records only if the server is reachable over IPv6.
| Direction | Ports |
|---|---|
| Inbound, open | TCP 80 and 443, for Caddy and certificate issuance |
| Inbound, private | Every other port. Compose publishes only Caddy's ports and Keycloak's admin console on 127.0.0.1:8180. For a load balancer, see Run behind a load balancer. |
| Outbound | DNS and HTTPS, for image pulls, certificates and sign-in, plus any model endpoint or SMTP relay you configure |
Create the private runtime files
Clone the repository and run deploy/init.sh with your domain and your email address.
git clone https://github.com/anveld-dev/acclimate.git
cd acclimate
deploy/init.sh --domain example.com --email you@example.comThe script writes every secret to ~/.config/acclimate, with mode 0700 for the directory and 0600 for each file, and the non-secret settings to .env in the checkout, which Compose reads itself. Run every later docker compose command from the checkout. The script refuses to run if either already exists.
It also creates your Keycloak account with your email address and prints its temporary password once. Your account is an operator, who can create workspaces, and administers the acclimate realm in Keycloak.
| Option | Default |
|---|---|
--console-host, --api-host, --auth-host | console., api. and auth. plus --domain |
--version | local, for images built from this checkout |
--config-dir | ~/.config/acclimate |
Back up the private directory
It holds ACCLIMATE_PROVIDER_ENCRYPTION_KEY, which encrypts the provider API keys that workspaces save. Store a copy off this server, apart from database backups. See Keep the provider encryption key.
Start Acclimate and create a workspace
docker compose up -d --build --waitOn its first start, Keycloak imports the acclimate realm with the console's client and your account. Then:
- Open your console URL and sign in with your email address and the temporary password. Keycloak asks for a new password and your name.
- Choose New workspace, set a name and workspace ID, then choose Create workspace.
- Before you send traffic, run the checks in Check health and readiness.
- Back up both databases and the private directory.
Once an Acclimate release is published, check out its tag, such as git switch --detach v0.1.0, pass --version 0.1.0 to deploy/init.sh, and start with docker compose pull and docker compose up -d --wait instead.
An operator sees an existing workspace only once a workspace administrator adds them. To take over a workspace with no members, adopt it in the console with its exact ID and a reason, which is recorded.
Deliver a bundle
Open Bundles, import a bundle and choose its initial channel. Create a connection, issue a connection credential and follow its Setup tab. See Deliver content to jobs.
Manage people
Keycloak holds each person's account, password and MFA. Acclimate holds who belongs to each workspace, and with which role.
Keycloak's admin console has no public route. Compose publishes it on the server's loopback address only, so open an SSH tunnel from your computer and keep it running.
ssh -N -L 8180:127.0.0.1:8180 <user>@<server>Open http://127.0.0.1:8180/admin/acclimate/console/ and sign in with your Acclimate email address and password. To add a person:
- In Keycloak, open Users and choose Add user. Enter their email address as Username and Email, turn on Email verified, then choose Create.
- On the Credentials tab, choose Set password. Enter a temporary password, leave Temporary on and choose Save. Send the password to them privately.
- In Acclimate, open Members in the workspace and choose Invite member with the same email address. Invitations need invitation email.
To stop someone signing in, turn off Enabled on their Details tab in Keycloak. That does not end a console session they already have, so also remove them in Members. MFA policies are under Authentication.
To let a second person administer Keycloak, open their Role mapping tab, choose Assign role and assign the realm-management client role realm-admin. Either of you can then reset the other's password. If nobody can sign in, create a temporary master-realm administrator with Keycloak's bootstrap-admin command, then set a temporary password for your account. The second command asks for the new password first, then the administrator's.
docker compose run --rm keycloak bootstrap-admin user --optimized
docker compose exec keycloak /opt/keycloak/bin/kcadm.sh set-password --no-config --server http://127.0.0.1:8080 --realm master --user <admin> -r acclimate --username you@example.com --temporaryUse an existing Keycloak
Register a confidential console client in your realm with the authorization code flow, S256 PKCE and the redirect URI https://<console-host>/auth/callback. Create DNS records for the console and API names only, and allow outbound HTTPS to your issuer. Then run deploy/init.sh as above and edit what it wrote before you start:
| File | Change |
|---|---|
.env | Set COMPOSE_FILE=compose.yaml and remove KEYCLOAK_HOST |
service.env | Set ACCLIMATE_OIDC_ISSUER to your realm's exact issuer, including any trailing slash. In ACCLIMATE_OPERATORS, set the same issuer and your user ID in that realm as the subject. |
console.env | Set CONSOLE_OIDC_ISSUER to the same issuer, and CONSOLE_OIDC_CLIENT_ID and CONSOLE_OIDC_CLIENT_SECRET to your client's |
Delete keycloak.env and keycloak-postgres-password, which only the co-hosted Keycloak reads.
Use another OIDC provider
The console can sign in through any OpenID Connect provider with discovery, such as Okta or Microsoft Entra ID. Only Keycloak has been tested: the repository's checks run Keycloak 26.8.2 and a test issuer. Follow Use an existing Keycloak with your provider's issuer and client.
| Requirement | Value |
|---|---|
| Issuer | HTTPS, with <issuer>/.well-known/openid-configuration reachable from the console and returning an issuer equal to CONSOLE_OIDC_ISSUER |
| Client | Confidential, authorization code with S256 PKCE, secret sent in the token request body (client_secret_post) |
| Redirect URI | CONSOLE_ORIGIN plus /auth/callback |
| Scopes | openid profile email |
| ID token | Signed with an algorithm the discovery document lists in id_token_signing_alg_values_supported, or RS256 when it lists none |
sub claim | Required, at most 512 characters and stable for each person |
| Optional claims | name or preferred_username for display. Without email and email_verified: true, a person can sign in but cannot accept an invitation or receive alert email. |
Acclimate identifies a person by issuer and sub, so keep the issuer stable. If it changes, including a new Keycloak hostname or realm, everyone signs in as a new person with no workspaces. No command migrates the old members, and adoption is refused while they remain.
Find a person's subject
In the console, the account menu shows your Subject and Issuer under Sign-in details. In Keycloak, the subject is the user's ID on their Details tab. After you change ACCLIMATE_OPERATORS, apply it with docker compose up -d --wait service.
Use an external PostgreSQL
The service can use any PostgreSQL server it can reach. CI tests PostgreSQL 16, the bundled version. No managed service has been tested.
| Topic | Requirement |
|---|---|
| Database and role | An empty database owned by the service's role, with no extension. The service manages its tables at startup. Tests run it as a superuser, so a non-superuser owner is untested. |
| Connections | At most 10 from the service |
| TLS | Add sslmode=require to DATABASE_URL, or sslmode=verify-full with sslrootcert=<path> for a private CA, mounted into the service container |
| Pooling | Direct, or a pooler in session mode. Transaction or statement pooling, as in PgBouncer, breaks the advisory lock that keeps one service per database. |
| Backups | Your provider's backups, or Other PostgreSQL servers |
Set DATABASE_URL in service.env. Save this file in the private directory and append its absolute path to COMPOSE_FILE in .env, after a :, so the bundled postgres no longer starts.
services:
postgres:
profiles: [bundled-database]
service:
depends_on: !reset {}Rotate secrets
Generate each new value with openssl rand -hex 32 and edit the files in the private directory. For the executor credential, see Rotate the executor credential.
| Secret | Set one new value in | Then run |
|---|---|---|
| Login token | ACCLIMATE_LOGIN_TOKEN in service.env and CONSOLE_LOGIN_TOKEN in console.env | docker compose up -d --wait service console |
| Console token | ACCLIMATE_CONSOLE_TOKEN in service.env and CONSOLE_SERVICE_TOKEN in console.env | docker compose up -d --wait service console |
| OIDC client secret | Regenerate it in your provider, then copy it to CONSOLE_OIDC_CLIENT_SECRET in console.env. In the co-hosted Keycloak, open Clients, then acclimate-console, then Credentials, and choose Regenerate. | docker compose up -d --wait console |
| Acclimate database password | The postgres-password file, the role's password (below) and the password part of DATABASE_URL | docker compose up -d --wait service |
| Keycloak database password | The keycloak-postgres-password file, the role's password (below) and KC_DB_PASSWORD in keycloak.env | docker compose up -d --wait keycloak |
| Static machine token | Add a grant with the new token to ACCLIMATE_AUTH, move the application to it, then remove the old grant | docker compose up -d --wait service after each edit |
People stay signed in through each rotation. Sign-in fails between the two steps of an OIDC secret rotation.
PostgreSQL reads a password file only when it creates its volume, so also set the role's password in the running database. \password prompts twice and sends only the hash. For Keycloak, use keycloak-db and keycloak.
docker compose exec postgres psql -U acclimate -d acclimate -c '\password acclimate'Limits of this deployment
| Limit | What it means |
|---|---|
| One service process per database | No replicas. The service holds a PostgreSQL advisory lock, so a second process stops at startup and one that loses the lock exits with status 75. |
| One console process | Sign-ins in progress live in memory for 5 minutes, so a restart sends people mid-sign-in to Sign in again and a second process would fail sign-ins that return to the other. Sessions are in the database and survive restarts. |
| One host | Each database lives in one local Docker volume, with no replication or failover. |
| Recovery point | Your last dump |
While the service is down, applications cannot prepare a job for a channel, receipts fail and learning stops. A job that asks for an exact version with the offline fallback uses its cached copy after a connection failure or an HTTP 502, 503 or 504, which includes Caddy's 502 for a stopped service.