Skip to main content
Deploying AllCodex via Docker Compose is the recommended method for production self-hosting. It runs the three services in isolated containers while mapping their data folders and network interfaces to the host.

1. Prerequisites and dependencies

Before you begin, ensure you have the following installed on your host:
  • Docker and the Compose plugin.
  • PostgreSQL database: AllKnower (the parser backend) uses PostgreSQL to store user sessions, histories, and usage budgets.
    1. Connect to an existing PostgreSQL instance running on your host machine.
    2. Use the self-contained compose file below to run PostgreSQL in a container alongside the AllCodex services.

2. Docker Compose configuration

Create a folder for your deployment and configure the docker-compose.yml file.

Self-contained deployment (includes PostgreSQL)

This configuration includes a PostgreSQL container. The services use network_mode: host to share the host’s network, binding the database to port 5432 on localhost.
docker-compose.yml

3. Creating environment files

AllCodex reads configurations from environment files located in /etc/allcodex/ on your host server. Create the directory and touch the config files:

Core configuration (core.env)

Configure Core to listen on port 8080:
/etc/allcodex/core.env

AllKnower configuration (allknower.env)

Provide database credentials, OpenRouter key, and encryption secrets:
/etc/allcodex/allknower.env
The INTEGRATION_CREDENTIALS_KEY is a 32-byte key (represented as a 64-character hex string) used to encrypt your AllCodex ETAPI tokens at rest in the PostgreSQL database. Keep this safe.

Portal configuration (portal.env)

Configure the Portal to point to the backend services:
/etc/allcodex/portal.env

4. Starting the containers

Run the compose file to pull images and start the services:
Verify that all four services are active and running:

5. Checking logs

Check container logs to troubleshoot issues: