How to Deploy Ant Media Server – Live Video Streaming

Updated on 18 December, 2025
Learn how to deploy Ant Media Server with Docker Compose and Traefik to enable secure, low-latency live streaming.
How to Deploy Ant Media Server – Live Video Streaming header image

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:

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.

  1. Create the project directory.

    console
    $ mkdir -p ~/ant-media-server
    
  2. Navigate to the project directory.

    console
    $ cd ~/ant-media-server
    
  3. Create a .env file to store environment variables.

    console
    $ nano .env
    
  4. Add the following variables.

    ini
    DOMAIN=ant.example.com
    LETSENCRYPT_EMAIL=admin@example.com
    

    Replace:

    • ant.example.com with your domain name.
    • admin@example.com with 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.

  1. 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
    
    Note
    To download the latest Ant Media server archive visit the official GitHub releases page.
  2. Download the Ant Media Dockerfile.

    console
    $ wget https://raw.githubusercontent.com/ant-media/Scripts/master/docker/Dockerfile_Process -O Dockerfile
    
  3. Create the Docker Compose manifest.

    console
    $ nano docker-compose.yaml
    
  4. Add the following content to the file.

    yaml
    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:
    
  5. 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.zip with your release archive name if different.

  6. Start the services.

    console
    $ docker compose up -d
    
  7. Verify that the services are running.

    console
    $ docker compose ps
    
  8. 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

  1. Open the Ant Media web interface in your browser.

    https://ant.example.com
  2. Enter your first name, last name, username, and a strong password to complete the initial administrator account setup.

  3. After the administrator account is created, Ant Media Server redirects you to the login page.

    Ant Media Server Login page

  4. 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.

Tags:

Comments