Building a Pi Radio Station
A personal internet radio station that streams your own music library — running on a Raspberry Pi, accessible from any browser on your home network.
This how-to documents how I built OM3, a personal MP3 radio station that:
- Streams a large music library from a NAS drive over your local network
- Has a web UI for browsing recent plays, tagging songs, and controlling programming
- Runs a scheduled programme — morning rock, afternoon random, metal power hour at night
- Logs every song played to a SQLite database
- Runs reliably on a decade-old Raspberry Pi B+ with 512MB of RAM
The whole stack is open source and costs nothing beyond the hardware you likely already have.
How It Works
NAS (music files)
│
▼
MPD (Music Player Daemon)
│ reads files, manages queue, plays audio
▼
Icecast2 (streaming server)
│ serves the audio stream on port 8000
▼
Nginx (reverse proxy)
│ serves the web UI on port 80
│ proxies /api/ to the Python server
▼
Python API (port 5000)
│ playlist, tagging, stats, scheduling
▼
Browser (web player)
The music files live on a NAS, mounted over SMB. MPD reads them, feeds the audio to Icecast2, which serves an MP3 stream. A Python HTTP server (standard library only — no pip, no frameworks) handles the API. Nginx ties it together and serves the frontend.
A set of bash scripts handle the scheduled programming, song logging, and weekly playlist generation. Everything is orchestrated by cron.
What You'll Need
- A Raspberry Pi (any model — this runs fine on an original B+)
- A NAS or USB drive with your music collection
- A home network
- A machine to develop from (Mac or Linux)
Guide Structure
| Section | What it covers |
|---|---|
| Hardware & OS | Pi setup, Raspbian, NAS mounting |
| Software Stack | Installing MPD, Icecast2, Nginx, Python |
| Installation | Deploying the application |
| Configuration | MPD, Icecast, Nginx, and the API |
| Scheduled Programming | How the hourly scheduler works |
| Operations | Day-to-day management and recovery |