A modern, responsive web interface for Music Player Daemon (MPD) with complete Docker support. Features 4 beautiful themes, mobile-responsive design, and advanced music management capabilities including recently fixed album discovery.
Screenshot showing the Desert theme with album art and playback controls
Take a Tour PROJECT_SHOWCASE.md
- 4 Complete Themes: Dark, Light, High Contrast, Desert
- 📱 Mobile Responsive: Perfect experience on any device
- 🎨 Real-time Updates: Live playback status via WebSockets
- 🖼️ Album Art: Local folder images + Last.fm fallback
- 🏆 Recent Albums: Fixed! Automatically displays 25 most recently added albums
- 📻 Radio Stations: Save and manage genre-based radio stations
- 🤖 Smart Auto-Fill: Intelligent playlist management with Last.fm
- 🔍 Advanced Search: Comprehensive music library search
- 📈 Last.fm Integration: Charts, scrobbling, and music discovery
- 🎹 Full MPD Control: Play, pause, volume, shuffle, crossfade
- Multi-Container Setup: Separate MPD and web application containers
- Flexible Deployment: Support for both containerized and external MPD
- 📦 One-Command Setup: Interactive installation script
- 🔒 Security Hardened: Non-root user execution
- 💾 Data Persistence: Settings and cache survive restarts
🎯 One command. Auto-configured audio. Ready in 2 minutes.
- Docker and Docker Compose installed
- Music directory accessible to Docker
- (Optional) Last.fm API credentials for charts/scrobbling - Get yours here →
git clone https://github.com/coacharnold1/Maestro-MPD-Control.git
cd Maestro-MPD-Control
./setup.sh🎧 Automatic Audio Setup:
- 🔍 Auto-Detection: PipeWire/PulseAudio/ALSA automatically detected
- 🔊 Native Audio: Music plays through your system speakers/headphones
- 🌐 HTTP Backup:
http://localhost:8001for browser/remote access - ⚡ Performance Optimized: Fast controls, smart caching, optimized timeouts
✨ What happens:
- Script detects your audio system (PipeWire/PulseAudio/ALSA)
- Configures Docker for native audio access
- Sets up permissions automatically
- Launches with optimal settings for your hardware
🎛️ Result: Full music control at http://localhost:5003 with native audio!
# Download/extract project, then run as Administrator:
.\setup-windows.ps1See WINDOWS_SETUP.md for complete platform-specific instructions including:
- 🎧 Native MPD vs HTTP Streaming: Choose true system audio or browser playback
- WSL2 setup (recommended)
- PowerShell automated setup
- Git Bash alternative
- Windows audio testing guide
- Windows troubleshooting guide
The interactive setup script will guide you through:
- Music directory configuration
- MPD server setup (containerized vs external)
- Theme selection
- Last.fm integration
- Automatic service startup
-
Copy environment template:
cp .env.example .env
-
Edit configuration:
nano .env # Set your MUSIC_DIRECTORY path -
Start with containerized MPD (recommended):
COMPOSE_PROFILES=with-mpd docker-compose up -d
Or connect to existing MPD:
# Set MPD_HOST=host.docker.internal in .env docker-compose up -d -
Access the interface:
http://localhost:5003
| Document | Description |
|---|---|
| DOCKER_USAGE.md | Complete Docker deployment guide |
| CHANGELOG.md | Version history and features |
| Configuration | Environment variables and settings |
| Dark | High Contrast | Desert |
|---|---|---|
![]() |
![]() |
![]() |
| Variable | Default | Description |
|---|---|---|
MUSIC_DIRECTORY |
Required | Path to your music library |
MPD_HOST |
mpd |
MPD server hostname |
MPD_PORT |
6600 |
MPD server port |
WEB_PORT |
5003 |
Web interface port |
DEFAULT_THEME |
dark |
Default UI theme |
RECENT_MUSIC_DIRS |
- | Comma-separated dirs for Recent Albums (performance) |
LASTFM_API_KEY |
- | Last.fm API key (optional) |
LASTFM_SHARED_SECRET |
- | Last.fm shared secret (optional) |
✅ Fixed! Recent albums now automatically scans your entire music library and displays the 25 most recently added albums.
# Optional performance optimization - specify dirs with newest music:
RECENT_MUSIC_DIRS=New Releases,2024,2025,Latest Albums- 🔄 Auto-Fallback: Automatically scans full library if no specific dirs configured
- ⚡ Fast Performance: Efficient scanning finds albums in ~0.1 seconds
- 📂 Smart Detection: Finds albums by modification date across your entire library
- 🎯 Optional Targeting: Specify directories for even faster performance
| Profile | Services | Use Case |
|---|---|---|
| (default) | Web only | Connect to existing MPD |
with-mpd |
Web + MPD | Full containerized setup |
Universal solution that works everywhere:
✅ Platform Support:
- 🐧 Linux: Works + Native audio option available
- 🖥️ Windows: Primary solution (Docker containers can't access Windows audio, Powershell script installs and configures windows MPD server - run the autostart script and set Docker to start on boot)
- 🍎 macOS: Works + Native audio option available
|***** WINDOWS INSTALL | Environment variables and settings ****|
✅ Features:
- 🌐 Browser playbook: Direct streaming to web interface
- 📱 Mobile friendly: Stream to phone/tablet browsers
- 🎧 External players: VLC, MPV, etc. can play the stream
- 🚫 No permissions: No special Docker audio setup needed
# Audio streams to: http://localhost:8001
# Play in browser or media player that supports HTTP streamsFor users wanting direct system audio output:
# Linux (ALSA)
docker run --device /dev/snd:/dev/snd ...
# Linux (PulseAudio)
docker run -v /run/user/1000/pulse:/run/user/1000/pulse ...- 🐧 Linux: Both HTTP streaming AND direct audio supported
- 🖥️ Windows: HTTP streaming ONLY (Docker cannot access Windows audio)
- 🍎 macOS: HTTP streaming recommended (direct audio complex)
🐧 Linux (Native Audio):
# Test system audio
./setup.sh # Auto-detects and configures PulseAudio/ALSA
# Music should play through speakers/headphones🖥️ Windows (HTTP Stream):
# Test HTTP stream
curl http://localhost:8001 # Should stream audio data
# Play via browser
start http://localhost:8001
# Or use VLC (recommended)
vlc http://localhost:8001🍎 macOS (HTTP Stream):
# Test HTTP stream
curl http://localhost:8001 # Should return audio data
# Play in browser
open http://localhost:8001 # Safari/Chrome/FirefoxFully responsive design optimized for:
- 📱 Phones: Touch-friendly controls, stacked layouts
- 📲 Tablets: Optimized button sizing and spacing
- 💻 Desktop: Full feature set with large album art
📋 Setup Required: Get free API credentials at https://www.last.fm/api/account/create
Connect your Last.fm account for:
- 📊 Personal Charts: Top artists, albums, and tracks
- 📈 Scrobbling: Automatic play tracking
- 🎶 Music Discovery: Similar artist recommendations
- 📋 Playlist Integration: Add chart items directly to playlist
Configuration: Add your API key and shared secret during setup or in the Settings page.
# View service status
docker-compose ps
# View logs
docker-compose logs -f
# Stop services
docker-compose down
# Restart services
docker-compose restart
# Update containers
docker-compose pull && docker-compose up -d┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Web Browser │ │ MPD Client │ │ Last.fm API │
│ │ │ (Optional) │ │ (Optional) │
└─────────┬───────┘ └─────────┬───────┘ └─────────┬───────┘
│ │ │
│ HTTP/WebSocket │ MPD Protocol │ HTTPS
│ │ │
┌─────────▼───────┐ ┌─────────▼───────┐ │
│ Web Container │◄───┤ MPD Container │ │
│ │ │ (Optional) │ │
│ - Flask App │ │ - Music Player │ │
│ - SocketIO │ │ - Database │ │
│ - Album Art │ │ - Audio Output │ │
│ - Last.fm │────┼─────────────────┘──────────────┘
└─────────┬───────┘ │
│ │
▼ ▼
┌─────────────────────────┐
│ Docker Volumes │
│ - Settings & Cache │
│ - MPD Database │
│ - Playlist Data │
└─────────────────────────┘
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Music Player Daemon - The excellent audio player
- Last.fm - Music metadata and discovery
- Flask - Web framework
- Docker - Containerization platform
- 🐛 Bug Reports: GitHub Issues
- 💬 Discussions: GitHub Discussions
- 📚 Documentation: Wiki
⭐ Star this repository if you find it useful!
- NEW: Desert Theme - warm brown/tan color scheme with reddish borders
- FIXED: Mobile footer layout - stacked vertical layout instead of cramped inline separators
- STANDARDIZED: Mobile playback controls - consistent full-width buttons across all pages
- ENHANCED: Border consistency - unified border-radius design system (15px containers, 10px cards, 6px buttons, 4px small)
- RESOLVED: MPD stability - fixed memory buffer overflow issues (reduced from 3.2GB to 162MB usage)
- ADDED: Input overflow fixes - station name input box sizing correction
- Dark Theme: Default dark interface
- Light Theme: Clean light interface
- High Contrast: Accessibility-focused yellow on black
- Desert Theme: NEW warm brown/tan with reddish borders
- Mobile Optimized: All themes work perfectly on mobile devices
- Running on: Port 5003 (configurable)
- Status: Production-ready with enhanced UI consistency and theme system
- Platform: Optimized for Arch Linux with systemd service
- Backup: mpd_web_control_backup_20251117_164850
- NEW: Radio Station Auto-Fill Enhancement - maintains genre diversity during auto-fill
- NEW: Navigation Standardization - consistent emoji-based navigation across all pages
- NEW: Radio Station Mode - preserves original station genres instead of switching to "now playing"
- ENHANCED: Auto-fill status display shows radio station information and genre counts
- FIXED: Playback timing issues - eliminated "failed to start playbook" errors
- IMPROVED: Album art integration in playlist page with thumbnail display
- ADDED: Professional UI consistency with current page indicators
- Save/Load/Play: Complete radio station management with genre preservation
- Auto-Fill Integration: Radio stations maintain original genre sets during auto-fill
- Status Display: Rich information showing active station and genre count
- Mode Management: Automatic switching between normal and radio station auto-fill modes
- ✅ Play, pause, next, previous controls
- ✅ Volume control with real-time updates
- ✅ Current song display with progress tracking
- ✅ Queue management and playlist controls
- ✅ Consume mode toggle
- ✅ Shuffle mode with cross-page synchronization
- 🎵 Last.fm Integration: Album art fetching and similar artist suggestions
- 🔍 Search Functionality: Search your music library by artist, album, title, or any field
- 🤖 Auto-Fill Playlists: Automatically add similar tracks when queue gets low
- � Radio Stations: Save, load, and play genre-based radio stations with auto-fill integration
- �🖼️ Album Art Display: Local folder art + Last.fm fallback with thumbnail support
- 📱 Real-time Updates: WebSocket-powered live status updates
- 🎛️ Smart Filtering: Genre-based filtering for auto-fill with radio station mode
- ✨ Genre Selection: Multi-select random music by genre with station save/load
- 📱 Responsive design for desktop and mobile
- 🎨 Clean, modern interface with consistent styling
- ⚡ Real-time status updates via SocketIO
- 💬 Live feedback messages with professional notifications
- 🗑️ Clear playlist functionality on all relevant pages
- Python 3.7+
- MPD (Music Player Daemon) running and accessible
- Music library with organized files
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install requirements
pip install -r requirements.txt# Copy and edit configuration
cp config.env.example config.env
nano config.env # Edit with your settingspython app.pyThe web interface will be available at http://localhost:5000
All settings are managed through the config.env file:
MPD_HOST: MPD server hostname (default: localhost)MPD_PORT: MPD server port (default: 6600)MPD_TIMEOUT: Connection timeout (default: 10)MUSIC_DIRECTORY: Path to your music files
Get your free API credentials from: https://www.last.fm/api/account/create
| Variable | Default | Description |
|---|---|---|
LASTFM_API_KEY |
- | Last.fm API key (optional) |
LASTFM_SHARED_SECRET |
- | Last.fm shared secret (optional) |
APP_PORT: Web server port (default: 5000)APP_HOST: Web server host (default: 0.0.0.0)SECRET_KEY: Flask secret key for sessionsDEBUG: Enable debug mode (default: False)
- Create service file:
sudo nano /etc/systemd/system/maestro-mpd-control.service- Add service configuration:
[Unit]
Description=Maestro MPD Control Panel
After=network.target mpd.service
[Service]
User=your-username
Group=your-username
WorkingDirectory=/path/to/mpd_web_control_combined
ExecStart=/path/to/mpd_web_control_combined/venv/bin/python app.py
Restart=always
RestartSec=5
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=maestro-mpd-control
[Install]
WantedBy=multi-user.target- Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable maestro-mpd-control
sudo systemctl start maestro-mpd-controlSee docker/ directory for Docker configuration files.
Automatically maintains your playlist by adding similar tracks when the queue gets low:
- Configurable minimum queue length
- Variable number of tracks to add
- Genre filtering option
- Uses Last.fm similar artists API
Powerful search functionality:
- Search by artist, album, title, or any field
- Add individual songs or entire albums to playlist
- Fast, responsive interface
Multi-source album art system:
- Local folder images (folder.jpg, cover.jpg, etc.)
- Last.fm API album art
- Generated placeholder as fallback
MPD Connection Failed
- Check MPD is running:
systemctl status mpd - Verify MPD configuration in
/etc/mpd.conf - Ensure MPD is listening on the correct port
No Album Art
- Check music directory path in config.env
- Verify Last.fm API credentials
- Ensure local album art files exist in music folders
Auto-Fill Not Working
- Verify Last.fm API key is set
- Check MPD has sufficient music library
- Enable auto-fill in the web interface
- Application logs: Check systemd journal with
journalctl -u maestro-mpd-control -f - MPD logs: Usually in
/var/log/mpd/mpd.log
mpd_web_control_combined/
├── app.py # Main application
├── rudimentary_search.py # Search functionality
├── config.env # Configuration file
├── config.env.example # Configuration template
├── requirements.txt # Python dependencies
├── templates/ # HTML templates
│ ├── index.html # Main interface
│ ├── add_music.html # Add music page
│ ├── playlist.html # Playlist management
│ ├── search.html # Search interface
│ └── search_results.html # Search results
├── static/ # Static assets (CSS, JS, images)
└── docs/ # Documentation
GET /: Main interfaceGET /search: Search pagePOST /search: Execute searchGET /playlist: Playlist managementPOST /add_random_tracks: Add similar tracksPOST /add_album_to_playlist: Add entire albumPOST /add_song_to_playlist: Add single song- Plus standard MPD control endpoints
This project is open source. Feel free to modify and distribute.
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
- Built with Flask and Flask-SocketIO
- Uses python-mpd2 for MPD communication
- Last.fm integration for music metadata
- Bootstrap for responsive UI
Regular backups help preserve configuration and state (e.g., saved radio stations). A helper script backup.sh is provided.
./backup.shCreates a compressed archive in two locations:
- Project directory:
backups/mpd_web_control_backup_YYYYmmdd_HHMMSS.tar.gz - Home directory:
~/mpd_web_control_backup_YYYYmmdd_HHMMSS.tar.gz
By default only the two most recent matching backups (pattern: mpd_web_control_backup_*.tar.gz) are retained in EACH location; older ones are deleted automatically.
Keep more:
RETENTION_COUNT=5 ./backup.shAdd a description label:
DESCRIPTION=pre_upgrade ./backup.shResult example:
mpd_web_control_backup_20251114_182500_pre_upgrade.tar.gz
Skip home copy (project-only):
SKIP_HOME_COPY=1 ./backup.shOverride home destination:
HOME_BACKUP_DIR=/mnt/backup ./backup.shbackups/(to avoid recursive nesting)venv/(can be recreated fromrequirements.txt)__pycache__/(bytecode caches)
- Navigate to
/settings(or click Settings in the footer) to configure:- Theme: Dark / Light / High Contrast / Desert
- Last.fm: API key and shared secret
- Scrobbling: toggle on/off
Values are stored in settings.json with 0600 permissions. Environment variables still override (recommended for Docker/production).
- Enter your Last.fm API key and shared secret; click Save.
- Click “Connect to Last.fm” and approve the app on Last.fm (opens in a new tab).
- Return to Settings and click “Finalize Connection”. This saves your user session key (sk).
- Enable “Scrobbling” and Save.
We submit:
track.updateNowPlayingwhen a track starts.track.scrobblewhen a track ends or changes and meets one of:- Played for at least 50% of duration, or
- Played for at least 240 seconds.
Security: We never store your Last.fm password—only the session key provided by Last.fm. settings.json is written with mode 0600.

