Skip to content

Deploying moOde Audio

Introduction

moOde Audio is a high-fidelity music player designed primarily for Raspberry Pi that transforms your device into a premium audio streamer. While traditionally deployed on dedicated hardware, moOde can be containerized for cloud deployment, providing remote access to your music library with audiophile-grade playback quality.

Built on a foundation of proven audio technologies including MPD (Music Player Daemon), moOde delivers bit-perfect audio playback with support for high-resolution formats. The elegant web interface provides comprehensive control over your music library, streaming services, and audio settings.

Key highlights of moOde Audio:

  • High-Resolution Audio: Support for formats up to 32-bit/768kHz including DSD, FLAC, ALAC, and more
  • MPD Backend: Leverages the mature and stable Music Player Daemon for reliable playback
  • Beautiful Web UI: Responsive interface with cover art, metadata display, and playlist management
  • Multi-Room Audio: Stream to multiple zones with synchronized playback
  • Internet Radio: Access thousands of internet radio stations with easy station management
  • UPnP/DLNA Support: Stream from network media servers and act as a renderer
  • Equalizer and DSP: Built-in parametric equalizer and digital signal processing
  • Spotify Connect: Native integration with Spotify for seamless streaming
  • AirPlay Support: Stream from Apple devices using AirPlay protocol
  • Bluetooth Audio: Receive audio streams via Bluetooth

This guide walks through deploying moOde Audio on Klutch.sh using Docker, configuring persistent storage for your music library, and setting up the application for streaming.

Why Deploy moOde Audio on Klutch.sh

Deploying moOde Audio on Klutch.sh provides several advantages for music streaming:

Always-On Access: Your music library remains accessible 24/7 from anywhere, without managing home network configurations or dealing with dynamic IPs.

Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds moOde without complex orchestration. Push to GitHub and your music player deploys automatically.

Persistent Storage: Attach persistent volumes for your music library, playlists, and configurations. Your collection and settings survive container restarts.

HTTPS by Default: Klutch.sh provides automatic SSL certificates, ensuring secure access to your music interface from anywhere.

GitHub Integration: Connect your configuration repository directly from GitHub. Updates trigger automatic redeployments.

Scalable Resources: Allocate CPU and memory based on your library size and streaming needs.

Custom Domains: Assign a custom domain to your moOde instance for easy access.

Prerequisites

Before deploying moOde Audio on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your configuration
  • Basic familiarity with Docker and containerization concepts
  • Your music library files ready to upload
  • (Optional) A custom domain for your moOde instance

Understanding moOde Architecture

moOde Audio is built on several core components:

MPD (Music Player Daemon): The heart of moOde’s playback engine, handling audio decoding, playlist management, and output control.

PHP Web Interface: A responsive web application providing comprehensive control over all moOde features.

ALSA Audio System: Advanced Linux Sound Architecture for audio routing and processing.

Streaming Protocols: Support for UPnP/DLNA, Spotify Connect, AirPlay, and Bluetooth for versatile connectivity.

Preparing Your Repository

Create a GitHub repository with your moOde configuration.

Repository Structure

moode-deploy/
├── Dockerfile
├── mpd.conf
└── .dockerignore

Creating the Dockerfile

Create a Dockerfile in your repository root:

FROM debian:bookworm-slim
# Install dependencies
RUN apt-get update && apt-get install -y \
mpd \
mpc \
nginx \
php-fpm \
php-sqlite3 \
php-gd \
alsa-utils \
wget \
curl \
&& rm -rf /var/lib/apt/lists/*
# Set environment variables
ENV MPD_HOST=localhost
ENV MPD_PORT=6600
# Create directories
RUN mkdir -p /var/lib/mpd/music \
/var/lib/mpd/playlists \
/var/log/mpd \
/var/run/mpd
# Copy configuration
COPY mpd.conf /etc/mpd.conf
# Expose ports
EXPOSE 80 6600
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD curl -f http://localhost/ || exit 1
CMD ["mpd", "--no-daemon", "/etc/mpd.conf"]

Creating the MPD Configuration

Create mpd.conf:

music_directory "/var/lib/mpd/music"
playlist_directory "/var/lib/mpd/playlists"
db_file "/var/lib/mpd/database"
log_file "/var/log/mpd/mpd.log"
pid_file "/var/run/mpd/pid"
state_file "/var/lib/mpd/state"
sticker_file "/var/lib/mpd/sticker.sql"
bind_to_address "0.0.0.0"
port "6600"
audio_output {
type "httpd"
name "HTTP Stream"
encoder "vorbis"
port "8000"
bitrate "320"
format "44100:16:2"
}
audio_output {
type "null"
name "Null Output"
}

Creating the .dockerignore File

.git
.github
*.md
LICENSE
.gitignore
*.log
.DS_Store

Deploying moOde Audio on Klutch.sh

    Push Your Repository to GitHub

    Initialize and push your repository to GitHub with your Dockerfile and configuration files.

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project with a descriptive name like “moode-audio”.

    Create a New App

    Within your project, create a new app. Connect your GitHub account and select the repository containing your moOde configuration.

    Configure HTTP Traffic

    In the deployment settings:

    • Select HTTP as the traffic type
    • Set the internal port to 80 for the web interface

    Set Environment Variables

    Configure the following environment variables:

    VariableValue
    MPD_HOSTlocalhost
    MPD_PORT6600

    Attach Persistent Volumes

    Add the following volumes:

    Mount PathRecommended SizePurpose
    /var/lib/mpd/music50+ GBYour music library
    /var/lib/mpd/playlists1 GBSaved playlists
    /var/lib/mpd/database1 GBMPD database

    Deploy Your Application

    Click Deploy to start the build process. Klutch.sh will build and deploy your moOde instance.

    Access moOde Audio

    Once deployment completes, access your moOde instance at https://your-app-name.klutch.sh.

Initial Configuration

Adding Music to Your Library

Upload your music files to the /var/lib/mpd/music volume. moOde supports:

  • FLAC, ALAC, WAV, AIFF (lossless)
  • MP3, AAC, OGG Vorbis (lossy)
  • DSD64, DSD128, DSD256 (DSD formats)

Updating the Music Database

After adding music, trigger a database update through the web interface or using MPC commands.

Creating Playlists

Use the web interface to create and manage playlists. Playlists are stored in /var/lib/mpd/playlists and persist across restarts.

Streaming Configuration

HTTP Audio Streaming

moOde can stream audio over HTTP, making it accessible from any device with a web browser or compatible audio player.

Internet Radio

Add internet radio stations through the web interface. moOde supports common streaming formats including MP3, AAC, and OGG streams.

Troubleshooting

No Audio Playback

  • Verify the music directory contains valid audio files
  • Check MPD logs for decoding errors
  • Ensure the database has been updated after adding music

Web Interface Not Loading

  • Verify the deployment is running in the Klutch.sh dashboard
  • Check that port 80 is configured correctly
  • Review nginx error logs

Database Not Updating

  • Check file permissions on the music directory
  • Verify MPD has write access to the database file
  • Review MPD logs for indexing errors

Additional Resources

Conclusion

Deploying moOde Audio on Klutch.sh gives you a powerful, cloud-based music streaming solution with audiophile-grade playback quality. With persistent storage for your music library and automatic HTTPS, you can access your collection from anywhere while maintaining the high-fidelity experience moOde is known for.

Whether you’re streaming your personal collection, listening to internet radio, or sharing music with friends, moOde on Klutch.sh provides the foundation for a reliable, always-available music player that you control.