Back to Guides

Deploy AnythingMCP on AWS (EC2)

Deploy AnythingMCP on an AWS EC2 instance with Docker Compose and automatic SSL via Caddy. Production-ready setup for your MCP gateway.

Prerequisites

  • An AWS account with EC2 permissions
  • A domain name you can point to your server
  • An SSH key pair in your AWS region

Launch an EC2 Instance

  1. Open the EC2 Dashboard and click Launch Instance
  2. Choose Ubuntu 24.04 LTS AMI
  3. Instance type: t3.small (2 vCPU, 2 GB) or t3.medium for heavier workloads
  4. Storage: at least 20 GB gp3
  5. Security group — add these inbound rules:

| Port | Protocol | Source | Purpose | |------|----------|--------|---------| | 22 | TCP | Your IP | SSH | | 80 | TCP | 0.0.0.0/0 | HTTP (Caddy redirect) | | 443 | TCP | 0.0.0.0/0 | HTTPS |

  1. Launch and allocate an Elastic IP to the instance

Install Docker

ssh -i ~/.ssh/your-key.pem ubuntu@ELASTIC_IP
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER
newgrp docker

Configure DNS

Create an A record pointing your domain to the Elastic IP (Route 53 or external DNS):

| Record | Type | Value | |--------|------|-------| | mcp.example.com | A | ELASTIC_IP |

Deploy AnythingMCP

git clone https://github.com/HelpCode-ai/anythingmcp.git
cd anythingmcp
bash setup.sh

Enter your domain when prompted. The script configures Caddy for automatic SSL and starts all services.

Verify & Next Steps

Open https://mcp.example.com. Register your admin account — the first user becomes administrator.

Your MCP endpoint: https://mcp.example.com/mcp

# Update to latest version
git pull && docker compose up -d --build