Skip to main content

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

The fastest way to deploy Ant Media Server on AWS is through the AWS Marketplace:

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.medium or t3a.medium
  • vCPUs: 2
  • Memory: 4 GB
  • Network: Moderate bandwidth
Recommended for Production:
  • Instance Type: c5.xlarge, c5.2xlarge, or c6i.xlarge
  • vCPUs: 4-8
  • Memory: 8-16 GB
  • Network: Up to 10 Gbps
  • Enhanced Networking: Enabled
High-Performance Streaming:
  • 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

1

Access AWS Marketplace

  1. Log into your AWS Console
  2. Navigate to AWS Marketplace
  3. Search for “Ant Media Server”
  4. Select Community or Enterprise Edition
2

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
3

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
4

Access Web Panel

Once the instance is running:
  1. Get the public IP from EC2 dashboard
  2. Open browser to http://PUBLIC_IP:5080
  3. Create admin account on first access

Manual EC2 Installation

1

Launch EC2 Instance

Create a new EC2 instance:
2

Connect to Instance

SSH into your instance:
3

Install Ant Media Server

Download and run the installation script:
4

Verify Installation

Check if the service is running:
Access the web panel at http://YOUR_INSTANCE_PUBLIC_IP:5080

Security Group Configuration

Required Inbound Rules

Create a security group with the following inbound rules:

Using AWS CLI

For production, restrict port 22 (SSH) to specific IP addresses only. Avoid using 0.0.0.0/0 for SSH access.

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:
Set:
Restart the service:

CloudFormation Auto-Scaling Deployment

Quick Deploy with CloudFormation

Deploy a complete auto-scaling cluster in 5 minutes using AWS CloudFormation.
1

Access CloudFormation Template

Use the official Ant Media Server CloudFormation template:
2

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
3

Deploy Stack

  1. Review all parameters
  2. Acknowledge IAM resource creation
  3. Click Create Stack
  4. Monitor stack creation (10-15 minutes)
4

Access Load Balancer

Once stack is complete:
  1. Get the Load Balancer DNS from Outputs tab
  2. Access dashboard: http://LOAD_BALANCER_DNS:5080

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:
Mount the volume:

S3 Integration

Configure S3 for stream recording storage:
Configure in Ant Media Server application settings via web panel or API.

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:
  1. Request certificate in ACM
  2. Validate domain ownership
  3. Attach certificate to ALB listener
  4. Configure ALB to forward to instances on port 5080

Using Let’s Encrypt on EC2

Monitoring and CloudWatch

Enable CloudWatch Logs

Install CloudWatch agent:
Configure log collection:

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

  1. Check security group rules
  2. Verify Elastic IP association
  3. Check instance status in EC2 console
  4. Review system logs in EC2 console

WebRTC Connection Issues

  1. Verify UDP ports 5000-65000 are open
  2. Check public IP configuration
  3. Ensure server.name is set correctly
  4. Test with STUN/TURN servers

Performance Issues

  1. Monitor CloudWatch metrics
  2. Check instance type is appropriate
  3. Verify EBS volume performance
  4. Review application logs

Next Steps