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.

