Skip to main content
Ant Media Server runs on Linux and requires Java 17. This guide covers installation on Ubuntu, CentOS, and other Linux distributions.

System requirements

Before installing Ant Media Server, ensure your system meets these requirements:

Minimum requirements

  • Operating System: Ubuntu 18.04+, CentOS 7+, or compatible Linux distribution
  • CPU: 2 cores (4+ cores recommended for production)
  • RAM: 4 GB (8+ GB recommended for production)
  • Disk Space: 10 GB free space
  • Java: OpenJDK 17
  • Network: Open ports 5080 (HTTP), 5443 (HTTPS), 1935 (RTMP), 5000-65000 (UDP for WebRTC)
  • CPU: 8+ cores
  • RAM: 16+ GB
  • Network: 1 Gbps connection
  • Storage: SSD with 100+ GB
Resource usage scales with concurrent streams. For high-traffic deployments, consider cluster mode for horizontal scaling.

Installation on Linux

Quick installation

The fastest way to install Ant Media Server is using the official installation script:
The installation script will:
  1. Create an antmedia user and group
  2. Install files to /usr/local/antmedia
  3. Configure systemd service
  4. Set up log directory at /var/log/antmedia
  5. Start the service automatically
The default installation directory is /usr/local/antmedia. All commands in this guide assume this path.

Installation with options

You can customize the installation by starting the server with specific options:

Available options

boolean
default:"false"
Use global (public) IP in network communication
boolean
default:"false"
Use public IP as server name
boolean
default:"false"
Replace candidate address with server name
string
Server mode: standalone or cluster
string
MongoDB or Redis connection string (e.g., mongodb://username:password@host:port or redis://username:password@host:port)
string
License key for Enterprise Edition
string
TURN/STUN server URL (e.g., stun:stun.l.google.com:19302 or turn:turn.example.com:3478)
string
default:"-Xms1g"
JVM memory options (e.g., -Xms2g -Xmx8g)
number
default:"75"
CPU limit percentage (server reports high resource usage above this threshold)
number
default:"75"
Memory limit percentage (server reports high resource usage above this threshold)

Example configurations

Systemd service configuration

Ant Media Server runs as a systemd service. The service file is located at /lib/systemd/system/antmedia.service.

Service management

Environment variables

You can configure JVM memory options by editing the service file:
Modify the JVM_MEMORY_OPTIONS environment variable:
After modifying, reload and restart:
Always ensure Xms (initial heap) is less than or equal to Xmx (maximum heap). Setting Xms equal to Xmx can improve performance by avoiding dynamic heap resizing.

Server configuration

The main configuration file is located at /usr/local/antmedia/conf/red5.properties.

Key configuration options

Common configuration tasks

Edit /usr/local/antmedia/conf/red5.properties:
Restart the service:
Adjust CPU and memory thresholds to prevent resource exhaustion:
These settings prevent the server from accepting new streams when resources are constrained.
For servers behind NAT or load balancers:
Or in red5.properties:

Enable SSL

SSL/TLS is required for WebRTC in production. Ant Media Server includes a built-in SSL configuration script.

Automatic SSL with Let’s Encrypt

This script will:
  1. Install Certbot if not present
  2. Obtain certificates from Let’s Encrypt
  3. Configure Ant Media Server to use the certificates
  4. Set up automatic renewal

Manual SSL configuration

If you have your own certificates:
Verify these settings:
Restart the service:
After enabling SSL, access the dashboard at https://yourdomain.com:5443

Cluster mode

For high-availability and scaling, you can run Ant Media Server in cluster mode using MongoDB or Redis.

Prerequisites

  • MongoDB 4.0+ or Redis 6.0+
  • Multiple Ant Media Server instances
  • Load balancer (recommended)

Configuration

  1. Set up MongoDB or Redis:
  1. Start server in cluster mode:
  1. Verify cluster status:
Check the dashboard or use the REST API:
All servers in the cluster must use the same database connection string and license key.

Post-installation verification

After installation, verify everything is working correctly:

Check service status

Expected output:

Verify ports are listening

You should see:
  • Port 5080 (HTTP)
  • Port 5443 (HTTPS)
  • Port 1935 (RTMP)

Access the dashboard

Open your browser:

Check logs

Test streaming

Use the pre-installed LiveApp application:
Play the stream:

Cloud deployment options

Ant Media Server is available on major cloud platforms:

AWS

Deploy on Amazon Web Services

Azure

Deploy on Microsoft Azure

Google Cloud

Deploy on Google Cloud Platform

AWS CloudFormation

For auto-scaling clusters on AWS:
Check out the 5-minute auto-scaling guide for detailed CloudFormation setup.

Troubleshooting

Check Java installation:
Verify log directory permissions:
Check for port conflicts:
Verify the service is running:
Check firewall rules:
Check if the port is listening:
WebRTC requires HTTPS. Verify SSL is configured:
Open UDP ports for WebRTC:
Configure STUN/TURN server in application settings:
Adjust resource limits in /usr/local/antmedia/conf/red5.properties:
Increase JVM heap size:
Add:
Reload and restart:

Next steps

Getting help

If you encounter issues: