A powerful, self-hosted music server setup that combines Navidrome with an integrated YouTube/SoundCloud downloader and Cloudflare Tunnel for seamless remote access.
- Navidrome Music Server: Modern, high-performance music streaming server.
- Integrated Downloader: Download songs directly from the Navidrome UI.
- Multi-Platform Support: Powered by
yt-dlp, supports YouTube, SoundCloud, Bandcamp, and more. - Library Management: Choose which folder to save your downloads to.
- Automatic Scanning: New downloads are instantly scanned and added to your library.
- Remote Access: Built-in Cloudflare Tunnel support for secure access anywhere without port forwarding.
- Age-Restricted Content: Support for YouTube authentication via cookies or credentials.
The system consists of three main components:
- Navidrome: The core music server (modified to include a download UI and proxy).
- Downloader Service: A FastAPI wrapper around
yt-dlpthat handles the actual downloading. - Cloudflare Tunnel: Securely exposes your Navidrome instance to the internet.
- Docker and Docker Compose installed.
- A Cloudflare account (optional, for remote access).
Copy the example environment file and fill in your details:
cp .env.example .envConfiguration Details:
| Variable | Description | Required |
|---|---|---|
CLOUDFLARE_TUNNEL_TOKEN |
Your Cloudflare Tunnel token for remote access. | No |
ND_YTDLPCOOKIESFILE |
Path to a cookies.txt file for YouTube authentication. |
Recommended |
ND_YTDLPUSERNAME |
YouTube account email (alternative to cookies). | No |
ND_YTDLPPASSWORD |
YouTube account password (alternative to cookies). | No |
To download age-restricted or premium content, it is highly recommended to use a cookies file:
- Install the "Get cookies.txt" extension in your browser.
- Go to YouTube and export your cookies.
- Save the file as
navidrome-data/yt-cookies.txt. - Ensure
ND_YTDLPCOOKIESFILE=/data/yt-cookies.txtis set in your.env.
docker-compose up -d- Locally: http://localhost:4533
- Remotely: Via your Cloudflare Tunnel hostname.
- Create an admin account on your first visit.
- Open the Navidrome UI.
- Click the user menu (top-right corner).
- Select "Download Song".
- Paste the URL (YouTube, SoundCloud, etc.).
- (Optional) Select a specific library folder.
- Click Download.
The song will be processed, tagged with metadata, and automatically appear in your library.
If you encounter issues, you can check the logs of the services:
# View all logs
docker-compose logs -f
# View downloader logs (useful for debugging download failures)
docker-compose logs -f navidrome-song-downloader
# View Navidrome logs
docker-compose logs -f navidromeFor manual downloads without using the UI, you can use the provided script:
./download_music.sh "https://www.youtube.com/watch?v=..."Note: This requires yt-dlp to be installed locally or run inside the container.
.
├── docker-compose.yml # Main service configuration
├── .env.example # Environment variable template
├── music/ # Root directory for your music collection
├── navidrome-data/ # Navidrome database, config, and cookies
├── navidrome/ # Navidrome source code with UI enhancements
│ ├── server/subsonic/ # Backend proxy logic for downloads
│ └── ui/src/dialogs/ # Custom Download UI components
└── navidrome-song-downloader/ # FastAPI service wrapping yt-dlp
├── main.py # Downloader API logic
└── Dockerfile # Downloader container definition
- Scanning: Navidrome is configured to automatically scan the music folder. If a song doesn't appear immediately, check the logs.
- Formats: All songs are currently downloaded in MP3 (320kbps) format with embedded thumbnails and metadata.
- YouTube Music: The downloader works best with standard YouTube and YouTube Music URLs.
This project inherits the Navidrome license (GPLv3). See the LICENSE file for details.