Portainer Templates logo

Portainer Templates

Kodi Headless Kodi Headless

Container

Video

DEPRECATED Headless installation of Kodi™ (formerly known as XBMC™), to enable library updates.

Image details

Pulls: 243k
Architecture: arm
Image size: 131 MB
User: lsioarmhf
Created: Apr 22, 2017
Updated: 6 years ago
Status: active

Configuration

Type
Container
Platform
linux
Image
lsioarmhf/kodi-headless:latest
Ports
8081:8080/tcp9090:9090/tcp9777:9777/udp
Volumes
/config/.kodi : /portainer/Files/AppData/Config/Kodi
Env vars
PUID=1000PGID=1000
Restart
unless-stopped

Template by novaspirit

Notes

Template created by Pi-Hosted Series
Check our Github page: https://github.com/pi-hosted/pi-hosted

Official Webpage: https://kodi.tv/
Official Docker Documentation: https://hub.docker.com/r/lsioarmhf/kodi-headless-aarch64/


Standalone Install

Select an install method, to see config/commands for deploying Kodi Headless

Installation method

Install on Portainer

Import all app templates into your Portainer instance, for easy 1-click deploys

  1. Ensure both Docker and Portainer are installed, and up-to-date
  2. Log into your Portainer web UI
  3. Under Settings → App Templates, paste the below URL
  4. Head to Home → App Templates, and the list of apps will show up
  5. Select Kodi Headless, fill in any config options, and hit Deploy

Template Import URL

https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json
Show Me demo

More install options in our documentation.

undefinedlinuxserverurl: https://linuxserver.io
linuxserver.iolinuxserverurl
The LinuxServer.iolinuxserverurl team brings you another container release featuring easy user mapping and community support. Find us for support at:

linuxserver/kodi-headless

Docker PullshubDocker StarshubBuild Status
A headless install of kodi in a docker container, most useful for a mysql setup of kodi to allow library updates to be sent without the need for a player system to be permanently on.
kodiappurl

Usage

docker create --name=kodi-headless \
-v path to data:/config/.kodi \
-e PGID=gid -e PUID=uid \
-e TZ=timezone \
-p 8080:8080 \
-p 9090:9090 \
-p 9777:9777/udp \
linuxserver/kodi-headless

You can choose between ,using tags, various main versions of kodi.
Add one of the tags, if required, to the linuxserver/kodi-headless line of the run/create command in the following format, linuxserver/kodi-headless:Krypton

Tags

  • Helix
  • Isengard
  • Jarvis
  • Krypton
  • Leia : current default branch.

Parameters
  • -p 8080 - webui port
  • -p 9090 - websockets port
  • -p 9777/udp - esall interface port
  • -v /config/.kodi - path for kodi configuration files
  • -e PGID for GroupID - see below for explanation
  • -e PUID for UserID - see below for explanation
  • -e TZ - for timezone information eg Europe/London, etc

It is based on ubuntu bionic with s6 overlay, for shell access whilst the container is running do docker exec -it kodi-headless /bin/bash.

User / Group Identifiers

Sometimes when using data volumes (-v flags) permissions issues can arise between the host OS and the container. We avoid this issue by allowing you to specify the user PUID and group PGID. Ensure the data volume directory on the host is owned by the same user you specify and it will "just work" ™.
In this instance PUID=1001 and PGID=1001. To find yours use id user as below:
$ id dockeruser
  uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup)

Setting up the application

Mysql/mariadb settings are entered by editing the file advancedsettings.xml which is found in the userdata folder of your /config/.kodi mapping. Many other settings are within this file also.
The default user/password for the web interface and for apps like couchpotato etc to send updates is kodi/kodi.
If you intend to use this kodi instance to perform library tasks other than merely updating, eg. library cleaning etc, it is important to copy over the sources.xml from the host machine that you performed the initial library scan on to the userdata folder of this instance, otherwise database loss can and most likely will occur.
Rar integration with the Leia branch is now handled by an addon, it is compiled with this build, but you will need to enable it, if required, in the settings section of the webui.

Info

  • Shell access whilst the container is running: docker exec -it kodi-headless /bin/bash
  • To monitor the logs of the container in realtime: docker logs -f kodi-headless

Credits

For inspiration, and most importantly, the headless patches without which none of this would have been possible.

Various other members of the xbmc/kodi community for advice.

Versions

  • 23.06.19: Bump Leia to 18.3.
  • 23.04.19: Bump Leia to 18.2.
  • 09.03.19: Build vfs.libarchive and vfs.rar addons.
  • 08.03.19: Make Leia default branch, using patched "headless" build.
  • 30.01.19: Bump Leia branch to release ppa.
  • 03.09.18: Add back libnfs dependency.
  • 31.08.18: Rebase to ubuntu bionic, use buildstage and add info about websockets port.
  • 04.01.18: Deprecate cpucore routine lack of scaling.
  • 14.12.17: Fix continuation lines.
  • 17.11.17: Bump Krypton to 17.6.
  • 24.10.17: Bump Krypton to 17.5.
  • 22.08.17: Bump Krypton to 17.4.
  • 25.05.17: Bump Krypton to 17.3.
  • 23.05.17: Bump Krypton to 17.2.
  • 23.04.17: Refine cmake, use cmake ppa and take out uneeded bootstrap line.
  • 22.02.17: Switch to using cmake build system.
  • 22.02.17: Bump Krypton to 17.1.
  • 22.02.17: Change default webui user/pw to kodi/kodi.
  • 05.02.17: Move Krypton to default branch.
  • 20.09.16: Add kodi-send and fix var cache samba permissions.
  • 10.09.16: Add layer badge to README..
  • 02.09.16: Rebase to alpine linux.
  • 13.03.16: Make kodi 16 (jarvis) default installed version.
  • 21.08.15: Initial Release.

