Kodi is a compelling media solution that can give your Raspberry Pi plenty of extra capabilities. This guide will provide you with step-by-step instructions on how to get Kodi set up on your Raspberry Pi. We’ll also explain the advantages of using Kodi and why it’s quickly becoming the chosen media platform for many tech enthusiasts.
What is Kodi?
Kodi is an open-source media player software that provides a user-friendly interface to easily access and play digital media files from local and network storage media as well as the internet. Kodi is highly customizable with add-ons and skins and supports multiple operating systems including Windows, Mac, Linux, Android, IOS, Smart TV, Apple TV, MI Tv, Fire Sticks, Raspberry Pi, Chromebook, And Android TV Box making it a widely accessible multimedia platform.
Why Use Kodi on Raspberry Pi?
Raspberry Pi is a convenient, cost-effective computer that runs on Linux-based OS. It easily outperforms other computers in terms of affordability and size, making it an excellent choice for media enthusiasts looking for an immersive experience. Kodi is the ideal media player solution for Raspberry Pi due to its low power consumption and easy installation process.
In order to get Kodi running on our Raspberry Pi, we used the following hardware.
- Raspberry Pi
- Micro SD Card
- Ethernet Cable or Wi-Fi
- Power Supply
- HDMI Cable
- Raspberry Pi Case
- USB Keyboard
- USB Mouse
Installing Kodi on Raspberry Pi OS
This section will provide a step-by-step guide to installing Kodi onto the Raspberry Pi OS. We’ll present an easy-to-follow approach so that you can have Kodi up and running quickly. Let’s get started!
For today’s session, you’ll need to either have installed the desktop or lite editions of Raspberry Pi OS. If installing the lite edition, please make sure that SSH is enabled on your device. Once those validations are complete, we can proceed with the next steps.
Kodi can be installed quickly and easily with Lite, allowing for maximum memory and CPU performance. When you install Kodi, Lite will make sure all the relevant packages are installed to display it correctly on your device.
Step 1: Prior to installing Kodi, it is important to verify that Raspberry Pi’s operating system is up-to-date.
Installing the latest firmware on your device can be completed in two easy steps. For updating, simply enter the given commands below.
sudo apt update
sudo apt full-upgrade
By issuing these two commands, you can refresh the package list and upgrade any packages that have a newer release.
Step 2: After your Rasberry Pi has updated, you can install Kodi.
- Kodi is included in the Raspbian official package repository, making installation a bit easier.
- Executing the command below on the Raspberry Pi will install Kodi.
sudo apt install kodi
Depending on the speed of your network, this installation may take quite a while. The minimum amount of free space on your SD card is 800 MB.
Compiling Kodi on Raspberry Pi OS Bullseye
To use Kodi with Raspberry Pi OS Bullseye, you may need to compile it. The steps below will guide you through the compilation process.
Please keep in mind that the compilation process, while simple, takes a long time. You must also ensure that you have enough space on your SD card.
Preparing to Compile Kodi
Before we can compile Kodi on our Raspberry Pi, we must first complete a few preliminary steps. Follow the steps below to get your device ready.
Step 1: Before we proceed, we must ensure that the package list is up to date.
Run the following command on your device to update the package list.
sudo apt update
Step 2: After updating the package list, we must install the countless packages required to compile Kodi on the Raspberry Pi OS.
This is a fairly large command because Kodi’s codebase is heavily reliant on third-party libraries.
“sudo apt install -y autoconf automake autopoint git gettext autotools-dev cmake curl gawk g++ libasound2-dev libass-dev libavahi-client-dev libavahi-common-dev libbluetooth-dev libbluray-dev libbz2-dev libcdio-dev libcdio++-dev libcec-dev libp8-platform-dev libcrossguid-dev libcurl4-openssl-dev libcwiid-dev libdbus-1-dev libegl1-mesa-dev libenca-dev libflac-dev libfontconfig-dev libfmt-dev libfreetype6-dev libfribidi-dev libfstrcmp-dev libgcrypt-dev libgif-dev libgles2-mesa-dev libglu-dev libgnutls28-dev libgpg-error-dev libgtest-dev libiso9660-dev libjpeg-dev liblcms2-dev liblirc-dev libltdl-dev liblzo2-dev libmicrohttpd-dev libmariadb-dev libnfs-dev libogg-dev libpcre3-dev libplist-dev libpng-dev libsmbclient-dev libspdlog-dev libsqlite3-dev libssl-dev libtag1-dev libtiff-dev libtinyxml-dev libtool libudev-dev lsb-release meson nasm ninja-build python3-dev python3-pil rapidjson-dev swig unzip uuid-dev yasm zip zlib1g-dev libgbm-dev libdrm-dev libinput-dev libxkbcommon-dev default-jdk libunistring-dev libflatbuffers-dev libdav1d-dev libavutil-dev libavformat-dev libavfilter-dev libavcodec-dev libswscale-dev libpostproc-dev libiso9660++-dev libxslt-dev libshairplay-dev libaacs-dev libcap-dev libpulse-dev default-libmysqlclient-dev libdvdread-dev debhelper libglm-dev libjsoncpp-dev”
Step 3: Now that we’ve installed all of the packages on your Raspberry Pi, we can clone a branch of Kodi that has been tweaked to work best on Bullseye.
- To clone this repository, run the following command on your Pi.
git clone -b bullseye https://github.com/popcornmix/xbmc.git kodi_gbm
This repository is fairly large, so cloning your device may take some time.
Compiling and Installing Kodi
We can now compile and install Kodi on our Raspberry Pi after getting it ready.
- We need to go to the directory where the Kodi source code was just copied.
You can use the command below to move to this directory.
- Now that we are in the right directory, we can use the following command to start the compilation process.
Please keep in mind that the compilation process takes a long time because there is a lot of code to compile.
- After Kodi has been put together, we can install it on our system. Everything will have been put into the “build/packages” subdirectory after we ran the compilation script.
Use the following command to move to this subdirectory.
- To install all of the packages we just compiled, we will be using the “dpkg” tools “-i” option.
Run the command below on your Pi to put all of the packages in place.
sudo dpkg -i kodi-bin_19*.deb kodi_19.*.deb kodi-addon-dev*.deb kodi-tools-texturepacker*.deb
Installing Additional Kodi Addons
- The default compilation script only installs the minimum number of add-ons needed to get Kodi running on your Raspberry Pi.
However, there are some additional ones that you may want to use, such as the “inputstream adaptive” plugin that is used by the Netflix on Kodi addon and many more.
In the next few steps, we’ll show you how to compile and install these add-ons along with Kodi.
- First, we need to make sure we’re in the repository’s top-level directory.
You can use the command below to move to this directory.
- Now that we’re in this directory, we can put together any official Kodi add-ons we need.
For the first part of this command, we set a list of addons we want compiled to a variable called “
- You can add more add-ons to this line in order to compile more add-ons. We put some plugins in this guide that most people might need.
At the same time, we make a call to the “build_rpi_debian_packages.sh” script. We use the “-a” option to tell it that we to compile addons.
ADDONS_TO_BUILD=”inputstream.adaptive pvr.hts screensaver.shadertoy visualization.shadertoy” \ ./build_rpi_debian_packages.sh -a
- This time, there is much less code to compile, so it should take much less time to do.
- When your Raspberry Pi is done compiling the Kodi addons, you can use this simple one-line command to install them.
sudo dpkg -i build_armhf/addons_build/*.deb
- This simple-one line command will install all Debian packages that are stored within the “addons_build” subdirectory.
Configuring Hardware Acceleration on a Raspberry Pi 4
If you are using a Raspberry Pi 4, you will need to change your boot configuration file to let Kodi use HEVC hardware acceleration.
- Use the following command on your Raspberry Pi to change the boot configuration file.
- This file can also be changed by putting the Micro SD card into a different device and editing it there.
sudo nano /boot/config.txt
Find the “pi4” header in the file and add the new driver below it.
When using nanom you can use CTRL + W to search the contents of the file.[pi4]
- Add the next line to the bottom of this file. Simply put, this will make the Raspberry Pi load the driver used for HEVC hardware acceleration.
- You will also need to increase the CMA allocation if you want to use 4K HEVC files on your Pi. If this limit is raised, the video driver will be able to access more memory.
- Look for the line below in the config file.
- Change that line to this one, which will increase the CMA allocation.
4. Once you have made the changes to the configuration file, save and quit by pressing CTRL + X, then Y, followed by the ENTER key.
- You will have to restart your Raspberry Pi for these changes to take effect.
- Use the following command in the terminal to restart your device.sudo reboot
Running Kodi on your Raspberry Pi
- You can put Kodi on your Raspberry Pi in two different ways.
- One way is to use a simple command in the terminal to load Kodi.
- You can also use the automatically made entry on the desktop interface to open it.
Opening Kodi on the Raspberry Pi OS Desktop Interface
- We’ll show you how to find and load Kodi on the desktop interface in this section.
- First, click the raspberry icon in the top left corner of the screen to open the start menu.
- Move your cursor over the “Sound & Video” option in the Start menu (1.).
- When you move your mouse over this option, some more options will show up. Click “Kodi” in this submenu to open it (2.).
- Your Raspberry Pi should now be running Kodi.
Launching Kodi using the Terminal
- Using the terminal to open Kodi is easy because all you have to do is type a single command.
- Type the following command into your Raspberry Pi.
- This command will start up the version of Kodi that works on its own on your device.kodi-standalone
- On your Raspberry Pi, Kodi should start up right away.
- You can use the following command to start Kodi without it taking over your terminal session.
- kodi-standalone &
- Adding the ampersand (&) tells bash to run this command at different times.
- You can keep using your current terminal session if you use this character.
- Now, Kodi should be up and running on your device.
- If you can’t see anything, make sure the HDMI cable is plugged in correctly.
Getting Kodi to Auto-Start on the Raspberry Pi
In this section, we’ll show you how to make your Raspberry Pi start Kodi automatically. We will need to make a system service file to do this. Don’t worry, because this process is pretty simple. The nano text editor will be used to make the service file. Run the following command on your Raspberry Pi to start making this service for Kodi.
- sudo nano /lib/systemd/system/kodi.service
Put the following lines of text into this file.[Unit] Description = Kodi Media Center
After = remote-fs.target network-online.target
Wants = network-online.target [Service] User = pi
Group = pi
Type = simple
ExecStart = /usr/bin/kodi-standalone
Restart = on-abort
RestartSec = 5 [Install] WantedBy = multi-user.target
When the network comes online, these lines will tell the service manager to run the Kodi binary. It will also wait until all of the remote filesystems are connected. Kodi should be able to use all of your networked shares because the filesystem has to be online.
- Once all the lines are filled in correctly, we can save our Kodi service.
- Press CTRL + X, then Y, and then ENTER to save the file.
- 4. Now that the service has been made, the next step is to turn it on.
- By running the following command on your Raspberry P, we can turn on the Kodi service.
sudo systemctl enable kodi
If you turn on a service, the service manager will start it automatically when the system boots. You can run the command below to get Kodi to start right away.
sudo systemctl start kodi
You should now have Kodi running on your Raspberry Pi, if that was your goal. If you want to get more out of Kodi, you could mount an external hard drive or set up a remote control. Please leave a comment below if you’ve found any problems.
- Is Kodi legal?
- While Kodi itself is not illegal, some Add-Ons may be.
- Can I install Kodi on Raspberry Pi?
- Kodi is compatible with Firestick and can be downloaded and installed on it.
- What is the difference between Kodi and Netflix?
- While Netflix is a paid service that allows users to watch movies and TV shows whenever they want, Kodi is simply a media player.
- How do I update Kodi on Raspberry Pi?
- The Android version of Kodi can be kept up-to-date through the app itself or by downloading the most recent version from the official website. or read our detailed guide on it.
- Do I need a VPN to use Kodi on Raspberry Pi?
- A virtual private network (VPN) isn’t required to use Kodi, but it can improve security and privacy.