Cara install Icecast di ubuntu server

Install dan Konfigurasi Icecast2

Untuk Install Icecast2, sangat mudah. Kita tinggal jalankan perintah seperti di bawah

sudo apt-get install icecast2

Setelah proses installasi selesai, maka langkah selanjutnya adalah mengedit file icecast.xml yang ada di rektory /ect/icecast2

        <!-- Sources log in with username 'source' -->
        <!-- Relays log in username 'relay' -->
        <!-- Admin logs in with the username given below -->

Setingan default di atas sudah cukup, kita tinggal rubah password di bagian
<authentication>…</authentication >, pada bagian source-password, adalah password yang di gunakan oleh encoder untuk connect ke icecast server.

Langkah selanjutnya adalah, mengedit file /etc/default/icecast2

# Defaults for icecast2 initscript
# sourced by /etc/init.d/icecast2
# installed at /etc/default/icecast2 by the maintainer scripts
# This is a POSIX shell fragment
# Full path to the server configuration file
# Name or ID of the user and group the daemon should run under
# Edit /etc/icecast2/icecast.xml and change at least the passwords.
# Change this to true when done to enable the init.d script

Setelah selesai, sekarang kita bisa mulai menjalankan Icecast2 server.

sudo /etc/init.d/icecast2 start

Sekarang kita bisa langsung buka melalui browser ke (ganti IP dengan ip komputer yang di gunakan untuk install icecast.)

Install dan Konfigurasi Ices2

Untuk melakukan installasi Ices2 di ubuntu mudah sekali, jalankan perintah

  • sudo apt-get install ices2
  • sudo mkdir /var/log/ices
  • sudo mkdir /etc/ices2
  • sudo mkdir /etc/ices2/music

direktori /var/log/ices (untuk file log dari ices2), /etc/icecs2 (untuk menyimpan file file konfigurasi ices2) dan /etc/ices2/music (menyimpan file .ogg)

aplikasi ices2 memiliki 3 contoh file konfigurasi yang bisa di pakai,
/usr/share/doc/ices2/examples/ices-alsa.xml, /usr/share/doc/ices2/examples/ices-oss.xml, dan /usr/share/doc/ices2/examples/ices-playlist.xml. bisa pilih salah satu, sesuaikan dengan kebutuhan.

sudo cp /usr/share/doc/ices2/examples/ices-playlist.xml /etc/ices2

edit file

<?xml version="1.0"?>
    <!-- run in background -->
    <!-- where logs, etc go. -->
    <!-- 1=error,2=warn,3=info,4=debug -->
    <!-- set this to 1 to log to the console instead of to the file above -->
    <!-- optional filename to write process id to -->
    <!-- <pidfile>/home/ices/</pidfile> -->
        <!-- metadata used for stream listing (not currently used) -->
            <name>Example stream name</name>
            <genre>Example genre</genre>
            <description>A short description of your stream</description>
        <!-- input module
            The module used here is the playlist module - it has
            'submodules' for different types of playlist. There are
            two currently implemented, 'basic', which is a simple
            file-based playlist, and 'script' which invokes a command
            to returns a filename to start playing. -->
            <param name="type">basic</param>
            <param name="file">/etc/ices2/playlist.txt</param>
            <!-- random play -->
            <param name="random">0</param>
            <!-- if the playlist get updated that start at the beginning -->
            <param name="restart-after-reread">0</param>
            <!-- if set to 1 , plays once through, then exits. -->
            <param name="once">0</param>
                <!-- Stream instance
            You may have one or more instances here. This allows you to
            send the same input data to one or more servers (or to different
            mountpoints on the same server). Each of them can have different
            parameters. This is primarily useful for a) relaying to multiple
            independent servers, and b) encoding/reencoding to multiple
            If one instance fails (for example, the associated server goes
            down, etc), the others will continue to function correctly.
            This example defines two instances as two mountpoints on the
            same server.  -->
            <!-- Server details:
                You define hostname and port for the server here, along with
                the source password and mountpoint.  -->
            <!-- Reconnect parameters:
                When something goes wrong (e.g. the server crashes, or the
                network drops) and ices disconnects from the server, these
                control how often it tries to reconnect, and how many times
                it tries to reconnect. Delay is in seconds.
                If you set reconnectattempts to -1, it will continue
                indefinately. Suggest setting reconnectdelay to a large value
                if you do this.
            <!-- maxqueuelength:
                This describes how long the internal data queues may be. This
                basically lets you control how much data gets buffered before
                ices decides it can't send to the server fast enough, and
                either shuts down or flushes the queue (dropping the data)
                and continues.
                For advanced users only.
            <!-- Live encoding/reencoding:
                Currrently, the parameters given here for encoding MUST
                match the input data for channels and sample rate. That
                restriction will be relaxed in the future.
                <nominal-bitrate>64000</nominal-bitrate> <!-- bps. e.g. 64000 for 64 kbps -->

