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

# Deploy with Docker

> Run AgentOS locally with Docker and PostgreSQL, then deploy to any cloud.

This template runs AgentOS and PostgreSQL with pgvector in Docker. It includes example agents ready to use after startup, hot-reload for development, and works on any cloud that supports Docker.

## Prerequisites

* [Docker Desktop](https://docker.com/desktop)
* [OpenAI API key](https://platform.openai.com)

## Development

Run locally before deploying to production.

<Steps>
  <Step title="Clone the template">
    ```bash theme={null}
    git clone \
      https://github.com/agno-agi/agentos-docker-template.git \
      agentos

    cd agentos
    ```

    The template includes the following agents:

    | Agent           | Description                                              |
    | :-------------- | :------------------------------------------------------- |
    | Knowledge Agent | Answers questions from your documents using Agentic RAG. |
    | MCP Agent       | Connects to external tools via Model Context Protocol.   |
  </Step>

  <Step title="Set your API key">
    ```bash theme={null}
    cp example.env .env
    ```

    Edit `.env` and add your `OPENAI_API_KEY`.
  </Step>

  <Step title="Start AgentOS">
    ```bash theme={null}
    docker compose up -d --build
    ```
  </Step>

  <Step title="Load knowledge">
    ```bash theme={null}
    docker exec -it agentos-api python -m agents.knowledge_agent
    ```

    This loads the default documents into the Knowledge Agent's vector database. You can add your own documents as needed.
  </Step>

  <Step title="Confirm it's running">
    Navigate to [localhost:8000/docs](http://localhost:8000/docs) to see your AgentOS API.
  </Step>

  <Step title="Connect to the control plane">
    1. Go to [os.agno.com](https://os.agno.com)
    2. Click **Connect OS** → Select **Local**
    3. Enter `http://localhost:8000`

    <Frame>
      <img className="block dark:hidden" src="https://mintcdn.com/agno-v2/Is_2Bv3MNVYdZh1v/images/agent-os-connection-dialog.png?fit=max&auto=format&n=Is_2Bv3MNVYdZh1v&q=85&s=dace555ba53468d3b5d8c8a3a50f9acb" alt="AgentOS connection dialog" width="2472" height="2408" data-path="images/agent-os-connection-dialog.png" />

      <img className="hidden dark:block" src="https://mintcdn.com/agno-v2/mJXVoP_-mVmqJ99G/images/agent-os-connection-docker.png?fit=max&auto=format&n=mJXVoP_-mVmqJ99G&q=85&s=e40e57dd9d902d455b783301b97598ca" alt="AgentOS connection dialog" width="1246" height="1322" data-path="images/agent-os-connection-docker.png" />
    </Frame>
  </Step>
</Steps>

<Check>Your AgentOS is running locally.</Check>

## Cloud Deployment

Deploy this template to any cloud that supports Docker:

| Provider     | Service                                                                                               |
| :----------- | :---------------------------------------------------------------------------------------------------- |
| AWS          | [ECS](https://aws.amazon.com/ecs/), [App Runner](https://aws.amazon.com/apprunner/)                   |
| Google Cloud | [Cloud Run](https://cloud.google.com/run), [Compute Engine](https://cloud.google.com/compute-engine/) |
| Azure        | [Container Apps](https://azure.microsoft.com/en-us/products/container-apps/)                          |
| Platforms    | [Railway](/deploy/templates/railway/deploy), [Render](https://render.com/), [Fly.io](https://fly.io/) |

Build and push your image, set the environment variables from `.env`, and ensure your PostgreSQL instance has pgvector enabled.

## Next Steps

<CardGroup cols={2}>
  <Card title="Add apps" icon="grid-2" href="/deploy/apps">
    Browse agents, teams, and workflows for your deployment.
  </Card>

  <Card title="Connect interfaces" icon="comments" href="/deploy/interfaces">
    Expose your agents on Slack, Discord, WhatsApp, or MCP.
  </Card>
</CardGroup>
