cc-music
Self-hosted YouTube music streaming for CC:Tweaked.
yt-dlp + ffmpeg on your server. No mods beyond CC:Tweaked.
MPM is a package manager for CC:Tweaked. If you don't have it yet, install it first:
Then install and run cc-music:
cc-music is also featured in the mpm intro tutorial.
Download music.lua directly to your ComputerCraft computer:
Connects to the public backend at cc-music.shelfwood.co/api/ by default. No setup required.
Features
set_time_limit(0).
Stream full albums, long mixes, anything — audio is segmented and streamed in chunks.
| Control | Action |
|---|---|
| Click result → Play now | Stop current, play immediately |
| Click result → Play next | Insert at front of queue |
| Click result → + Queue | Append to queue |
| Stop / Play button | Pause and resume |
| Loop button | Cycle: Off → Loop Queue → Loop Song |
| Shuf button | Toggle shuffle (also shuffles existing queue) |
| Volume bar | Click or drag to adjust — applies live |
| [x] next to queue item | Remove that track |
| Paste YouTube URL | Resolves single video or entire playlist |
Self-Host the Backend
Requirements: PHP 8.x + FPM, yt-dlp, ffmpeg, Caddy.
⚠ Do not use php -S — it's single-process and breaks on concurrent requests.
curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp \
-o /usr/local/bin/yt-dlp && chmod +x /usr/local/bin/yt-dlp
git clone https://github.com/j-shelfwood/cc-music.git /opt/cc-music
Caddyfile:
handle /api/* {
root * /opt/cc-music/server
php_fastcgi unix//run/php/php8.1-fpm.sock {
read_timeout 86400s
}
rewrite * /index.php
}
}
Runs php-fpm inside the container. Point Caddy or Nginx at port 3001.
cd cc-music
docker compose up -d
Point your reverse proxy at 127.0.0.1:3001. Set read_timeout 86400s (Caddy) or proxy_read_timeout 86400 (Nginx).
Edit line 4 of music.lua:
Troubleshooting
| Symptom | Fix |
|---|---|
| "No speakers found" | Connect a speaker directly or via wired modem; restart Minecraft |
| "Network error" | Check yt-dlp and ffmpeg are in PATH; run yt-dlp -U to update |
| Audio stops after ~30s | You're using php -S — it's single-process and drops concurrent requests. Switch to php-fpm. |
| Audio stops mid-track | Reverse proxy timeout too low. Set read_timeout 86400s (Caddy) or proxy_read_timeout 86400 (Nginx). |
| Search returns empty | Run yt-dlp -U on the server; YouTube occasionally breaks yt-dlp |
| Monitor shows nothing | Must be an Advanced Monitor; plain monitors don't support colour |