Overview
Ant Media Server can be installed on various Linux distributions including Ubuntu, Debian, CentOS, Rocky Linux, and AlmaLinux. This guide covers the complete installation process, system requirements, and post-installation configuration.System Requirements
Minimum Hardware Requirements
- CPU: 2 cores (4+ cores recommended for production)
- RAM: 4GB minimum (8GB+ recommended for production)
- Storage: 20GB minimum free disk space
- Network: Public IP address with required ports open
Software Requirements
-
Operating Systems:
- Ubuntu 20.04 LTS or later
- Debian 10 or later
- CentOS 8 or later
- Rocky Linux 8 or 9
- AlmaLinux 8 or 9
- Java: OpenJDK 17 (installed automatically)
- Required packages: jq, dnsutils/bind-utils, iptables
Network Requirements
The following ports must be open in your firewall:| Port | Protocol | Purpose |
|---|---|---|
| 5080 | TCP | HTTP (Web Panel, REST API) |
| 5443 | TCP | HTTPS (Web Panel, REST API) |
| 1935 | TCP | RTMP |
| 8443 | TCP | RTMPS (if SSL enabled) |
| 5000-65000 | UDP | WebRTC (media streams) |
Installation Steps
Download the Installation Script
Download the latest Ant Media Server installation script from the official repository:
Run the Installation
Execute the installation script with root privileges:The script will:
- Install OpenJDK 17 if not already installed
- Download the latest Ant Media Server package
- Extract and configure the server
- Create the
antmediasystem user and group - Set up systemd service
- Configure necessary permissions
Verify Installation
Check if the Ant Media Server service is running:You should see output indicating the service is active and running.
Default Installation Directory
Ant Media Server is installed to:Directory Structure
Service Management
Ant Media Server runs as a systemd service namedantmedia.
Start the Service
Stop the Service
Restart the Service
Check Service Status
Enable Auto-start on Boot
View Logs
View real-time logs:Systemd Service Configuration
The service file is located at/lib/systemd/system/antmedia.service.
Key service configuration details:
- User/Group: antmedia
- Working Directory: /usr/local/antmedia
- File Descriptor Limit: 65536-524288
- Tasks Max: 64000
- Restart Policy: on-failure with 5s delay
- Java Home: /usr/lib/jvm/java-17-openjdk-amd64
Firewall Configuration
Ubuntu/Debian (UFW)
CentOS/Rocky/AlmaLinux (firewalld)
iptables (Manual Configuration)
If you’re using iptables directly:Configuration Files
Main Server Configuration
Location:/usr/local/antmedia/conf/red5.properties
Key configuration parameters:
Application Configuration
Location:/usr/local/antmedia/webapps/{APP_NAME}/WEB-INF/red5-web.properties
Each application (LiveApp, WebRTCAppEE) has its own configuration file for app-specific settings.
JVM Memory Configuration
By default, Ant Media Server uses-Xms1g for initial heap size. To customize memory settings:
Edit the Service File
Using start.sh (Manual Mode)
If running manually with start.sh:Server Configuration Options
Thestart.sh script supports various configuration options:
Example: Configure Public IP
Example: Cluster Mode with MongoDB
Post-Installation Tasks
Configure SSL/TLS
For production environments, enable SSL. See the SSL Setup guide.
Set Up License Key (Enterprise)
If using Enterprise Edition, add your license key:Set:Restart the service:
Upgrading
To upgrade to a newer version:Uninstallation
To completely remove Ant Media Server:- Stop the antmedia service
- Remove the systemd service file
- Delete the installation directory
- Remove the antmedia user and group
