Advanced Docker Configuration

Open inAnthropic

Prerequisites

This page covers production deployment, environment configuration, CLI access, and migration from legacy setups.

Environment configuration

The container uses environment variables with default values. Override them by creating a .env file in the cloned terminusdb directory:

Example: Bash
# AI indexing (optional)
OPENAI_KEY=your-openai-key-here
BUFFER_AMOUNT=120000

# Server configuration
TERMINUSDB_SERVER_PORT=6363
TERMINUSDB_ADMIN_PASS=root

Pass the file to Docker Compose:

Example: Bash
docker compose --env-file .env up

Using the CLI

Access the TerminusDB command-line interface from the Docker container:

Example: Bash
# When container is not running:
docker compose run terminusdb-server ./terminusdb

# When container is already running:
docker compose exec terminusdb-server ./terminusdb

For full CLI documentation, see CLI Reference.


Server deployment

Local deployment (default)

By default, the Docker container binds to IP 127.0.0.1. This prevents insecure deployments and ensures the TerminusDB server is accessible on the local machine only.

Remote / production deployment

To deploy TerminusDB on a remote server:

  1. Enable HTTPS with a reverse proxy (Nginx, Caddy, or similar)
  2. Do not use the X-Forward-Header ENV variables unless you fully understand the security implications
  3. Consider the Self-Hosted (Production) guide for a comprehensive production setup

Migrating from terminusdb-bootstrap

If you previously used terminusdb-bootstrap and want to keep your existing data, run Docker Compose with the bootstrap storage overlay:

Example: Bash
docker compose -f docker-compose.yml -f distribution/docker-compose/bootstrap_storage.yaml up

This mounts the data volumes from your previous installation into the new container setup.


Was this helpful?