MCPSERV.CLUB
Icecast 2

Icecast 2

Self-Hosted

Open‑source streaming media server for radio and more

Stale(40)
0stars
0views

Overview

Discover what makes Icecast 2 powerful

Icecast 2 is a mature, open‑source streaming media server written primarily in C. It accepts incoming streams encoded in Ogg (Vorbis, Theora), Opus, WebM and MP3, and forwards them to HTTP/HTTPS clients with low latency. The core of Icecast is a single‑process daemon that handles socket I/O, authentication, and stream scheduling. It exposes a lightweight HTTP API for status monitoring and administration, and its configuration is driven by an XML file (`icecast.xml`) that defines listeners, mounts, authentication realms, and SSL settings. Because the daemon is stateless across restarts (except for persisted listener statistics), it scales horizontally by running multiple instances behind a load balancer, each handling a subset of mountpoints.

Multi‑format support

Robust authentication

TLS/SSL

Web dashboard

Overview

Icecast 2 is a mature, open‑source streaming media server written primarily in C. It accepts incoming streams encoded in Ogg (Vorbis, Theora), Opus, WebM and MP3, and forwards them to HTTP/HTTPS clients with low latency. The core of Icecast is a single‑process daemon that handles socket I/O, authentication, and stream scheduling. It exposes a lightweight HTTP API for status monitoring and administration, and its configuration is driven by an XML file (icecast.xml) that defines listeners, mounts, authentication realms, and SSL settings. Because the daemon is stateless across restarts (except for persisted listener statistics), it scales horizontally by running multiple instances behind a load balancer, each handling a subset of mountpoints.

Key Features

  • Multi‑format support – Native decoding and re‑encoding are not performed; Icecast simply passes through packets, which keeps CPU usage minimal. New codecs can be added via the format plugin system without recompiling the core.
  • Robust authentication – Supports Basic, Digest, and custom realm‑based password hashing. Passwords can be stored in flat files or external databases (e.g., MySQL) via the auth plugin.
  • TLS/SSL – Requires TLS 1.2+ for client connections, with support for modern cipher suites and certificate management.
  • Web dashboard – A built‑in HTML/JavaScript interface provides real‑time stream health metrics, listener statistics, and configuration editing.
  • Health reporting – Stream metadata (bitrate, codec, title) is exposed via HTTP endpoints and can be consumed by third‑party services.

Technical Stack

  • Language: C (core) + optional scripting in Lua for dynamic configuration.
  • Libraries: libigloo (utility library), openssl for TLS, apr/pcre for regex handling.
  • Data storage: SQLite or flat‑file for authentication; optional MySQL/PostgreSQL via the auth_mysql plugin.
  • Plugins: Shared objects (.so) loaded at runtime; the architecture is designed for extensibility (e.g., format, auth, http plugins).

Deployment & Infrastructure

Icecast is lightweight (≈ 20 MB binary, < 50 MB RAM footprint) and runs on Linux, BSD, macOS, and Windows. It can be containerized with Docker; the official image exposes ports 8000 (HTTP) and 8443 (HTTPS). For high‑availability, deploy multiple instances behind a reverse proxy like Nginx or HAProxy, using sticky sessions per mountpoint. Horizontal scaling is straightforward because each instance can be configured to serve distinct source or listener pools.

Integration & Extensibility

Developers can hook into Icecast’s event system via the http and format plugins. A custom plugin can, for example, forward stream metadata to a REST API or trigger a media transcoder. Webhooks are available through the http plugin, allowing external services to react to stream start/stop events. The configuration XML can be generated programmatically, enabling CI/CD pipelines to spin up temporary streaming environments for testing.

Developer Experience

  • Documentation – Comprehensive online docs and a FAQ section cover configuration, plugin development, and troubleshooting. The source code is well‑commented, making it approachable for contributors.
  • Community – Active mailing lists and an IRC channel provide quick support. The project is maintained by Xiph.Org, which also hosts other open‑source media projects (Opus, FLAC, Theora).
  • Licensing – GPL‑v2 ensures that any derived work remains open source, which is attractive for academic or hobbyist projects.

Use Cases

  • Internet radio stations – Publish live or scheduled audio streams with minimal latency.
  • Private jukeboxes – Host a self‑contained music server for LAN or remote access.
  • Multimedia archives – Stream recorded video sessions (WebM/Theora) with metadata dashboards.
  • Testing environments – Deploy containerized instances for automated streaming tests or CI pipelines.

Advantages

Icecast offers a high‑performance, low‑overhead streaming solution that is highly configurable and extensible. Its pure C implementation ensures minimal CPU usage, while the plugin architecture allows developers to add custom functionality without touching the core. The built‑in web interface and health reporting simplify monitoring, and the open‑source license removes cost barriers. Compared to commercial streaming servers, Icecast gives developers full control over the stack and the ability to integrate seamlessly with other open‑source media tools.

Open SourceReady to get started?

Join the community and start self-hosting Icecast 2 today