Setelah melakukan konfigurasi di atas, letakkan file file .ogg ke dalam direktory /etc/ices2/music

Kemudian, buat file /etc/ices2/playlist.txt dan letakkan path file .ogg, baris perbaris

sudo gedit /etc/ices2/playlist.txt


Kemudian jalankan Ices2

sudo ices2 /etc/ices2/ices-playlist.xml

Setelah menjalankan perintah di atas, sekarang kita akan menemukan link audio stream baru
(untuk mendengar, akses ->, tetapi ):

Untuk menghentikan Ices2

sudo kill -9 `pidof ices2`

Modifikasi Init Script Icecast2

Ices2 tidak memiliki init script, artinya kita harus start/stop secara terpisah dari icecast2

sudo gedit /etc/init.d/icecast2

#! /bin/sh
# icecast2
#                Written by Miquel van Smoorenburg <[email protected]>.
#                Modified for Debian
#                by Ian Murdock <[email protected]>.
#                Further modified by Keegan Quinn <[email protected]>
#                for use with Icecast 2
test -x $DAEMON || exit 0
# Defaults
# Reads config file (will override defaults above)
if [ "$ENABLE" != "true" ]; then
        echo "$NAME daemon disabled - read $CONFIGDEFAULTFILE."
        exit 0
set -e
case "$1" in
        echo -n "Starting $DESC: "
        start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \
                --exec $DAEMON -- -b -c $CONFIGFILE
        sleep 3
        start-stop-daemon --start --quiet --exec $ICES $ICES_CONFIGFILE
        echo "$NAME."
        echo -n "Stopping $DESC: "
        start-stop-daemon --stop --oknodo --quiet --exec $ICES
        start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
        echo "$NAME."
        echo "Reloading $DESC configuration files."
        start-stop-daemon --stop --oknodo --quiet --exec $ICES
        start-stop-daemon --stop --signal 1 --quiet --exec $DAEMON
        sleep 3
        start-stop-daemon --start --quiet --exec $ICES $ICES_CONFIGFILE
        echo -n "Restarting $DESC: "
        start-stop-daemon --stop --oknodo --quiet --exec $ICES
        start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
        sleep 3
        start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \
                --exec $DAEMON -- -b -c $CONFIGFILE
        sleep 3
        start-stop-daemon --start --quiet --exec $ICES $ICES_CONFIGFILE
        echo "$NAME."
        echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
        exit 1
exit 0

Sekarang Ices2 akan start/stop ketika Icecast di start/stop.

Bagi kalian yang nggak mau ribet untuk maintenance Icecast Server, silahkan serahkan saja urusan icecast server ini ke ArenaStreaming, harganya murah kok… silahkan langsung cek link di

Share this Post
Mohammad Johan Rajabi

Saat ini bekerja di salah satu perusahaan Media Broadcasting nasional, di sela-sela kesibukan sebagai Chief Of IT, sering mengisi waktu dengan menulis seputar dunia IT dan Broadcast di beberapa website, dan

Leave a Reply

Your email address will not be published. Required fields are marked *

WP Radio
WP Radio