> ## Documentation Index
> Fetch the complete documentation index at: https://docs.argentos.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Docker

> Run ArgentOS in a Docker container.

## Quick Start

```bash theme={null}
docker run -d \
  --name argentos \
  -p 18789:18789 \
  -p 8080:8080 \
  -v ~/.argentos:/root/.argentos \
  -e ANTHROPIC_API_KEY=sk-ant-... \
  ghcr.io/argentaios/argentos:latest
```

The container runs the gateway on port 18789 and the dashboard on port 8080.

## Docker Compose

<CodeGroup>
  ```yaml Basic theme={null}
  version: "3.8"
  services:
    argentos:
      image: ghcr.io/argentaios/argentos:latest
      restart: unless-stopped
      ports:
        - "18789:18789"
        - "8080:8080"
      volumes:
        - argentos-state:/root/.argentos
        - argentos-workspace:/root/argent
      environment:
        - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}

  volumes:
    argentos-state:
    argentos-workspace:
  ```

  ```yaml With External PostgreSQL and Redis theme={null}
  version: "3.8"
  services:
    argentos:
      image: ghcr.io/argentaios/argentos:latest
      restart: unless-stopped
      ports:
        - "18789:18789"
        - "8080:8080"
      volumes:
        - argentos-state:/root/.argentos
        - argentos-workspace:/root/argent
      environment:
        - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
      depends_on:
        - postgres
        - redis

    postgres:
      image: pgvector/pgvector:pg17
      restart: unless-stopped
      ports:
        - "5433:5432"
      volumes:
        - pgdata:/var/lib/postgresql/data
      environment:
        - POSTGRES_DB=argentos
        - POSTGRES_USER=postgres
        - POSTGRES_PASSWORD=postgres

    redis:
      image: redis:7-alpine
      restart: unless-stopped
      ports:
        - "6380:6379"
      volumes:
        - redisdata:/data

  volumes:
    argentos-state:
    argentos-workspace:
    pgdata:
    redisdata:
  ```
</CodeGroup>

## Building from Source

```bash theme={null}
git clone https://github.com/ArgentAIOS/argentos.git
cd argentos
docker build -t argentos .
```

<Info>
  The Dockerfile uses `node:22-bookworm`, installs Bun for build scripts, and runs the gateway as a non-root user for security.
</Info>

## LAN Access

By default the container binds to loopback. To expose the gateway on LAN (for mobile apps or external health checks):

<Steps>
  <Step title="Set an authentication token">
    Set `ARGENT_GATEWAY_TOKEN` or `ARGENT_GATEWAY_PASSWORD` environment variable.
  </Step>

  <Step title="Override the CMD">
    ```bash theme={null}
    docker run -d \
      --name argentos \
      -p 18789:18789 \
      -e ANTHROPIC_API_KEY=sk-ant-... \
      -e ARGENT_GATEWAY_TOKEN=your-secret-token \
      ghcr.io/argentaios/argentos:latest \
      node dist/index.js gateway --allow-unconfigured --bind lan
    ```
  </Step>
</Steps>

## Environment Variables

| Variable                     | Required | Description                                         |
| ---------------------------- | -------- | --------------------------------------------------- |
| `ANTHROPIC_API_KEY`          | Yes      | Anthropic API key for the agent                     |
| `ARGENT_GATEWAY_TOKEN`       | No       | Token for gateway authentication (required for LAN) |
| `ARGENT_GATEWAY_PASSWORD`    | No       | Password alternative to token                       |
| `ARGENT_DOCKER_APT_PACKAGES` | No       | Extra apt packages to install at build time         |
