Running Kodi in Docker
Kodi is a lightweight media center that can run inside a Docker container, which makes it easy to install, update, and isolate from the rest of your system. With Kodi in Docker, you can keep your settings portable, map your local media library cleanly, and rebuild the container anytime without losing your configuration.
If you want to take it a step further, you can also run Kodi’s network traffic through a separate VPN container so it routes out over that tunnel while the rest of your machine stays normal. Here’s the guide to routing Docker apps through a VPN container (Windows/macOS) → (link for Windows VPN Docker, link for MacOS VPN Docker)
What you’re building
-
A Kodi container you can manage like any other Docker app
-
A persistent Kodi config folder so your setup survives updates
-
Media library mounts so Kodi can scan your movies/TV/music
-
Optional: a path to route Kodi through a VPN container later
Note: Kodi is a “TV-style” app designed for a remote/UI. Running it in Docker is most useful when you’re either:
using a device/TV client to access the library over the network, or
running Kodi headless-ish for library management + remotes, or
using a container that exposes the UI over a web/VNC-style session (depends on the image).
Requirements
-
Docker installed (Docker Desktop on Windows/macOS, Docker Engine on Linux)
-
A folder for:
-
Kodi config (persistent)
-
Your media library (Movies/TV/Music)
-
-
Basic comfort running Docker commands or Compose
Folder layout (recommended)
Create a simple structure like:
-
kodi-docker/-
docker-compose.yml -
config/(Kodi profile + settings live here) -
media/(or bind-mount your real media folder path)
-
Pull Kodi Image
docker pull linuxserver/kodi-headless
Add your media inside Kodi
Once Kodi is up:
-
Go to Settings → Media → Library
-
Add sources:
-
/media/movies -
/media/tv -
/media/music
-
-
Pick the correct content type:
-
Movies → “Movies”
-
TV → “TV Shows”
-
-
Let it scan and pull metadata
Tip: If your filenames aren’t clean, you’ll save hours by fixing naming first (Movie Title (Year), TV Show S01E01 format).
Persisting your setup (important)
Everything in ./config persists:
-
skin / UI choices
-
sources and library settings
-
addons and repositories
-
watched history (depending on your setup)
That means you can:
-
update the container image safely
-
rebuild the container
-
move the whole setup to another machine