How to Deploy Ant Media Server – Live Video Streaming

Ant Media Server is a real-time media streaming platform that supports WebRTC, RTMP, HLS, and low-latency live streaming. It is commonly used for live broadcasts, interactive video applications, and real-time communication workloads.
This article explains how to deploy Ant Media Server using Docker Compose, build the image from the official Dockerfile, and expose the web interface securely using Traefik with HTTPS.
Prerequisites
Before you begin, you need to:
- Have access to an Ubuntu 24.04-based server as a non-root user with
sudoprivileges. - Install Docker and Docker Compose.
- Create a DNS A record pointing to your server’s IP address (for example,
ant.example.com).
Set Up the Directory Structure and Environment Variables
In this section, you create the project directory for Ant Media Server and define the environment variables required by Docker Compose and Traefik.
Create the project directory.
console$ mkdir -p ~/ant-media-server
Navigate to the project directory.
console$ cd ~/ant-media-server
Create a
.envfile to store environment variables.console$ nano .env
Add the following variables.
iniDOMAIN=ant.example.com LETSENCRYPT_EMAIL=admin@example.com
Replace:
ant.example.comwith your domain name.admin@example.comwith your email address.
Save and close the file.
Deploy with Docker Compose
In this section, you deploy Ant Media Server using Docker Compose. You download the required release archive and Dockerfile, define the services for Ant Media Server and Traefik, build the container image, and start the stack with HTTPS enabled through Traefik.
Download the Ant Media Server release archive.
console$ wget https://github.com/ant-media/Ant-Media-Server/releases/download/ams-v2.16.2/ant-media-server-community-2.16.2.zip
To download the latest Ant Media server archive visit the official GitHub releases page.NoteDownload the Ant Media Dockerfile.
console$ wget https://raw.githubusercontent.com/ant-media/Scripts/master/docker/Dockerfile_Process -O Dockerfile
Create the Docker Compose manifest.
console$ nano docker-compose.yaml
Add the following content to the file.
yamlservices: 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:
Build the Ant Media Server docker image.
console$ docker compose build --build-arg AntMediaServer=ant-media-server-community-2.16.2.zip
Replace
ant-media-server-community-2.16.2.zipwith your release archive name if different.Start the services.
console$ docker compose up -d
Verify that the services are running.
console$ docker compose ps
View the logs for the services.
console$ docker compose logs
For more information on managing a Docker Compose stack, see the How To Use Docker Compose article.
Access the Ant Media Server Dashboard
Open the Ant Media web interface in your browser.
https://ant.example.comEnter your first name, last name, username, and a strong password to complete the initial administrator account setup.
After the administrator account is created, Ant Media Server redirects you to the login page.

Log in using the administrator credentials and use the dashboard to create live streams, manage applications, and monitor streaming statistics.
Conclusion
You successfully deployed the Ant Media Server using Docker Compose and Traefik. The server was built from the official Dockerfile, exposed securely using HTTPS, and made accessible through a custom domain. This setup provides a production-ready foundation for real-time streaming and WebRTC-based applications.