Overview

This guide walks you through deploying an AI assistant powered by Google Gemini using Docker Deployment. You'll configure the provider, set up the deployment environment, and get your assistant running.

Why Google Gemini?

  • 1M token context window
  • Multimodal understanding
  • Fast inference

Why Docker Deployment?

  • Portable
  • Reproducible
  • Isolation

Requirements

  • Docker: Docker Engine 20.10+
  • Docker Compose: For multi-container orchestration
  • Google Gemini credentials: API key or authentication

Step 1: Configure Google Gemini

Google AI API key

  1. Go to ai.google.dev
  2. Create or select a project
  3. Enable the Gemini API
  4. Generate an API key
  5. Set GOOGLE_API_KEY environment variable
Environment Variable: GOOGLE_API_KEY

Step 2: Prepare Docker Deployment Environment

  1. Create Dockerfile: Create a Dockerfile for OpenClaw
  2. Create docker-compose.yml: Set up Docker Compose configuration
  3. Build Image: Build the Docker image
    docker compose build
  4. Start Container: Start the container
    docker compose up -d
  5. Run Onboarding: Complete setup inside container
    docker compose exec openclaw openclaw onboard

Step 3: Configuration

Create your openclaw.json configuration:

{
  "agents": {
    "defaults": {
      "model": {
        "primary": "google-gemini/gemini-2.0-flash-exp"
      }
    }
  },
  "models": {
    "providers": {
      "google-gemini": {
  "models": {
    "providers": {
      "google-gemini": {
        "apiKey": "${GOOGLE_API_KEY}
    }
  }
}

Step 4: Deploy

# docker-compose.yml
version: '3.8'
services:
  openclaw:
    image: node:22-slim
    command: ["sh", "-c", "npm install -g openclaw@latest && openclaw gateway"]
    ports:
      - "18789:18789"
    volumes:
      - openclaw_data:/root/.openclaw
    environment:
      - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
    restart: unless-stopped

volumes:
  openclaw_data:

Step 5: Verify

# Check deployment status
openclaw status

# View logs
openclaw logs --follow

# Test with a message
openclaw test "Hello, are you working?"

Connect to Channels

Now connect your deployed Google Gemini assistant to messaging channels: