Skip to main content

Prerequisites

  • An API key for at least one AI provider (OpenAI, Anthropic, Google, etc.)
  • Optional: Docker Desktop — for Docker MCP tools and Docker Model Runner

Install docker-agent

Starting with Docker Desktop 4.63+, docker-agent is pre-installed. No separate installation needed.Open a terminal and verify:
docker agent version
Docker Desktop bundles docker-agent and keeps it up to date automatically. This is the easiest way to get started, especially if you want to use Docker MCP tools or Docker Model Runner for local models.

Set up API keys

docker-agent needs at least one API key for the AI provider you want to use. Set it as an environment variable before running any agents.
export OPENAI_API_KEY="sk-..."        # OpenAI
export ANTHROPIC_API_KEY="sk-ant-..." # Anthropic
export GOOGLE_API_KEY="AI..."         # Google Gemini
export MISTRAL_API_KEY="..."          # Mistral
You only need the key for the provider configured in your agent YAML. If you use Docker Model Runner for local models, no API key is required.
To persist your API key across sessions, add the export line to your shell profile (~/.bashrc, ~/.zshrc, or equivalent).

Verify the installation

# Check the installed version
docker agent version

# Run the default built-in agent
docker agent run

# Try a pre-built agent from the catalog
docker agent run agentcatalog/pirate

What’s next

Quickstart

Create and run your first agent in under 5 minutes.

Troubleshooting

Debug mode, common issues, and solutions.

Build docs developers (and LLMs) love