Icecast Radio Trên VPS Offshore
Icecast là phần mềm streaming media server cho audio (và video), được sử dụng bởi hàng nghìn trạm radio internet trên thế giới. Tự dựng Icecast trên VPS offshore Iceland của AnubizHost cho phép bạn vận hành trạm radio internet, phát podcast 24/7, hoặc broadcast âm thanh cho cộng đồng mà không phụ thuộc các platform công cộng có thể kiểm duyệt nội dung. Đặc biệt phù hợp cho radio cộng đồng, religious broadcast, edu, hoặc các trạm phát nhạc không thuộc thị hiếu chính thống.
Need this done for your project?
We implement, you ship. Async, documented, done in days.
Vì Sao Vận Hành Radio Internet Riêng
Spotify, YouTube, Apple Podcasts là những platform lớn cho audio content, nhưng chúng có chính sách kiểm duyệt nghiêm ngặt và thuật toán quyết định content nào được phát hiện. Đối với nhiều loại nội dung - tin tức độc lập, thảo luận chính trị, religious content, nhạc underground - các platform này không phải kênh phù hợp.
Tự host Icecast cho radio internet mang lại ba lợi thế. Thứ nhất, kiểm soát hoàn toàn content - không lo bị demonetize, ban kênh, takedown video. Thứ hai, không có thuật toán quyết định ai nghe được - audience trực tiếp tune vào URL stream của bạn. Thứ ba, chi phí cố định thấp - một VPS Start AnubizHost $7.99/tháng có thể phục vụ vài trăm listener đồng thời.
Use case: radio cộng đồng Việt Nam ở hải ngoại phát chương trình tiếng Việt 24/7, podcast network indie với 20 show cùng schedule, religious station phát kinh và bài giảng, edu station phát học tiếng Anh/sách audio cho học sinh, nhạc underground phát nhạc indie không có trên Spotify.
Iceland location đặc biệt phù hợp vì luật bảo vệ tự do ngôn luận mạnh - không như nhiều quốc gia có thể yêu cầu lấy down content radio dựa trên khiếu nại không có căn cứ. Thanh toán crypto đảm bảo identity của broadcaster không bị gắn với trạm radio.
Cài Đặt Icecast và Source Client
Trên Ubuntu 22.04, cài Icecast2:
apt update && apt install -y icecast2
Trong wizard, đặt password cho source (encoder push), relay, admin. Sửa /etc/icecast2/icecast.xml:
<icecast>
<hostname>radio.tenmien.com</hostname>
<authentication>
<source-password>SOURCE_PWD</source-password>
<relay-password>RELAY_PWD</relay-password>
<admin-user>admin</admin-user>
<admin-password>ADMIN_PWD</admin-password>
</authentication>
<listen-socket>
<port>8000</port>
</listen-socket>
<listen-socket>
<port>8443</port>
<ssl>1</ssl>
</listen-socket>
<ssl-certificate>/etc/icecast2/cert.pem</ssl-certificate>
</icecast>
Combine fullchain + privkey Let's Encrypt thành một file cert.pem cho Icecast. Khởi động:
systemctl enable --now icecast2
Truy cập http://radio.tenmien.com:8000 - giao diện public mặc định hiện ra. /admin/ cho quản trị.
Source client - LiquidSoap: Phần mềm phổ biến để push audio tới Icecast với scheduling, jingle, crossfade, automation. Cài:
apt install -y liquidsoap
nano /etc/liquidsoap/radio.liq
Script LiquidSoap cơ bản:
set("log.file.path", "/var/log/liquidsoap/radio.log")
music = playlist("/home/radio/music/")
jingle = playlist("/home/radio/jingles/")
radio = rotate(weights=[1, 6], [jingle, music])
radio = crossfade(radio)
output.icecast(%mp3(bitrate=128),
host="localhost", port=8000,
password="SOURCE_PWD",
mount="stream",
name="Anubiz Radio",
genre="Various",
url="https://radio.tenmien.com",
description="24/7 community radio",
radio)
Khởi động liquidsoap, audio bắt đầu stream tới Icecast tự động.
Scheduling, Live Shows và Player Embed
Một trạm radio chuyên nghiệp cần scheduling phức tạp: 24/7 nhạc background + slot live show vào giờ cố định + thông báo định kỳ.
Scheduling với LiquidSoap:
music = playlist("/home/radio/music/")
news = playlist("/home/radio/news/")
# Live input from external encoder
live = input.harbor("live", port=8005, password="LIVE_PWD")
radio = switch([
({ 0h-1h }, news), # 00:00-01:00 daily: news
({ 19h-21h }, live), # 19:00-21:00 daily: accept live broadcast
({ true }, music) # else: background music
])
Live broadcaster (DJ) sử dụng BUTT (Broadcast Using This Tool) hoặc Mixxx push tới harbor port 8005 với password. LiquidSoap tự switch sang live khi có input, switch về music khi live disconnect.
Multiple streams (mount points): Icecast hỗ trợ nhiều mount point đồng thời. Tạo /stream_high (320kbps), /stream_mid (128kbps), /stream_low (64kbps) cho user băng thông khác nhau. LiquidSoap output đồng thời nhiều mount.
Web player: Embed player HTML5 vào website:
<audio controls>
<source src="https://radio.tenmien.com:8443/stream" type="audio/mpeg">
</audio>
Hoặc dùng player open-source như Howler.js, Plyr với playlist support, now-playing display.
Now playing: LiquidSoap update metadata title/artist mỗi khi đổi bài, Icecast expose qua endpoint /status-json.xsl. Frontend poll endpoint này để hiển thị "Đang phát: Artist - Title" realtime.
Listener stats: Icecast admin panel hiển thị số listener current, total, peak, geographic distribution (qua GeoIP). Export logs cho phân tích chi tiết.
Mobile apps: Cho audience iOS/Android cài app dedicated, dùng Bubble, AppyPie, hoặc tự phát triển React Native. Sử dụng URL stream của Icecast.
Backup uplink: Cho trạm 24/7 quan trọng, deploy LiquidSoap trên 2 VPS với Icecast master-slave. Nếu master down, slave tự promote và tiếp tục phát.
Related Services
Why Anubiz Host
Ready to get started?
Skip the research. Tell us what you need, and we'll scope it, implement it, and hand it back — fully documented and production-ready.