How to set up Wowza Streaming Engine using Docker

Wowza Media Systems™ provides Wowza Streaming Engine™ media server software images on Docker Hub that are ready to start using with Docker. This article describes how to run Wowza Streaming Engine software in a local Linux Docker container.

Note: For more information about Docker, see Understanding Docker.

Contents


Get started with Docker
License Wowza Streaming Engine on Docker
Wowza Streaming Engine images for Docker
Create a Wowza Streaming Engine media server
Connect to the media server
Stop the media server
Troubleshooting

Get started with Docker


Before you can install and use Wowza Streaming Engine media server software, you must install Docker on the platform you've decided to use for your media server. After Docker is installed, you must verify that the installation is working as expected. To do this, open a terminal and run a Docker command such as:
docker version
Where:
  • docker tells your operating system that you're using the Docker program
     
  • version is a command that returns the installed version of Docker.
If you aren't familiar with Docker images and containers, we recommend walking through the Docker hello-world example and then the Docker whalesay example before continuing.

License Wowza Streaming Engine on Docker


You must bring your own license (BYOL) for the Wowza Streaming Engine software. With a BYOL license, you can use any Wowza Streaming Engine Subscription or Perpetual license key with your Docker container. BYOL licensees have access to all Wowza Streaming Engine functionality and features, including Wowza Transcoder (for 64-bit instances only), Wowza nDVR, and Wowza DRM.

Wowza Streaming Engine images for Docker


Wowza Media Systems provides Wowza Streaming Engine media server software images for use with Linux Docker containers to Docker Hub in the wowzamedia/wowza-streaming-engine-linux repository. Within the repository, you can click on the Tag tab at the top of the page to see a list of the available versions of Wowza Streaming Engine software.
 
Note: The latest Wowza Streaming Engine media server software image is Wowza Streaming Engine 4.6.0. See the Wowza Streaming Engine 4.6.0 Release Notes.
Open a terminal and run the following command to pull the version of the Wowza Streaming Engine image from Docker Hub that you want to run:
docker pull wowzamedia/wowza-streaming-engine-linux:[version]
Where [version] is replaced with a tag name from the Wowza Streaming Engine repository or latest, which pulls the most recent version.

Create a Wowza Streaming Engine media server


After installing Docker and pulling the version of the Wowza Streaming Engine repository that you want to run, open a terminal and run a command similar to the following to create a local container and run the Wowza Streaming Engine image that you pulled from Docker Hub:
 
docker run -it --name [container-name] --entrypoint /sbin/entrypoint.sh [repository]:[version]
where:
 
  • docker run first creates a writeable container and starts using the specified commands.
     
  • -it or -d:
    -it instructs Docker to allocate a pseudo-TTY connected to the container's stdin.

    -d instructs Docker to run the container in the background and print the container ID.
  • --name assigns a name to the local container that's created. This command isn't required, but we recommend using it because it simplifies container management.
     
  • --entrypoint overwrites the default entrypoint of the image.
     
  • [repository]:[version] is the name of the repository on Docker Hub (wowzamedia/wowza-streaming-engine-linux) and the Wowza Streaming Engine software version that you pulled. Replace [version] with the tag name from the repository or latest. If you don't specify a version, latest is used.
     
    Notes:
    • The latest repository version is defined by the repository owner. It isn't guaranteed to be the most recent version of the repository's software.
       
    • If environment variables aren't specified in the command, the Wowza Streaming Engine Manager username and password both default to wowza, a Wowza Streaming Engine Trial license is used, and the media server IP address defaults to localhost. For more information, see Additional parameters, below.
       
    • If you don't expose ports, Wowza Streaming Engine Manager won't be accessible.

Additional parameters

There are additional parameters that you can choose to add to the command which expose ports, enable external access to the container, and define environment variables. For example:
 
