Icecast is a modular free audio server, written in C++. Icecast itself is can't deal with audio formats and requires add-ons called "sources" to do. in this guide, we use ices as our source.


$ doas pkg_add ices-0.4p12 icecast

edit /var/icecast/icecast.xml


replace username and Earth with your values.


replace source-passowrd and admin-password with a secure passoword and chanage username to your prefered value.


replace with your domain. note that icecast can only listen to IPv4 or IPv6 (and not both)

    <mount type="normal">

each stream on icecast is called a mount, we will connect to mounts using our sources

        <alias source="/" destination="/status.xsl"/>
      <!--  <ssl-certificate>/var/icecast/etc/icecast.pem</ssl-certificate> -->

here we configure paths, and ssl for port 8443. note that ssl certificate should have both private and public cert on same file. you can do that using:

# cat /path/to/public/cert.pem /path/to/private/key.key > /var/icecast/etc/icecast.pem

you might need to change permissions afterwards. and that will create it on /var/icecast/etc/icecast.pem

        <!-- <playlistlog>playlist.log</playlistlog> -->
        <loglevel>3</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error -->
        <logsize>10000</logsize> <!-- Max size of a logfile -->

now, run and enable icecast

$ doas rcctl enable icecast
$ doas rcctl start icecast


There are multiple sources available for icecast, ezstream and ices being developed by xiph community, which happens to be same community behind icecast too. ezstreams appears to be somewhat more modern, easier to configure and more featureful.


First you need to install ezstream itself:

$ doas pkg_add ezstream

here is a sample configuration file:

<?xml version="1.0" encoding="UTF-8"?>





      <program>oggdec -R -b 16 -e 1 -s 1 -o - @T@</program>
      <!-- File extensions to use this decoder for -->

      <program>madplay -b 16 -R 44100 -S -o raw:- @T@</program>

      <program>flac -s -d --force-raw-format --sign=signed --endian=little -o - @T@</program>

      <program>faad -d -f 2 -w @T@</program>


adjust servers, source, and intakes as your needs. decoders are needed to handle input audio files, and may need some extra programs to be installed (madplay, etc). afterwards you need to generate a playlist (in m3u format), fortunately m3u format is quite simple:

$ find /path/to/your/music/library >> playlist.m3u

it will also include directories too, but ezstream will skip them:

ezstream[26202]: /path/to/your/music/library cannot determine file type

finally, to run ezstream:

$ ezstream -c ezstream.xml

for further example configurations ezstream also ships with some samples, they are located in /usr/local/share/examples/ezstream.


Currently there are two versions of Ices on OpenBSD repos, one is 0.4 and another one is 2.0 version 2.0 only supports ogg files and version 0.4 supports both ogg and mp3 formats but it is quite old and might have security issues, if you can, please use ezstream, we will show how to use version 0.4 nonetheless. take a backup of /etc/ices.conf:

$ doas cp /etc/ices.conf /etc/ices.conf.bk

Open /etc/ices.conf

<?xml version="1.0"?>
<ices:Configuration xmlns:ices="">



    <Name>My radio</Name>
    <Description>This is my radio</Description>

ices accepts m3u playlists, so you may use same script we used for ezstream playlists

$ find /path/to/your/music/library | egrep '(ogg|mp3)$' | doas tee -a /etc/playlist.m3u

note that they can include spaces as well. afterwards, run ices

$ doas ices -c /etc/ices.conf

then you can point your media player or browser to and enjoy.


We could use mpd to livestream with Icecast.

First, install mpd & mpc:

$ doas pkg_add mpd mpc

Edit /etc/mpd.conf

# Files and directories #######################################################
# This setting controls the top directory which MPD will search to discover the
# available audio files and add them to the daemon's online database. This
# setting defaults to the XDG directory, otherwise the music directory will be
# be disabled and audio files will only be accepted over ipc socket (using
# file:// protocol) or streaming files over an accepted protocol.
music_directory         "/please-configure-your-music_directory"

Replace /please-configure-your-music_directory to your path to Music folders. Eg. /home/user/Music

audio_output {
        type            "shout"
        encoder         "vorbis"                # optional, vorbis or lame
        name            "My Shout Stream"
        host            "localhost"
        port            "8000"
        mount           "/radio"
        password        "hackme"
#        quality         "5.0"
        bitrate         "128"
        format          "44100:16:1"
#        protocol        "icecast2"              # optional
#        user            "source"                # optional
        description     "My Stream Description" # optional
        url             ""    # optional
        genre           "jazz"                  # optional
        public          "no"                    # optional
#        timeout         "2"                     # optional
#        mixer_type      "software"              # optional

Change some values according your needs. Then, Enable & start mpd daemon

$ doas rcctl enable mpd
$ doas rcctl start mpd

Now, populate the database. Depending on how many tracks are in your library this may take a while. The -w makes it wait until it's finished.

$ mpc -w update

Next, make a playlist

$ mpc add /

Then start playing

$ mpc play

To make the playlist randomly play for evermore.

$ mpc random
$ mpc repeat

And finally, visit and enjoy.