Build an Icecast streaming server on Heroku using Docker

Docker × Heroku


Create your Docker image

Create a new directory for your project:

mkdir your-project-name

Navigate to the directory and initialize Git repository by running:

cd your-project-name
git init

Create a new file named Dockerfile (no extension) with following content:

FROM centos:7
MAINTAINER "John Smith" <>
RUN yum -y update && yum clean all
RUN rpm -Uvh
RUN yum -y install icecast
RUN sed -ri "s/<bind-address><\/bind-address>/<bind-address><\/bind-address>/g" /etc/icecast.xml
CMD sed -ri "s/<port>8000<\/port>/<port>$PORT<\/port>/g" /etc/icecast.xml && /bin/icecast -c /etc/icecast.xml

Build & Deploy your Docker image

Install the container-registry plugin by running:

$ heroku plugins:install heroku-container-registry

Log in to the Heroku container registry:

$ heroku container:login

Create a Heroku app:

$ heroku create

Build the image and push to the Heroku container registry:

$ heroku container:push web

Open the app in your browser:

heroku open

Done! You have a powerful Icecast server on Heroku now.


Try to use your own icecast.xml in your container.

Add the ADD command to Dockerfile


RUN yum -y install icecast
ADD ./icecast-custom.xml /etc/icecast.xml

Final project files:

$ tree
├── Dockerfile
└── icecast-custom.xml

Here is my Git for your reference.


You need to concat the listening URL yourself instead of using the m3u file on Icecast page.


Document References

library/centos — Docker Hub
Heroku: Container Registry and Runtime

Heroku Acceptable Use Policy
Quota & Limits
Network Bandwidth: 2TB/month — Soft
Shared DB processing: Max 200msec per second CPU time — Soft
Dyno RAM usage: 512MB — Hard
Slug Size: 300MB — Hard
Request Length: 30 seconds — Hard