Docker based KODI/VDR (nvidia)

I was using for several years and what i learned was that the dependencies in the packages of a mediacenter can be a pain. Several times i wished to be able to do a rollback after a update.

It has improved a lot, but sometimes i am still getting problems when running updates. As i am using Docker every day for my work at INSPIRATIONlabs i decided to try to create a mediacenter on top of Docker.

I will describe how i installed a HTPC with Kodi and LiveTV with VDR.

What’s already done:

1. Base installation of Debian jessie (we want systemd) + Xorg configuration + nvidia-driver installation
2. Xserver autostart on host system
3. Xserver authorization on host

Kodi and Xorg installation

Base installation

I did a minimal installation of Debian 8.1.
After installing the base system i installed the xserver core and the nvidia drivers and configured the Xorg — server. This is not yet part of this guide.

To get the latest Docker version it should be installed with:
curl -sSL | sh

Xserver autostart on host system

I wanted to start a minimal Xserver on system launch. I know that i will not win a beauty contest with my configuration as i am running everything as root but to be true: I was not sure if this will work and decided to do the installation with minimal effort as possible.

To start the X — Window on boot. I created a system — init — script in /etc/systemd/system/X11.service.


ExecStart=/usr/bin/startx — -nocursor


After saving the script, i enabled it with
systemctl enable X11

Xserver authorization on host

I added
to the /etc/environment

Additionally i created a ~/.xsessionrc with the following content:
export DISPLAY=:0
xhost +SI:localuser:root
xsetroot -gray
xset s off # don’t activate screensaver
xset -dpms # disable DPMS (Energy Star) features.
xset s noblank # don’t blank the video device

Docker build

manual build

As the official Kodi repository uses ubuntu ppa’s i decided to use phusion/baseimage (a minimal ubuntu 14.04 for Docker) as Baseimage for my installation.

After i failed a few times with my installation (my Debian host and my Ubuntu host had different nvidia-driver versions) i found the repository from Matt McCormick []. I created a new repository at [] and changed the build process a bit to reflect my configuration.

If the driver version is not exactly the same as on the Docker host you will get a error like that:

X Error of failed request: BadValue (integer parameter out of range for operation)
X Error of failed request: GLXBadContext Major opcode of failed request: 154 (GLX) Minor opcode of failed request: 24 (X_GLXCreateNewContext)

To build the image the git repository should be checked out first.

git clone .

Now go to the checked out folder and execute the Build script
cd docker-kodi-nvidia

After the build has been successful Kodi can be startet with
./ — name kodi -p 8080:8080 kodi-nvidia

automatic build

This build can be used if the Host system is running nvidia-driver version 340.65 ( like Debian Jessie ).

This should return 340.65
cat /proc/driver/nvidia/version | head -n 1 | awk ‘{ print $8 }’

Then you can run kodi with these commands:

XSOCK=/tmp/.X11-unix docker run \ -v $XSOCK:$XSOCK:rw \ — device=/dev/dri/card0:/dev/dri/card0 \ — device=/dev/nvidia0 \ — device=/dev/nvidiactl \ — device=/dev/snd:/dev/snd \ -e DISPLAY=$DISPLAY \ — name kodi -p 8080:8080 dominicboettger/kodi-nvidia

VDR installation

DVB Driver

I am using a dual channel DVB card. Mystique Satix S2 Dual. So this is more for my configuration than for yours. Just install the driver of your card if not supported out of the box.

apt-get install libproc-processtable-perl
cd /usr/src
curl -O
tar xvzf media_build-bst-14–141106.tar.gz
cd media_build-bst-14/
make install
cd dvbsky-firmware/



To start the VDR just enter:

docker run -d — name vdr — device=/dev/dvb:/dev/dvb -p 8008:8008 -p 37890:37890 -p 6419:6419 -p 3000:3000 -p 34890:34890 dominicboettger/vdr

The image will be downloaded and executed.

To start it with systemd you can add the following script in /etc/systemd/system/vdr.service

Description=VDR container

ExecStart=/usr/bin/docker start -a vdr
ExecStop=/usr/bin/docker stop -t 2 vd


To active the init script execute this command:
systemctl enable vdr

After VDR is running Kodi can be configured to use the IP of the VDR server.

I am really happy with the status of the project and it’s much more than i ever expected to be able to solve with Docker.

Like what you read? Give dboettger a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.