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

# Docker Compose Installation

> The recommended way to deploy Chibi using Docker Compose.

## Prerequisites

* **Docker & Docker Compose:** [Install Docker](https://docs.docker.com/get-docker/).
* **Telegram Bot Token:** Get one from [@BotFather](https://t.me/BotFather).
* **API Keys:** At least one provider key (OpenAI, Gemini, Anthropic, etc.).

## Installation

### 1. Create a Project Directory

Create a folder for your bot and enter it:

```bash theme={null}
mkdir my-chibi-bot
cd my-chibi-bot
```

### 2. Create Configuration File (.env)

Create a file named `.env` and add your credentials.

```bash theme={null}
touch .env
```

**Example `.env` content:**

```dotenv theme={null}
# .env

# --- Telegram Bot ---
TELEGRAM_BOT_TOKEN=your_telegram_bot_token_here

# --- AI Providers (Add the ones you have) ---
OPENAI_API_KEY=sk-...
GEMINI_API_KEY=AIza...
ANTHROPIC_API_KEY=sk-ant-...

# --- Security ---
# Comma-separated list of allowed Telegram User IDs
USERS_WHITELIST=123456789
```

### 3. Create Docker Compose File

Create a file named `docker-compose.yml` with the following content. This tells Docker how to run Chibi.

```yaml theme={null}
version: '3.8'

services:
  chibi:
    image: pysergio/chibi:latest
    container_name: chibi
    restart: unless-stopped
    env_file:
      - .env
    volumes:
      - chibi_data:/app/data

volumes:
  chibi_data:
```

You can read more about Agent configuration here: [core settings](/configuration/core-settings)
You can get the env file template with all available settings here: [.env template](/configuration/env-template)

### 4. Start the Bot

Run the following command to download the image and start the bot in the background:

```bash theme={null}
docker-compose up -d
```

Check the logs to ensure everything is running smoothly:

```bash theme={null}
docker-compose logs -f
```

## Updating

To update Chibi to the latest version:

```bash theme={null}
# Download the latest image
docker-compose pull

# Restart the container with the new image
docker-compose up -d
```

## Troubleshooting

* **Container keeps restarting:** Check logs with `docker-compose logs`. Usually indicates a missing API key or invalid token.
* **Permissions errors:** Ensure the user running docker has permissions to create volumes.
