Overview
Ant Media Server can be deployed on Amazon Web Services (AWS) using multiple methods: EC2 instances with manual installation, AWS Marketplace one-click deployment, or automated CloudFormation templates for auto-scaling clusters.Deployment Methods
AWS Marketplace (Recommended)
The fastest way to deploy Ant Media Server on AWS is through the AWS Marketplace:- Community Edition: AWS Marketplace Link
- Enterprise Edition: AWS Marketplace Link
Manual EC2 Installation
Deploy on a standard EC2 instance using the Linux installation script.CloudFormation Auto-Scaling
Use CloudFormation templates to deploy a complete auto-scaling cluster in minutes.EC2 Instance Requirements
Instance Types
Minimum Requirements (Testing/Development):- Instance Type:
t3.mediumort3a.medium - vCPUs: 2
- Memory: 4 GB
- Network: Moderate bandwidth
- Instance Type:
c5.xlarge,c5.2xlarge, orc6i.xlarge - vCPUs: 4-8
- Memory: 8-16 GB
- Network: Up to 10 Gbps
- Enhanced Networking: Enabled
- Instance Type:
c5n.2xlarge,c6i.4xlarge - vCPUs: 8-16
- Memory: 16-32 GB
- Network: 25-50 Gbps
- EBS-Optimized: Yes
Operating System
Supported AMIs:- Ubuntu Server 20.04 LTS (HVM)
- Ubuntu Server 22.04 LTS (HVM)
- Amazon Linux 2
- Red Hat Enterprise Linux 8/9
Ubuntu 20.04 LTS or 22.04 LTS is recommended for best compatibility.
Storage
- Root Volume: 20 GB minimum (GP3 recommended)
- Additional Volume: 50-500 GB for recorded streams (GP3 or io2)
- IOPS: 3000+ IOPS for production workloads
Quick Start: AWS Marketplace Deployment
Access AWS Marketplace
- Log into your AWS Console
- Navigate to AWS Marketplace
- Search for “Ant Media Server”
- Select Community or Enterprise Edition
Configure Instance
Click Continue to Subscribe then Continue to Configuration:
- Region: Select your preferred AWS region
- Software Version: Latest version
- Fulfillment Option: CloudFormation or EC2
Launch Instance
Configure launch parameters:
- Instance Type: c5.xlarge (or as needed)
- VPC and Subnet: Select or create
- Security Group: Configure or use default
- Key Pair: Select existing or create new
Manual EC2 Installation
Security Group Configuration
Required Inbound Rules
Create a security group with the following inbound rules:| Type | Protocol | Port Range | Source | Description |
|---|---|---|---|---|
| HTTP | TCP | 5080 | 0.0.0.0/0 | Web Panel HTTP |
| HTTPS | TCP | 5443 | 0.0.0.0/0 | Web Panel HTTPS |
| Custom TCP | TCP | 1935 | 0.0.0.0/0 | RTMP |
| Custom TCP | TCP | 8443 | 0.0.0.0/0 | RTMPS (if SSL enabled) |
| Custom UDP | UDP | 5000-65000 | 0.0.0.0/0 | WebRTC Media |
| SSH | TCP | 22 | Your IP | SSH Access |
Using AWS CLI
Elastic IP Configuration
Assign an Elastic IP for a static public IP address:Configure Server Name
Update the server configuration with your Elastic IP or domain:CloudFormation Auto-Scaling Deployment
Quick Deploy with CloudFormation
Deploy a complete auto-scaling cluster in 5 minutes using AWS CloudFormation.Access CloudFormation Template
Use the official Ant Media Server CloudFormation template:
Configure Parameters
Key CloudFormation parameters:
- Instance Type: c5.xlarge or larger
- Min/Max Instances: Auto-scaling limits (e.g., 2-10)
- License Key: Your Enterprise license key
- VPC and Subnets: Network configuration
- Key Pair: SSH key for instances
- SSL Certificate: Optional ACM certificate ARN
Deploy Stack
- Review all parameters
- Acknowledge IAM resource creation
- Click Create Stack
- Monitor stack creation (10-15 minutes)
CloudFormation Stack Components
The auto-scaling stack creates:- Application Load Balancer (ALB): Distributes traffic across instances
- Auto Scaling Group: Scales instances based on CPU/memory
- Launch Template: Defines instance configuration
- DocumentDB or MongoDB: Cluster database (Enterprise)
- Security Groups: Network security configuration
- CloudWatch Alarms: Monitoring and alerts
- Target Groups: Health checking and routing
Storage Configuration
EBS Volume for Recordings
Attach additional EBS volume for stream recordings:S3 Integration
Configure S3 for stream recording storage:Database Configuration (Enterprise)
DocumentDB (MongoDB-compatible)
Configure Cluster Mode
Switch to cluster mode with DocumentDB:SSL/TLS Configuration
Using AWS Certificate Manager (ACM)
For load balancer SSL termination:- Request certificate in ACM
- Validate domain ownership
- Attach certificate to ALB listener
- Configure ALB to forward to instances on port 5080
Using Let’s Encrypt on EC2
Monitoring and CloudWatch
Enable CloudWatch Logs
Install CloudWatch agent:CloudWatch Metrics
Monitor key metrics:- CPU Utilization
- Network In/Out
- Disk I/O
- Memory Usage (with CloudWatch agent)
- Custom metrics via API
IAM Roles and Permissions
Required IAM Permissions
Create an IAM role for EC2 instances with these policies:Cost Optimization
Use Spot Instances
For non-critical workloads, use EC2 Spot Instances:Reserved Instances
For production workloads, purchase Reserved Instances for up to 72% savings.Right-Sizing
Monitor instance metrics and adjust instance type based on actual usage.Backup and Disaster Recovery
Automated EBS Snapshots
Multi-Region Deployment
For high availability, deploy across multiple AWS regions:- Primary region: us-east-1
- Failover region: us-west-2
- Use Route 53 for DNS failover
Troubleshooting
Instance Not Accessible
- Check security group rules
- Verify Elastic IP association
- Check instance status in EC2 console
- Review system logs in EC2 console
WebRTC Connection Issues
- Verify UDP ports 5000-65000 are open
- Check public IP configuration
- Ensure server.name is set correctly
- Test with STUN/TURN servers
Performance Issues
- Monitor CloudWatch metrics
- Check instance type is appropriate
- Verify EBS volume performance
- Review application logs