Serve Kodi Headless on your own domain behind Caddy, Nginx or Traefik. Fill in your domain and copy the result. It's a starting point, some apps need their own base URL or extra headers set too.

Proxying kodi-headless.example.com to http://kodi-headless:8080

Add this to your Caddyfile

kodi-headless.example.com {
	reverse_proxy http://kodi-headless:8080
}

Check the logs first

Nine times out of ten the logs tell you exactly what went wrong.

  • In Portainer, go to Containers, click the container, then Logs. Or run docker logs kodi-headless
  • Exit codes help too: 137 means killed, usually out of memory. 126 or 127 means the command inside the image is broken.

Port already in use

If deployment fails with "Bind for 0.0.0.0:8081 failed: port is already allocated", something else on your server is using that port.

  • Find what's using it: sudo ss -tlnp | grep :8081
  • Stop the other service, or pick a different host port. In 8081:8080 only the left number is yours to change, the right one belongs to the app.

Running but the page won't load

The container is up but nothing appears in your browser.

  • Use your server's real IP: http://your-server-ip:8081. The 0.0.0.0 link Portainer shows isn't a real address.
  • Give it a minute after first deploy, kodi-headless can take a while to initialise.
  • Make sure your firewall allows the port, e.g. sudo ufw allow 8081

Permission denied on volumes

If the logs show "permission denied", the app can't write to its data folder on the host.

  • Fix the ownership: sudo chown -R 1000:1000 /portainer/Files/AppData/Config/Kodi
  • Or set the PUID and PGID variables (defaults 1000:1000) to match your own user, found with id $USER

Image won't pull

Test the pull directly on the host: docker pull lsioarmhf/kodi-headless:latest

  • "manifest unknown" means the tag no longer exists. This template uses latest, so try pinning a specific version instead.
  • "toomanyrequests" is the Docker Hub rate limit. Log in with docker login to raise it.
  • "no space left on device" means a full disk. Reclaim space with docker system prune

"exec format error"

This means the image was built for a different CPU architecture than your server.

  • This image supports: arm
  • Check yours with uname -m: x86_64 is amd64, aarch64 is arm64. Raspberry Pi and other ARM boards are the usual culprits.

Container keeps restarting

The unless-stopped restart policy relaunches the app after every crash, so the real error can scroll past.

  • Check the logs right after a restart, the last few lines before it died are the useful ones.
  • Get the exit code with docker inspect kodi-headless --format '{{.State.ExitCode}}'
  • Still stuck? Redeploy once with the restart policy set to no so the failure stays visible.

Raise an issue

Found something which isn't working as it should? Here's how to report it.

A single container

Kodi Headless runs as one container, the simplest kind of app here. Just the one image to pull and nothing else wired up alongside it.

The app image

An image is the app packed up ready to go, everything Kodi Headless needs bundled into one download. This template pulls lsioarmhf/kodi-headless:latest, which Docker fetches once (about 131 MB) and then starts your own copy from.

Where the image comes from

Docker pulls its images from registries, public libraries of ready-built apps. Kodi Headless's comes from Docker Hub, published by lsioarmhf.

Version tags

The bit after the colon in the image name is the version tag. Here it's latest, which always points at the newest build, so a redeploy can bump you to a newer release without you asking. Pin a specific tag if you would rather stay on one version.

Which machines it runs on

Every image is built for particular CPU types. This one ships for arm, so it runs on ARM boards like a Raspberry Pi, but not regular x86 servers.

Ports

A port is the door the app answers on. A mapping like 8081:8080 means it's reachable on port 8081 of your server, where the left number is yours to change and the right one belongs to the app. Once it's running, open http://your-server-ip:8081 in a browser. It opens:

  • 8081:8080, likely the web interface
  • 9090:9090
  • 9777:9777 over UDP

Volumes

A volume is where Kodi Headless keeps its files so they survive an update or a restart. Without one, anything it saves would sit inside the container and vanish the moment it's recreated. This template mounts:

  • /config/.kodi from /portainer/Files/AppData/Config/Kodi on the host

Environment variables

Environment variables are the settings you hand over when you deploy, things like a password or a timezone. Kodi Headless takes 2 of them, all with defaults you can leave alone or tweak:

  • PUID, defaults to 1000
  • PGID, defaults to 1000

Restart policy

The restart policy here is unless-stopped, so Docker restarts Kodi Headless after a crash or reboot, but leaves it off when you stop it on purpose. You can change this on the deploy screen. The choices are no (never restart), on-failure (only after a crash), unless-stopped (restart unless you stop it), and always (bring it back no matter what).

Users and permissions

The PUID and PGID settings tell it which user and group to act as on your host. Point them at your own account (find yours with id $USER) so the files it writes into your mounted folders come out owned by you rather than root.

Networking

Nothing custom is set, so Kodi Headless sits on Docker's default bridge network: its own private space that reaches the outside world only through the ports it publishes.

Container name

Once it's deployed, Portainer names the container kodi-headless. That's what you'll spot in the containers list and use in commands like docker logs kodi-headless.

Platform

The platform is linux, the kind of system the container is built to run on. Docker and Portainer handle this on a normal Linux server.

Portainer app templates

Zooming out, this whole page comes from a Portainer app template: a short recipe telling Portainer how to set Kodi Headless up. Add the template list to Portainer once, then deploying Kodi Headless is a click rather than a wall of config.