Mopidy music server with Iris Web-UI, Spotify support and many other extensions.
10K+
Mopidy an extensible music server that plays music from local disk, Spotify, Tidal, Youtube, SoundCloud, TuneIn, and more.
Source: GitHub
Docker-Images: DockerHub
Using Docker images built on top of this repo, mopidy with its extensions can be easily run on multiple machines with different architectures (amd64, arm). Besides the music server mopidy, the image includes the great web interface IRIS from jaedb. Please note that the image only includes a minimal set of the basic mopidy extensions:
Other useful extensions can be installed and keep updated by pip on container startup. Simply add them to the environment variable PIP_PACKAGES as a list of package names.
You need to have Docker up and running on a Linux machine. See the official documentation to install the Docker Engine
Here is the repository on DockerHub.
Getting the image from DockerHub is as simple as typing:
docker pull jojo141185/mopidy:release
You can pull other, probably less stable image builds by the following tags
| TAG | DESCRIPTION |
|---|---|
| latest | Image build from main / master branches |
| develop | Image build from develop branches (probably untested) |
You can start the mopidy container by simply using the command docker run or the docker compose tool where you can store your docker configuration in a seperate yaml file.
In both ways you need to adapt the command or docker-compose.yaml file to your specific host environment.
If you need to run docker as non-root user then you need to add it to the docker group.
sudo groupadd dockersudo usermod -aG docker $USERnewgrp dockerdocker run hello-worldWarning: The docker group grants privileges equivalent to the root user. For details on how this impacts security in your system, see Docker Daemon Attack Surface
Start the mopidy docker container with the docker run command:
docker run -d \
--name mopidy \
--user root \
--group-add audio \
--device /dev/snd \
-v "$PWD/config:/config" \
-v "$PWD/media:/media:ro" \
-v "$PWD/local:/var/lib/mopidy/local" \
-p 6600:6600 -p 6680:6680 \
jojo141185/mopidy:release
The following table describes the docker arguments and environment variables:
| ARGUMENT | DEFAULT | DESCRIPTION |
|---|---|---|
| --user | root | (recommended) This container should be run as root to avoid permission issues. Although the container operates under root privileges, the main process is executed as a restricted user named "mopidy" to minimize security risks. |
| --group-add | audio | (recommended) Add host's audio group to container. |
| --device | /dev/snd | (optional) For ALSA share the hosts sound device /dev/snd. For pulseaudio see this guide or use snapcast for network / multiroom audio solution. |
| -v | $PWD/config:/config | (essential) Cange $PWD/config path to the directory on host where your mopidy.conf is located. |
| -v | $PWD/media:/media:ro | (recommended) Cange $PWD/media path to directory with local media files (ro=read only). |
| -v | $PWD/local:/var/lib/mopidy/local | (recommended) Cange $PWD/local path to directory to store local metadata, libraries and playlists. |
| -p | 6600:6600 | (recommended) Exposes MPD server to port 6600 on host (if you use for example ncmpcpp client). |
| -p | 6680:6680 | (recommended) Exposes HTTP server to port 6680 on host (this is essential, if you use the WebUI as client). |
| -p | 5555:5555/udp | (optional) Exposes UDP streaming on port 5555 for FIFE sink (e.g. for visualizers). |
| -e | PIP_PACKAGES= | (optional) Environment variable to inject some pip packages and mopidy extensions (i.e. Mopidy-Tidal) on upstart of container. |
| -e | PUID= | (optional) Environment variable to define the user ID of the mopidy user to match with host's user ID. By default it is running with user mopidy (UID 102). |
| -e | PGID= | (optional) Environment variable to define the group ID of the mopidy user to match with host's group ID. By default it is running with group audio (GID 29). |
| -e | PULSE_SERVER= | (optional) Environment variable to define the PulseAudio socket to match with host's. This is optional and only needed if you use PulseAudio. |
| -e | PULSE_COOKIE= | (optional) Environment variable to pass PulseAudio cookie path. This is optional and only needed if you use PulseAudio. |
| -e | PULSE_COOKIE_DATA= | (optional) Environment variable to pass PulseAudio cookie data. This is optional and only needed if you use PulseAudio. |
Note:
First check that Docker compose is already installed on your host.
docker-compose up -ddocker compose up -dYou can build (or rebuild) the image by opening a terminal from the root of the repository and issuing the following command:
docker build --build-arg IMG_VERSION="release" -t jojo141185/mopidy .
It will take a long time, espacialy on a Raspberry Pi. When it's finished, you can run the container following the previous instructions.
Just be careful to use the tag from your own built.
Spotify disabled access to libspotify on May 16 2022. To be able to use Spotify as audio source, the mopidy-Spotify-Plugin was tweaked by @kingosticks. It now uses the GStreamer plugin "gst-plugins-spotify" in the background to play Spotify songs.
For this reason this mopidy container should be seen as an alpha version with limited features in interaction with Spotify (i.e. no seeking support).
Content type
Image
Digest
sha256:5b8f66052…
Size
408.8 MB
Last updated
6 months ago
docker pull jojo141185/mopidy