Ant Media Server is an open-source live video streaming engine that handles WebRTC, RTMP, HLS, and DASH for ultra-low-latency broadcasts. This guide deploys Ant Media Server Community Edition using Docker Compose with Traefik handling automatic HTTPS for the management panel and RTMP exposed on port 1935. By the end, you’ll have Ant Media Server accepting RTMP ingest with a secured web panel at your domain.
Set Up the Directory Structure
1. Create the project directory:
$ mkdir -p ~/ant-media-server
$ cd ~/ant-media-server
Enter fullscreen mode Exit fullscreen mode
2. Create the environment file:
$ nano .env
Enter fullscreen mode Exit fullscreen mode
DOMAIN=ant.example.com
[email protected]
Enter fullscreen mode Exit fullscreen mode
3. Download the community release archive and Dockerfile:
$ wget https://github.com/ant-media/Ant-Media-Server/releases/download/ams-v2.16.2/ant-media-server-community-2.16.2.zip
$ wget https://raw.githubusercontent.com/ant-media/Scripts/master/docker/Dockerfile_Process -O Dockerfile
Enter fullscreen mode Exit fullscreen mode
Deploy with Docker Compose
1. Create the Docker Compose manifest:
$ nano docker-compose.yaml
Enter fullscreen mode Exit fullscreen mode
services:
traefik:
image: traefik:v3.6
container_name: traefik
command:
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.web.http.redirections.entrypoint.to=websecure"
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
- "--certificatesresolvers.letsencrypt.acme.httpchallenge=true"
- "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web"
- "--certificatesresolvers.letsencrypt.acme.email=${LETSENCRYPT_EMAIL}"
- "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
volumes:
- "letsencrypt:/letsencrypt"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
restart: unless-stopped
antmedia:
build:
context: ./
dockerfile: ./Dockerfile
container_name: antmedia
entrypoint: /usr/local/antmedia/start.sh
ports:
- "1935:1935"
labels:
- "traefik.enable=true"
- "traefik.http.routers.antmedia.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.antmedia.entrypoints=websecure"
- "traefik.http.routers.antmedia.tls.certresolver=letsencrypt"
- "traefik.http.services.antmedia.loadbalancer.server.port=5080"
restart: unless-stopped
volumes:
letsencrypt:
Enter fullscreen mode Exit fullscreen mode
2. Build the Ant Media image with the downloaded release:
$ docker compose build --build-arg AntMediaServer=ant-media-server-community-2.16.2.zip
Enter fullscreen mode Exit fullscreen mode
3. Start the services:
$ docker compose up -d
Enter fullscreen mode Exit fullscreen mode
4. Verify the services are running:
$ docker compose ps
$ docker compose logs
Enter fullscreen mode Exit fullscreen mode
Access the Management Panel
Open https://ant.example.com in a browser. Create the administrator account on first launch, then create an application (default applications: LiveApp, WebRTCAppEE). Ingest streams via RTMP at rtmp://SERVER_IP/LiveApp/STREAM_KEY.
Next Steps
Ant Media Server is running with HTTPS for the panel and RTMP ingest exposed. From here you can:
- Configure WebRTC publishing/playback from the sample pages under
/LiveApp - Enable HLS and DASH playback for browser-friendly delivery
- Upgrade to Enterprise Edition for adaptive bitrate, recording, and SFU/MCU
For the full guide with additional tips, visit the original article on Vultr Docs.
답글 남기기