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

# Deploy Command

> Deploy ElizaOS projects to AWS ECS (Elastic Container Service)

## Usage

```bash theme={null}
elizaos deploy [options]
```

Deploy your ElizaOS project to AWS ECS through ElizaOS Cloud. This command builds a Docker image, pushes it to ECR, and creates an ECS service.

## Options

| Option | Description | Default |
| - | - | - |
| `-n, --name <name>` | Name for the deployment | - |
| `--project-name <name>` | Project name | Directory name |
| `-p, --port <port>` | Port the container listens on | `3000` |
| `--desired-count <count>` | Number of container instances to run (1-10) | `1` |
| `--cpu <units>` | CPU units (256-2048) | `1792` |
| `--memory <mb>` | Memory in MB (512-2048) | `1792` |
| `-k, --api-key <key>` | ElizaOS Cloud API key | - |
| `-u, --api-url <url>` | ElizaOS Cloud API URL | `https://www.elizacloud.ai` |
| `-e, --env <KEY=VALUE>` | Environment variable (repeatable) | - |
| `--skip-build` | Skip Docker build, use existing image | `false` |
| `--image-uri <uri>` | Use existing ECR image URI (requires `--skip-build`) | - |
| `--platform <platform>` | Docker platform for build | Host platform |

## Resource Defaults

The default CPU and memory settings (1792 units each) are optimized for AWS t4g.small instances:

* **CPU**: 1792 units = 1.75 vCPU (87.5% of t4g.small's 2 vCPUs)
* **Memory**: 1792 MB = 1.75 GiB (87.5% of t4g.small's 2 GiB)

## Examples

### Basic Deployment

```bash theme={null}
# Deploy current project with defaults
elizaos deploy

# Deploy with a specific name
elizaos deploy --name my-agent-prod

# Deploy with custom port
elizaos deploy --port 8080
```

### Resource Configuration

```bash theme={null}
# Deploy with increased resources
elizaos deploy --cpu 2048 --memory 2048

# Deploy multiple instances for high availability
elizaos deploy --desired-count 3

# Deploy with minimal resources
elizaos deploy --cpu 256 --memory 512
```

### Environment Variables

```bash theme={null}
# Pass single environment variable
elizaos deploy -e OPENAI_API_KEY=sk-xxx

# Pass multiple environment variables
elizaos deploy \
  -e OPENAI_API_KEY=sk-xxx \
  -e DISCORD_TOKEN=xxx \
  -e DATABASE_URL=postgres://...
```

### Advanced Options

```bash theme={null}
# Skip build and use existing image
elizaos deploy --skip-build --image-uri 123456789.dkr.ecr.us-east-1.amazonaws.com/my-agent:latest

# Build for specific platform (cross-compilation)
elizaos deploy --platform linux/amd64

# Build for ARM (Graviton instances)
elizaos deploy --platform linux/arm64
```

### Custom API Endpoint

```bash theme={null}
# Deploy to custom ElizaOS Cloud instance
elizaos deploy --api-url https://custom.elizacloud.ai --api-key your-key
```

## Deployment Output

On successful deployment, the command outputs:

* **Container ID**: Unique identifier for your deployment
* **Service ARN**: AWS ECS service Amazon Resource Name
* **Task Definition ARN**: AWS ECS task definition ARN
* **Service URL**: Public URL to access your agent

## Validation

The command validates options before deployment:

| Option | Valid Range |
| - | - |
| `--port` | 1-65535 |
| `--desired-count` | 1-10 |
| `--cpu` | 256-2048 |
| `--memory` | 512-2048 |

## Authentication

Deployment requires authentication with ElizaOS Cloud:

```bash theme={null}
# Login first (recommended)
elizaos login

# Or provide API key directly
elizaos deploy --api-key your-api-key
```

## Related Commands

* [`login`](/cli-reference/login): Authenticate with ElizaOS Cloud
* [`containers`](/cli-reference/containers): Manage deployed containers
* [`start`](/cli-reference/start): Run locally before deploying


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.