> ## 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.

# Agno Infra

The Agno Infra SDK applies best practices to take your AgentOS to production. It lets you define, deploy, and manage your entire Agentic System as Python code. This library is used by the [AWS template](https://github.com/agno-agi/agent-infra-aws) to manage your infrastructure with support for more cloud providers coming soon.

## Create a new Agno Infra project

Run `ag infra create` to create a new infra project, the command will ask your for a starter template and infra project name.

<CodeGroup>
  ```bash Create Infra Project theme={null}
  ag infra create
  ```
</CodeGroup>

And select a template from the list of available templates.

## Start infra resources

Run `ag infra up` to start i.e. create infra resources. This will start your AgentOS instance and PostgreSQL database locally using docker.

<CodeGroup>
  ```bash terminal theme={null}
  ag infra up
  ```

  ```bash shorthand theme={null}
  ag infra up dev:docker
  ```

  ```bash full options theme={null}
  ag infra up --env dev --infra docker
  ```

  ```bash short options theme={null}
  ag infra up -e dev -i docker
  ```
</CodeGroup>

## Stop infra resources

Run `ag infra down` to stop i.e. delete infra resources

<CodeGroup>
  ```bash terminal theme={null}
  ag infra down
  ```

  ```bash shorthand theme={null}
  ag infra down dev:docker
  ```

  ```bash full options theme={null}
  ag infra down --env dev --infra docker
  ```

  ```bash short options theme={null}
  ag infra down -e dev -i docker
  ```
</CodeGroup>

## Patch infra resources

Run `ag infra patch` to patch i.e. update infra resources

<CodeGroup>
  ```bash terminal theme={null}
  ag infra patch
  ```

  ```bash shorthand theme={null}
  ag infra patch dev:docker
  ```

  ```bash full options theme={null}
  ag infra patch --env dev --infra docker
  ```

  ```bash short options theme={null}
  ag infra patch -e dev -i docker
  ```
</CodeGroup>

<br />

<Note>
  The `patch` command in under development for some resources. Use `restart` if needed
</Note>

## Restart infra

Run `ag infra restart` to stop resources and start them again

<CodeGroup>
  ```bash terminal theme={null}
  ag infra restart
  ```

  ```bash shorthand theme={null}
  ag infra restart dev:docker
  ```

  ```bash full options theme={null}
  ag infra restart --env dev --infra docker
  ```

  ```bash short options theme={null}
  ag infra restart -e dev -i docker
  ```
</CodeGroup>

## Command Options

<Note>Run `ag infra up --help` to view all options</Note>

### Environment (`--env`)

Use the `--env` or `-e` flag to filter the environment (dev/prd)

<CodeGroup>
  ```bash flag theme={null}
  ag infra up --env dev
  ```

  ```bash shorthand theme={null}
  ag infra up dev
  ```

  ```bash short options theme={null}
  ag infra up -e dev
  ```
</CodeGroup>

### Infra (`--infra`)

Use the `--infra` or `-i` flag to filter the infra (docker/aws/k8s)

<CodeGroup>
  ```bash flag theme={null}
  ag infra up --infra docker
  ```

  ```bash shorthand theme={null}
  ag infra up :docker
  ```

  ```bash short options theme={null}
  ag infra up -i docker
  ```
</CodeGroup>

### Group (`--group`)

Use the `--group` or `-g` flag to filter by resource group.

<CodeGroup>
  ```bash flag theme={null}
  ag infra up --group app
  ```

  ```bash full options theme={null}
  ag infra up \
    --env dev \
    --infra docker \
    --group app
  ```

  ```bash shorthand theme={null}
  ag infra up dev:docker:app
  ```

  ```bash short options theme={null}
  ag infra up \
    -e dev \
    -i docker \
    -g app
  ```
</CodeGroup>

### Name (`--name`)

Use the `--name` or `-n` flag to filter by resource name

<CodeGroup>
  ```bash flag theme={null}
  ag infra up --name app
  ```

  ```bash full options theme={null}
  ag infra up \
    --env dev \
    --infra docker \
    --name app
  ```

  ```bash shorthand theme={null}
  ag infra up dev:docker::app
  ```

  ```bash short options theme={null}
  ag infra up \
    -e dev \
    -i docker \
    -n app
  ```
</CodeGroup>

### Type (`--type`)

Use the `--type` or `-t` flag to filter by resource type.

<CodeGroup>
  ```bash flag theme={null}
  ag infra up --type container
  ```

  ```bash full options theme={null}
  ag infra up \
    --env dev \
    --infra docker \
    --type container
  ```

  ```bash shorthand theme={null}
  ag infra up dev:docker:app::container
  ```

  ```bash short options theme={null}
  ag infra up \
    -e dev \
    -i docker \
    -t container
  ```
</CodeGroup>

### Dry Run (`--dry-run`)

The `--dry-run` or `-dr` flag can be used to **dry-run** the command. `ag infra up -dr` will only print resources, not create them.

<CodeGroup>
  ```bash flag theme={null}
  ag infra up --dry-run
  ```

  ```bash full options theme={null}
  ag infra up \
    --env dev \
    --infra docker \
    --dry-run
  ```

  ```bash shorthand theme={null}
  ag infra up dev:docker -dr
  ```

  ```bash short options theme={null}
  ag infra up \
    -e dev \
    -i docker \
    -dr
  ```
</CodeGroup>

### Show Debug logs (`--debug`)

Use the `--debug` or `-d` flag to show debug logs.

<CodeGroup>
  ```bash flag theme={null}
  ag infra up -d
  ```

  ```bash full options theme={null}
  ag infra up \
    --env dev \
    --infra docker \
    -d
  ```

  ```bash shorthand theme={null}
  ag infra up dev:docker -d
  ```

  ```bash short options theme={null}
  ag infra up \
    -e dev \
    -i docker \
    -d
  ```
</CodeGroup>

### Force recreate images & containers (`-f`)

Use the `--force` or `-f` flag to force recreate images & containers

<CodeGroup>
  ```bash flag theme={null}
  ag infra up -f
  ```

  ```bash full options theme={null}
  ag infra up \
    --env dev \
    --infra docker \
    -f
  ```

  ```bash shorthand theme={null}
  ag infra up dev:docker -f
  ```

  ```bash short options theme={null}
  ag infra up \
    -e dev \
    -i docker \
    -f
  ```
</CodeGroup>

## Developer Resources

* [CLI Reference](/reference/agno-infra/cli/ws/create)
