Blogs

How to Install ROS 2 Humble on Raspberry Pi (Ubuntu 22.04.5 LTS)

How to Install ROS 2 Humble on Raspberry Pi (Ubuntu 22.04.5 LTS)

If you're using a Raspberry Pi and want to install ROS 2 (Robot Operating System), you're in luck — as of ROS 2 Humble, Ubuntu 22.04 (Jammy) receives Tier 1 support. This means no compiling from source, no Docker containers, just a clean, fast, binary install.

This guide will walk you through installing ROS 2 Humble on a Raspberry Pi, we are using a 4B model in this video (you can use any other model), with Ubuntu 22.04.5 LTS 64-bit, step-by-step.


Prerequisites

  • A Raspberry Pi (4GB or 8GB RAM recommended)
  • Ubuntu 22.04.5 LTS (Jammy) 64-bit installed
  • Internet access

Tip: You can easily install Ubuntu 22.04.5 64-bit for Raspberry Pi using the official Raspberry Pi Imager. Just launch the Imager, go to Other general-purpose OS > Ubuntu > and choose Ubuntu 22.04.3 LTS (64-bit) (it will upgrade to .5 automatically via updates).


Step 1: Make sure your system is updated

sudo apt update

This will NOT upgrade your OS — it just refreshes your package list.

If curl is not installed (you'll need it later):

sudo apt install curl

Step 2: Add the ROS 2 GPG key

sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg

Step 3: Add the ROS 2 apt repository

echo "deb [arch=arm64 signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu jammy main" | \
sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null

Step 4: Update apt again (now includes ROS 2)

sudo apt update

Step 5: Install ROS 2 Humble

Install the full desktop version (includes Rviz, demos, and tools):

sudo apt install ros-humble-desktop

Or, for a minimal install:

sudo apt install ros-humble-ros-base

Step 6: Source ROS 2 in every terminal

source /opt/ros/humble/setup.bash

To make this automatic every time:

echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
source ~/.bashrc

Step 7: Test the installation

In one terminal, run:

ros2 run demo_nodes_cpp talker

In another terminal, run:

ros2 run demo_nodes_cpp listener

If the listener receives messages, you're good to go!


Optional: Install build and workspace tools

sudo apt install python3-colcon-common-extensions

For dependency management with rosdep:

sudo apt install python3-rosdep
sudo rosdep init
rosdep update

You're done!

You’re now ready to build and run ROS 2 nodes on your Raspberry Pi. If you need help setting up your first workspace, GPIO integration, or motor control with ROS 2, feel free to reach out!


Author: Mahmood Shilleh
Brand: ShillehTek
Need help with Raspberry Pi, IoT, or Robotics? Find me on YouTube or Upwork.

Create a free account to access full content.

All access to code and resources on ShillehTek.

Signup Now

Already a member? Sign In

Need Project Support?

About ShillehTek

Helping builders and startups turn IoT ideas into real products. We design, solder, and support everything from Raspberry Pi sensors to full fleet deployments.