docker run -it --name [container-name] --restart always --expose 1935/tcp --expose 8086/tcp --expose 8087/tcp --expose 8088/tcp --publish 1935:1935 --publish 8086:8086 --publish 8087:8087 --publish 8088:8088 --volume /Users/me/Documents/logs:/usr/local/WowzaStreamingEngine/logs --entrypoint /sbin/entrypoint.sh --env WSE_MGR_USER=[username] --env WSE_MGR_PASS=[password] --env WSE_LIC=[license] --env WSE_IP_PARAM=[wowza-ip-address] [repository]:[version]
where:
 
  • --restart specifies a restart policy to apply when the container exits. --restart always means the container always restarts upon exit regardless of the exit status.
     
  • --expose enables inter-container communication. For example, the wowzamedia/wowza-streaming-engine-linux container includes two processes (Wowza Streaming Engine and the Wowza Streaming Engine Manager) that you'll probably want to communicate with each other.
     
  • --publish enables external access to the container and the processes running in the container.
     
  • --volume binds the mount volumes for use with Wowza Streaming Engine. This command isn't required, but we recommend using it because it prevents to the log files from filling up the container's primary hard drive. Examples of mount volumes you might want to bind for logs:
     
    • --volume /Users/me/Documents/logs1:/usr/local/WowzaStreamingEngine/logs
       
    • --volume /Users/me/Documents/logs2:/usr/local/WowzaStreamingEngine/manager/logs
       
    • --volume /Users/me/Documents/logs3:/supervisor/supervisord.log
  • --env sets an environment variable. The following environment variables are optional runtime configurations:
     
    • --env WSE_MGR_USER specifies a username for Wowza Streaming Engine Manager. In this example, the username is admin. If this parameter isn't used, the username defaults to wowza.
       
    • --env WSE_MGR_PASS specifies a password for Wowza Streaming Engine Manager. Replace [password] with the password you want to use. If this parameter isn't included, the password defaults to wowza.
       
    • --env WSE_LIC is your Wowza Streaming Engine license. Replace [license] with your license code. If this parameter isn't used or an invalid license is provided, the software will operate in Trial mode.
       
    • --env WSE_IP_PARAM specifies the internal IP address for the container. Replace [wowza-ip-address] with the IP address you're assigning to the container. If this parameter isn't used, the IP address defaults to localhost.
       
      Note: Docker doesn't support IPv6 addresses. You must use an IPv4 address.

Connect to the media server


After you've executed the docker run command to create the Wowza Streaming Engine container, you can use a new terminal window to manage the container(s).

List containers

To list the running containers, execute the following command:

docker ps
Append -a or --all to the command to list all containers regardless of their status:
docker ps -a

Log in to the image

When the container is running, you can use the following command to log in to the image:

docker exec -it [container-name] bash

where exec runs a command within a container and [container-name] is the name of the container.

Inspect the container

If you want detailed information about a running container, such as the container state, container configuration, environment and network information, etc., execute the following command:

docker inspect [container-name]

Stop the media server


When you're finished using the container, use the following command to stop the container:
docker stop [container-name]
Note: A stopped container can be restarted using the start command:
docker start [container-name]. Logs and libraries persist when a container is stopped, so you can resume using it without reconfiguring the container.
If you don't intend to use the container again, it's important that you remove the container and the container artifacts after stopping it. Use the following command:
 
IMPORTANT: The remove command is permanent. You can't recover a container that you have removed.
docker rm [container-name]

Troubleshooting


The following commands can be useful when troubleshooting and cleaning up unwanted Docker containers and artifacts.
 
  • Untagged containers - To view a list of untagged containers, execute the following command:
    docker images | grep "^<none>" | awk "{print $3}"
    After reviewing the list of untagged containers, you can use the following command to remove the listed containers:
    docker rmi -f $(docker images | grep "^<none>" | awk "{print $3}")
  • Exited containers - To view a list of containers that you have exited, execute the following command:
    docker ps -a | grep "Exited" | awk '{print $1}'
    After reviewing the list, you can use the following command to remove all of the listed containers:
      docker rm -f $(docker ps -a | grep "Exited" | awk '{print $1}')
  • Stopped containers - To view a list of all stopped containers, execute the following command:
    docker ps -a -q
    After reviewing the list, you can use the following command to remove all of the listed containers:
    docker rm $(docker ps -a -q)
  • Configure supervisor - You can use the /etc/supervisor/conf.d/WowzaStreamingEngine.conf file to configure the process manager (supervisor). You might also want to mount a volume for supervisor-related logs (--volume /Users/me/Documents/logs3:/supervisor/supervisord.log).

Originally Published: for Wowza Streaming Engine 4.5.0 on 10-03-2016.
Updated: For Wowza Streaming Engine 4.6.0 on 12-19-2016.
 

If you're having problems or want to discuss this article, post in our forum.