Hello! 🎵 How do you listen to your favorite music? Streaming services like Spotify and Apple Music are great, but have you ever wished you could manage your own music collection and listen to it on your own terms, anytime, anywhere? Today, I’m going to show you how to quickly and easily build an awesome open source music streaming server called Navidrome using Docker Compose that will make that dream a reality 🐳🚀.
—.
🌟 1. What is Navidrome and why should I use it?
Navidrome is a lightweight, fast, personal music streaming server with a modern web interface. It supports the Subsonic API, making it compatible with a wide range of third-party client apps.
Reasons to use Navidrome: **.
- Manage your own music collection: Ideal for rare songs or high quality recordings that aren’t available on streaming services.
- Complete control: Your music is on your own server, so you’re in complete control of your data.
- Clean and intuitive UI:** The web interface is very modern and user-friendly.
- Diverse device support: You can conveniently listen to your music on your smartphone or tablet via a web browser, as well as mobile apps that support the Subsonic API (Symfonium, Dsub, etc.).
- Lightweight and efficient: Low resource usage means it works well even on low-end devices (Raspberry Pi, etc.).
- Open source: Transparent and active community support.
🐳 2. Why use Docker Compose?
Docker Compose is a tool for defining and running multiple Docker containers. It allows you to define complex application environments in a single YAML file, making them easy to deploy and manage.
Benefits of Docker Compose: **.
- Easy deployment: Complex environments can be built with a few lines of code.
- Environment consistency: Reduce differences between development, test, and production environments.
- Easy to manage: Start, stop, restart, and delete containers with a single command.
- Independent environments: Each service runs in an isolated environment to prevent conflicts.
🛠️ 3. Before You Begin
Before installing Navidrome, please prepare the following items.
- Install Docker and Docker Compose: Docker and Docker Compose must be installed on your server. The installation method varies depending on each operating system, so please refer to the official documentation.
- Prepare music files: You will need to have the music files (MP3, FLAC, etc.) that you want to stream ready. You will place them in a specific folder on your server.
📂 4. Design your project structure
Create a clean directory structure for your Navidrome and Docker Compose files.
navidrome/
├── docker-compose.yml
├── data/
└── music/
navidrome/
: The top-level directory to hold all files.docker-compose.yml
: Docker Compose configuration file.data/
: The folder where Navidrome’s settings, database, cache, etc. will be stored. (This folder should be persistent!)music/
: The folder where your music files will be stored. Please put all your music files here! 💿
📝 5. Create a docker-compose.yml
file
Now create a docker-compose.yml
file inside the navidrome
directory and enter the following contents
version: '3.8'
services:
navidrome:
image: deluan/navidrome:latest
container_name: navidrome
restart: unless-stopped
ports:
- "4533:4533" # host port:container port
volumes:
- ./data:/data
- ./music:/music:ro # Folder with music files (read-only)
environment:
# Navidrome environment variables.
# https://www.navidrome.org/docs/usage/configuration-options/
- ND_SCANINTERVAL=1h # Music scan interval (every hour)
- ND_LOGLEVEL=info # Log level (info, debug, warn, error)
- ND_MUSICFOLDER=/music # path to the music folder inside the container (very important!)
- TZ=Asia/Seoul # timezone setting (change as needed)
# ND_LASTFM_API_KEY: "YOUR_LASTFM_API_KEY" # Last.fm integration (optional)
# ND_LASTFM_SHARED_SECRET: "YOUR_LASTFM_SHARED_SECRET" # Last.fm integration (optional)
# ND_SPOTIFY_CLIENT_ID: "YOUR_SPOTIFY_CLIENT_ID" # Spotify integration (optional)
# ND_SPOTIFY_CLIENT_SECRET: "YOUR_SPOTIFY_CLIENT_SECRET" # Spotify integration (optional)
# CPU and memory limits (optional, useful in resource-constrained environments)
# deploy:
# resources:
# limits:
# cpus: '0.5' # 0.5 CPU cores
# memory: 512M # 512MB memory
docker-compose.yml
File description:
version: '3.8'
: Specifies the version of the Docker Compose file. It is recommended to use the latest version.services:
: Defines the services to run. Here we have only one service,navidrome
.image: deluan/navidrome:latest
: Use the official Docker image of Navidrome. Thelatest
tag always gets the latest version.container_name: navidrome
: Name the containernavidrome
to make it easier to identify later.restart: unless-stopped
: Sets the container to restart automatically when it is unexpectedly stopped, or when the Docker daemon is restarted.ports: - "4533:4533"
: Port mapping settings.- The left
4533
is the **port of the host (server); this is the port you will connect to Navidrome on. - The right side
4533
is the port inside the container. Navidrome uses port 4533 by default. - If port 4533 is already in use on your host, you can change the port number on the left to something else, like
8080:4533
.
- The left
volumes:
: Used to store data permanently, and to access files on the host.- ./data:/data
: Mounts thedata
folder under the current directory on the host (thenavidrome
directory) to the/data
folder inside the container. Navidrome’s settings, database, cache, etc. are stored in thisdata
folder.- ./music:/music:ro
: Mount themusic
folder under the host’s current directory to the/music
folder inside the container. Thero
stands for “read-only”, which allows the container to only read the contents of this folder to prevent data corruption. Put your music files inside thismusic
folder. **Put your music files inside thismusic
folder.
environment:
: Environment variables that control the behavior of the Navidrome application.ND_SCANINTERVAL=1h
: Sets the interval at which Navidrome scans for new music files to 1 hour. It can be changed to1m
(1 minute),1d
(1 day),(disable automatic scanning), etc.
ND_LOGLEVEL=info
: Sets the log level for Navidrome. This can be changed todebug
for debugging.ND_MUSICFOLDER=/music
: Very important setting! Tells Navidrome where the music files are located inside the container. Since we mounted it as:/music
in thevolumes
setting above, this value should be/music
.TZ=Asia/Seoul
: Sets the timezone of the container. This helps to accurately display log times, music file creation times, etc.- For additional settings, such as Last.fm and Spotify integration, please refer to the official documentation and uncomment them.
—.
🚀 6. Launch Navidrome
Once you’ve finished writing your docker-compose.yml
file, you’re ready to run Navidrome!
-
**Place your music files in Place all of your music files in the
navidrome/music/
directory. Keep them organized by folder so they look neat in Navidrome. 🎶# Example: # navidrome/music/. # ├── Band_A/ # │ ├── Album_1/ # │ │ ├── 01_Song_A.mp3 # │ │ └── 02_Song_B.flac # │ └── Album_2/ # │ │ └── 01_Song_C.mp3 # └── Band_B/ # └── Single_D.mp3
-
- Run the container: 4533/tcp
- Run the container: 4533/tcp
🌐 7. Connect to Navidrome and make initial settings
Now open a web browser and connect to the following address.
http://[당신의_서버_IP_주소]:4533
Example: http://localhost:4533
(if running locally) or http://192.168.1.100:4533
(your server IP address).
-
Create an administrator account: **Create an administrator account The first time you access Navidrome, you will be prompted to create an administrator account. Please enter your username and password to create the account. 🛡️
-
Scan your music Once you have created an account and logged in, Navidrome will automatically scan the music files in your
music
folder and start building your library. Depending on the number of files, this may take some time. You can check the progress via the icon in the top right corner.Once the scan is complete, you’ll see a beautiful music library in front of you! ✨
📱 8. Utilize the mobile client app
Navidrome has a great web interface, but on mobile devices, you can enjoy your music even more conveniently by utilizing various apps that support the Subsonic API.
Some popular app recommendations:
- Android: Symfonium (highly recommended! 👍), Dsub, Subtracks
- iOS: play:Sub, iSub, Substreamer
When setting up the app, enter http://[your_server_IP_address]:4533
for the server address and log in with the administrator account you created. (You may need to set up port forwarding or reverse proxy to access from outside).
💡 9. Advanced settings and tips
-
Rescan Music: If you’ve added new music files and don’t see them right away, you can manually rescan your library by going to “Settings” -> “Scan Library” in the Navidrome web UI.
-
Update: To update Navidrome to the latest version, use the following commands
cd navidrome docker compose pull navidrome # Download the latest image docker compose up -d # Restart the container with the new image
-
Backup: Backing up just the
navidrome/data
folder will preserve all of Navidrome’s settings, database, and scanned metadata. You can use this folder as is when you move to another server or recover. -
Reverse Proxy (Nginx/Caddy): If you want to connect to a domain like
http://yourdomain.com
or enforce HTTPS (SSL), we strongly recommend having a reverse proxy like Nginx or Caddy in front of you. This will increase security and allow you to access clean URLs without port numbers (more on this another time 📚 ).
⚠️ 10. Troubleshooting
- **Containers are not running!
- Check the logs with the command
docker compose logs navidrome
to figure out what error occurred. - It could be a port conflict. Try changing the number to the left of
ports
in thedocker-compose.yml
file (4533:4533
to the left of4533
) to a different number.
- Check the logs with the command
- *I can’t see my music files!
- Make sure your music files are in the
navidrome/music
folder. - Double check that the path
ND_MUSICFOLDER
indocker-compose.yml
matches thevolumes
setting (set to/music
). - This may be a permissions issue. Make sure the
music
folder has read permissions that the Docker container can access (you can try something likechmod -R 755 navidrome/music
, but if it’s aro
volume, this is usually not a problem).
- Make sure your music files are in the
- I can’t connect!
- Make sure port 4533 is open in your server’s firewall settings (ufw, firewalld, etc).
- Double check that the container is
Up
withdocker compose ps
.
— * Check that the container is Up
.
🥳 11. Conclusion.
You have now successfully built your own powerful and awesome music streaming server, Navidrome! 🎉 You are no longer dependent on streaming services and can now enjoy your own music collection on your own terms. You’ve probably noticed that Docker Compose made this whole process a lot easier.
If you have any questions or problems, feel free to ask in the comments! Happy music life! 🎶🎧✨