DIY Entertainment Linux

Raspberry Pi Media Center: How to Install Kodi on Raspbian

Christian Cawley 12-03-2018

You want to turn your Raspberry Pi into a media center, but you also need it for other tasks? Perhaps you’re using your Pi for programming, or playing Minecraft. It might have a role as a general project machine, meaning you need regular access to Raspbian.


One solution to this might be to keep several microSD cards at hand, each with different operating systems installed. You might have one with Raspbian ready to run, another with a retro gaming distro, and a third with OSMC, openELEC, or LibreELEC. These are the three Kodi-based Raspberry Pi distributions, and the most common solutions. It’s easy to write one of these to microSD card to set up your Raspberry Pi-based Kodi box.

But if you only have a single microSD card, wouldn’t it be far simpler to just install Kodi on Raspbian? Here’s how!

how to install kodi on raspbian media center

Make Sure You’re Using Raspbian Stretch

Before proceeding, you’ll need to make sure your Raspberry Pi is running the latest version of Raspbian, Stretch. This was released in mid-2017, so if you’ve been regularly using your Pi since then, you really should have upgraded.

You can check if you’re using Raspbian Stretch by opening a terminal window and entering:

cat /etc/*-release

The resulting text (see the screenshot) will show you which Linux operating system and version you’re using.

how to install kodi on raspbian media center

If you’re on an older version, you can download Raspbian Stretch from the Raspberry Pi website and flash it to your microSD card How to Install an Operating System on a Raspberry Pi Here's how to install an OS on your Raspberry Pi and how to clone your perfect setup for quick disaster recovery. Read More . This is the recommended option, although it is possible to upgrade manually from within Raspbian Jessie. However, you may run into problems doing it this way, and it’s always good to start with a fresh install.

If flashing doesn’t suit you, try installing Raspbian using the NOOBS installer tool.


If you have data on your Raspberry Pi that you’ll need in Raspbian later on, make sure you back it up first.

Also, make sure you’re using a Raspberry Pi 2 or later. The Raspberry Pi 3 and the Pi Zero, are both suitable The Raspberry Pi Board Guide: Zero vs. Model A and B With so many different Raspberry Pi models, how do you know which one to buy? Our ultimate guide tells you everything you need to know! Read More ; sadly, the original Raspberry Pi Model B is too slow to reliably run Kodi.

Configuring Your Raspberry Pi for Kodi

Before you install Kodi, you’ll need to ensure your Pi is set up correctly. Three things need to be changed:

  • Expanding file system (this should happen automatically when booting Stretch for the first time)
  • Altering memory split
  • Enabling video codecs

Additionally, you’ll need to ensure Broadcom desktop drivers are set.


All three of these things can be done using raspi-config. You can access this on the desktop via Preferences > Raspberry Pi Configuration, or in the command line:

sudo raspi-config

Expanding the Filesystem

how to install kodi on raspbian media center

If you haven’t already expanded the filesystem, and it didn’t happen automatically when you booted (which gives your Pi more space to run software), you should do so now.

This will improve overall performance of your Kodi box, as there will be more space on the microSD card for installing add-ons and caching data. (By default, Raspbian installs into a partition that is smaller than the microSD card.)


To take full advantage of your microSD card’s capacity, open raspi-config and select the first option, Expand Filesystem. Select OK to confirm your choice, and follow the instructions to restart your Raspberry Pi.

Altering Memory Split

how to install kodi on raspbian media center

Next, you’ll need to change the memory split. Kodi on the Raspberry Pi 2 or Raspberry Pi 3 requires 256MB dedicated to the GPU to run correctly.

Again, run raspi-config, then go to Advanced Options > Memory Split and set the split to 256MB.

Enabling Video Codecs

how to install kodi on raspbian media center

Finally, you need to enable certain video codecs that don’t run as standard. These include VP6, VP8, MJPEG, and Theora, among others. To do this, you need to enable the camera. While no camera needs to be connected, enabling this feature will ensure the codecs can be used.

Do this via Interfacing Options > Camera > Yes. Confirm with OK. Note that you can also effect this change via the config.txt file. Found in the /boot/ directory on your Raspberry Pi’s microSD card, this is the only directory that can be read in Windows.

To do it this way, open config.txt on your desktop computer and add:


Save the file, exit, and safely eject your microSD card before replacing in the Raspberry Pi and rebooting.

Setting the Right Desktop Driver

The last pre-install change you need to make is to the desktop driver. Kodi will not function if you’re not using the Broadcom drivers for your Raspberry Pi’s display. As such, you’ll need to ensure the default driver is set.

In raspi-config, select Advanced Options > GL Driver and set Original non-GL desktop driver. Select OK to confirm, and reboot again if prompted.

Installing Kodi on Raspbian Stretch

To get Kodi running on Raspbian, you’ll need to begin with the basics. First, update packages, then check for updates:

sudo apt update
sudo apt upgrade

Once these updates are complete, you’re ready to install Kodi:

sudo apt install kodi

However, there’s a bit more to it than that. Installing Kodi is only part of the challenge, as you’ll also need to configure it slightly. This is likely to work best on Raspbian, although this is by no means the only OS you can use.

how to install kodi on raspbian media center

Once Kodi has downloaded and installed, you’ll probably want to make some tweaks. This ensures you get the best performance out of the media center.

Tweaking the Kodi Install

Kodi should already work, but perhaps not to your liking. Further tweaks can be made, such as choosing some additional components, or configuring Kodi to auto-start when your Pi boots.

To find out what binary add-on packages are available, run:

apt-cache search kodi

how to install kodi on raspbian media center

Scroll through the list to see what is available. For instance, if you want to add joystick support and the DVBLink PVR, use

sudo apt install kodi-peripheral-joystick kodi-pvr-dvblink

You should now be able to control your Raspberry Pi Kodi box with a joystick, and record live TV streams to an attached storage device.

Meanwhile, to instruct Kodi to launch when you switch on your Raspberry Pi, you’ll need to edit the autostart file via SSH (how to do that) or the command line on your Pi:

sudo nano ~/.config/lxsession/LXDE-pi/autostart

Here, add a line to the end:


how to install kodi on raspbian media center

Then, save the file and exit with Ctrl + X. When you next reboot your Raspberry Pi, it should boot straight into Kodi. Exiting Kodi, meanwhile, will let you back into the Raspbian desktop!

It Doesn’t Have to Be Raspbian

how to install kodi on raspbian media center

We’ve focused on using Raspbian as the base for your Kodi install, but it doesn’t have to be. You might be using one of the many other Raspberry Pi-compatible operating systems 23 Operating Systems That Run on Your Raspberry Pi Whatever your Raspberry Pi project, there's an operating system for it. Here are the best Raspberry Pi operating systems! Read More . There’s no reason why Kodi shouldn’t run on Ubuntu, for example, or Arch Linux.

Related topics: Kodi, Media Center, Raspberry Pi, Raspbian.

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Mukund Wavhal
    March 10, 2019 at 8:38 am

    How to return to the raspberrian desktop from Kodi?
    As after following all instructions and installing Kodi my TV screen displays blank. Pi is able to boot to desktop, but after Kodi getting auto started display goes blank and I'm unable to do anything.

  2. pietuithellevoet
    February 25, 2019 at 4:48 pm

    sudo nano ~/.config/lxsession/LXDE-pi/autostart gives an error; lxsession/LXDE-pi/autostart doesn't exist. When I made the dir/file manually kodi indeed starts automatically. But when I shut down kodi the desktop won't load, the screen stays black. For all the rest thumbs up, I like to stay in control.

  3. 1_IT_Junkie
    December 30, 2018 at 1:56 am

    Thank you! Clear and precise instructions. Works great!

  4. Just another idiot thinking it would actually work
    November 10, 2018 at 10:46 pm

    sudo: raspi: command not found
    Like every other linux instruction. Just doesn't work.

    Just another idiot thinking it would actually work

    • p
      December 7, 2018 at 6:20 pm

      the idiot is obviously the one that entered the comment (aka YOU). You should be able to follow instructions before jerking off online. There is no colon between sudo and raspi, you entered it incorrectly. Command works.

  5. Priceman
    October 8, 2018 at 11:15 am

    Got the error that the GL driver was disabled when I tried to use the original per the instructions.

  6. Mike E.
    July 23, 2018 at 5:45 pm

    I installed Kodi as per your instructions. All is well. How do I display/control kodi through my VNC connection?