Setup Real-Time Kernel (Debian, prebuilt package)
This guide describes the recommended and simplest way to set up a real-time (PREEMPT_RT) PC and prepare it for ROS 2 development using RTW.
We’re using a pre-build binary on Linux Debian distribution and a docker container with Ubuntu 24.04 with real-time permissions.
Note
This is the Debian alternative to compiling a PREEMPT_RT kernel from source on Ubuntu.
Debian ships prebuilt -rt-amd64 kernel packages, so no compilation is needed here — ROS itself still runs inside an Ubuntu 24.04 docker container.
Operating System Installation
Download the newest Debian stable version.
It is recommended to use the complete installation image from: https://www.debian.org/CD/
Create a bootable USB (e.g., using
ddon Linux).Boot from the USB and select
Graphical Installer.Follow installation steps:
Be aware Debian uses a separate
rootuser. Don’t get confused with two passwords. The root user has no name; access it with thesu -command.Install
sshduring setupChoose your preferred window manager (recommended: Plasma)
Configure networking:
Main network according to your company requirements
Login to the PC after installation (recommended: Plasma on X11):
Set up a networking - usually your company network and dedicated RT ethernet interface for your robot with a static IP.
Initial System Setup
Connect via SSH from engineering PC.
Add your user to sudo:
su -
usermod -a -G sudo <user_name>
exit
Re-login and verify sudo access.
Update system:
sudo apt update
PREEMPT_RT Kernel Installation
Check current kernel:
uname -r
Install matching RT kernel:
Check the current kernel version with uname -r, e.g., 6.12.74+deb13+1-amd64.
Then, install the exact same version of kernel with PREEMPT_RT flag
sudo apt install linux-image-<version>-rt-amd64
Reboot:
sudo reboot
Verify RT kernel:
uname -a
# should contain PREEMPT_RT
Realtime Permissions Setup
Install Docker (APT method):
See general info on docker installation (Debian’s official apt repo).
Configure
realtimeanddockergroups and configure limits:
sudo usermod -aG docker $USER
sudo addgroup realtime
sudo usermod -aG realtime $USER
sudo tee -a /etc/security/limits.conf <<EOF
@realtime soft rtprio 99
@realtime soft priority 99
@realtime soft memlock unlimited
@realtime hard rtprio 99
@realtime hard priority 99
@realtime hard memlock unlimited
EOF
Logout/login and verify:
You should see docker and realtime groups in the output.
groups
RTW and ROS Workspace Setup
Install RTW:
Create RT-enabled workspace:
rtw workspace create \
--ws-folder <my-ws-name> \
--ros-distro <my-distro> \
--docker \
--disable-nvidia \
--repos-containing-repository-url \
https://<repo-url>.git \
--repos-branch master \
--apt_packages <additional-pkg-1> \
<additional-pkg-2>... \
--enable-realtime
Exit container and source workspace:
Exiting the container saves the workspace configuration in RTW.
rtw ws <my-ws-name>
Enter container:
rtw docker enter
Verification and Testing
Verify RT kernel inside container:
uname -a
# should contain PREEMPT_RT