2026-11-18 · navidrome · music · docker · self-hosting
Self-Host Navidrome with Docker: Your Own Music Streaming Server
Run Navidrome in Docker Compose to stream your music library to any Subsonic/Airsonic client, with persistent volumes, reverse proxy, and backups.
- Total RAM
- 26.1 MB
- Startup
- 55.8 s
- Port
- 4533
- HTTP
- 302
What Navidrome does and what it needs
Navidrome is a self-hosted music server and streamer. Point it at a folder of audio files, and it indexes the metadata, watches for changes, and serves your library over the Subsonic/Airsonic API plus a modern web UI. Any Subsonic-compatible mobile or desktop client works against it, and it handles very large collections, multi-user libraries, playlists, favorites, and on-the-fly transcoding.
The runtime is a single Go binary shipped as the navidrome/navidrome image. It needs ffmpeg for transcoding, which is already bundled in the official image, so you do not install it on the host. State lives in a data directory (SQLite database, cache, artwork) and your music lives wherever you mount it. The upstream project does not publish a minimum memory figure; idle footprint is small, and memory scales with library size, concurrent streams, and transcoding jobs.
Prerequisites, ports, and volume constraints
- Docker Engine 24+ and the Compose plugin.
- A host directory holding your music, readable by the container user. Navidrome only reads from it; it never writes to your library.
- A writable data directory for the SQLite DB, cache, and generated artwork. This is the volume you back up.
- Port
4533is Navidrome’s default HTTP port. In this setup it is bound to127.0.0.1:4533so only a local reverse proxy can reach it. ND_MUSICFOLDERmust point at the in-container mount path (default/music), not the host path.- If you test without a domain, either temporarily change the port mapping to
4533:4533or open an SSH tunnel:ssh -L 4533:127.0.0.1:4533 user@your-vpsand browsehttp://localhost:4533.
Production Docker Compose setup
Create the project directory and the two host paths first:
mkdir -p /opt/navidrome/data
mkdir -p /srv/music # put your audio files here
cd /opt/navidrome
Generate a strong secret for the session signer and write the .env file:
cat <<'EOF' > .env
ND_MUSICFOLDER=/music
ND_PORT=4533
ND_LOGLEVEL=info
ND_SESSIONTIMEOUT=24h
ND_SCANSCHEDULE=1h
ND_BASEURL=
ND_SESSION_SECRET=REPLACE_ME
TZ=UTC
EOF
SECRET=$(openssl rand -hex 32)
sed -i "s|REPLACE_ME|$SECRET|" .env
chmod 600 .env
Write the Compose file:
cat <<'EOF' > compose.yml
services:
navidrome:
image: navidrome/navidrome:latest
container_name: navidrome
restart: unless-stopped
ports:
- "127.0.0.1:${ND_PORT:-4533}:4533"
environment:
ND_MUSICFOLDER: ${ND_MUSICFOLDER:-/music}
ND_PORT: 4533
ND_LOGLEVEL: ${ND_LOGLEVEL:-info}
ND_SESSIONTIMEOUT: ${ND_SESSIONTIMEOUT:-24h}
ND_SCANSCHEDULE: ${ND_SCANSCHEDULE:-1h}
ND_BASEURL: ${ND_BASEURL:-}
ND_SESSION_SECRET: ${ND_SESSION_SECRET}
TZ: ${TZ:-UTC}
volumes:
- navidrome_data:/data
- navidrome_music:/music:ro
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:4533/ping"]
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
volumes:
navidrome_data:
navidrome_music:
EOF
Start it and confirm the health endpoint:
docker compose up -d
docker compose ps
docker compose logs -f navidrome
curl -s http://127.0.0.1:4533/ping
On first launch Navidrome creates the SQLite database in ./data and starts scanning /music. The first admin account is created from the web UI at /app — do that before exposing the service publicly.
Reverse proxy, HTTPS, and first-run hardening
Navidrome streams audio and serves the web UI over plain HTTP. Terminate TLS in front of it. The important details for this app:
- Proxy to
http://127.0.0.1:4533and forwardHost,X-Forwarded-For,X-Forwarded-Proto, andX-Real-IP. Navidrome uses these to build correct stream URLs for Subsonic clients. - If you serve under a subpath (e.g.
/music), setND_BASEURL=/musicin.envand restart. Without it, the web UI and API links break behind a path prefix. - Raise the body size limit. Album art uploads and large playlist imports go through the same proxy; 50 MB is a safe ceiling.
- Do not enable aggressive buffering on
/rest/streamresponses. Audio streaming and transcoding are long-lived; disable proxy buffering for that path so playback starts immediately. - WebSocket support is not required by Navidrome itself, but keep
Upgrade/Connectionheaders intact if you add other services on the same vhost.
Example Caddy vhost:
music.example.com {
encode gzip
request_body {
max_size 50MB
}
reverse_proxy 127.0.0.1:4533 {
flush_interval -1
}
}
First-run hardening checklist:
- Create the admin user through the UI while the port is still bound to localhost.
- In Settings, disable open signups if you do not want strangers registering; Navidrome lets the admin create users manually.
- Keep
ND_SESSION_SECRETunique per deployment and out of version control. Rotating it invalidates existing sessions. - Restrict
/srv/musicto read-only for the container (already done with:ro) and keep the host directory owned by a user that only you control.
Updating, backups, and common pitfalls
Update to the latest release:
docker compose pull
docker compose up -d
docker compose logs --tail=50 navidrome
Back up the state directory. The SQLite database, cache, and generated artwork all live in ./data:
tar czf navidrome-data-$(date +%F).tar.gz -C /opt/navidrome data
Stop the container before archiving if you want a consistent SQLite snapshot: docker compose stop navidrome && tar czf ... && docker compose start navidrome. Your music library is not part of this backup — back it up separately with whatever tool you already use.
Two pitfalls worth knowing:
- Wrong music path. Setting
ND_MUSICFOLDERto the host path (/srv/music) instead of the container path (/music) leaves the library empty. The value must match the right-hand side of the volume mount. - Subpath breakage. If you put Navidrome behind a path prefix and forget
ND_BASEURL, the web UI loads but API calls and stream URLs 404. Set it, restart, and re-check the Subsonic clients.
Also keep an eye on scan duration for large libraries: the initial scan of tens of thousands of tracks can take a while and will use CPU. Subsequent scans are incremental and cheap.
Measured in our sandbox run: total memory 26.1 MB (sum of per-container peaks over a 30s idle window after startup) across 1 container; largest container 26.1 MB; published port(s) 4533; HTTP probe returned 302. The run took 55.8s including the image download. Required secret(s) ND_SESSION_SECRET were generated for the test run, as the tutorial instructs.
Verification: we ran this docker-compose stack in a disposable Docker environment and recorded the measurements above. They describe that run, not a guarantee for your host.