MPD-powered playback
Sits on top of Music Player Daemon — battle-tested, gapless, and supports virtually any audio format your hardware can handle.
Open source · Apache 2.0 License
Sonect wraps Music Player Daemon in a modern React interface. Self-host your entire library — browse by album, artist, or genre, control playback in real time, and never depend on a streaming service again.
Why Sonect
Built on the rock-solid MPD protocol. No subscriptions, no telemetry, no limits on your own files.
Sits on top of Music Player Daemon — battle-tested, gapless, and supports virtually any audio format your hardware can handle.
Playback changes reflect instantly across every open tab. No polling — MPD idle events pushed directly to all connected clients.
Album → artist → genre fallback fills your queue intelligently. Repeat, random, consume, and single modes are all first-class.
Artwork is extracted from your audio files, served over HTTP, and cached aggressively in the browser — never fetched twice.
Edit audio output settings and MPD config drop-ins right from the Settings page. Save once, MPD restarts automatically.
Quick start
Sonect is a pnpm monorepo. You need
Node.js 20+ and a
running MPD instance on port 6600.
Clone the repo, drop a .env in
packages/backend/ pointing at your music directory,
and start the dev server. The React frontend proxies API calls
to Express automatically.
Once running, open http://localhost:5173 and
trigger a library scan from the Settings page to populate your
collection.
Documentation
Sonect requires Node.js 20 or later and pnpm 9+. A running MPD instance is also required — Sonect does not manage MPD itself, it connects to one you provide.
apt install mpd
on Debian/Ubuntu)
6600 (default)
curl -fsSL
https://raw.githubusercontent.com/Koberum/Sonect/main/installer.sh
| sudo bash
pnpm install
pnpm dev for development, or
pnpm build for production
Create a .env file in
packages/backend/. All variables have sensible
defaults except COVERS_DIR, which you should set
to a writable directory.
| Variable | Default | Description |
|---|---|---|
| MPD_HOST | localhost | MPD server hostname or IP |
| MPD_PORT | 6600 | MPD server port |
| MUSIC_DIR | /music | Root of your music library |
| COVERS_DIR | — | Where cover JPEGs are cached |
| DB_PATH | ./data/music.db | SQLite database path |
| PORT | 3000 | Backend HTTP port |
MPD configuration is split between a root-owned
/etc/mpd.conf and a user-editable drop-in at
/opt/sonect/data/mpd-audio.conf. The drop-in is
edited from the Settings page in the UI.
Sonect is a monorepo with four packages, each with a single responsibility:
backend — Express 5 API server + WebSocket
server on port 3000
frontend — React 19 + Vite SPA on port 5173 in
development
db — SQLite schema and query layer
(Drizzle-style)
@repo/db — SQLite schema, migrations, and query
helpers
@repo/types — Shared TypeScript types (no
runtime dependencies)
The browser communicates with the backend over both HTTP (REST) and WebSocket. The WebSocket connection listens to MPD idle events and fans out state changes to all connected clients — this is what keeps every tab in sync without polling.
The Express backend exposes a REST API for library browsing and MPD control, plus a WebSocket endpoint for live state.
| Method | Path | Description |
|---|---|---|
| GET | /library/albums | List all albums |
| GET | /library/albums/:id | Get album by ID |
| GET | /library/albums/:id/tracks | Tracks for an album |
| GET | /library/artists | List all artists |
| GET | /library/artists/:id/albums | Albums for an artist |
| POST | /library/scan | Trigger library re-scan |
| POST | /mpd/play | Play a track |
| POST | /mpd/pause | Toggle pause |
| POST | /mpd/next | Skip to next track |
| PATCH | /mpd/volume | Set volume (0–100) |
| WS | ws://host:3000 | Live playback state |
Run pnpm build from the repo root to compile all
packages. The frontend is output to
packages/frontend/dist and served as static files
by the Express backend in production — no separate web server
needed.
FRONTEND_DIST to point at the built
frontend directory
node packages/backend/dist/index.js
main
MUSIC_DIR