This guide was tested on a Linux machine (Debian 12 - Bookworm), proper, up to date system with administrative privileges for the installing user. The following instructions are also compatible with other Debian based distributions like Ubuntu.

Installing Docker

Source : https://docs.docker.com/engine/install/debian/

Before you install Docker Engine for the first time on a new host machine, you need to set up the Docker apt repository. Afterward, you can install and update Docker from the repository.


Wow, if only there was a post that would teach you about APT.


  1. Set up Docker’s apt repository.
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
  1. Install the Docker packages.
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
  1. Verify that the installation is successful by running the hello-world image:
sudo docker run hello-world

This command downloads a test image and runs it in a container. When the container runs, it prints a confirmation message and exits.

You have now successfully installed and started Docker Engine.

Setting up the Docker container

source : https://github.com/git-artes/docker-gnuradio

We’ll be using the git-artes/docker-gnuradio as a base and make some very minor changes :

  • I prefer nano to vim, so I’ll substitute it in the Dockerfile
Your bo's don't mean nothin to me
  • I also will fix the Python environment variable (Switch the syntax to the recommended) All in all, the docker file should look something like this :
FROM ubuntu:20.04
LABEL maintainer="Federico 'Larroca' La rocca - flarroca@fing.edu.uy"

#ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update

# else it will output an error about Gtk namespace not found
RUN apt-get install -y gir1.2-gtk-3.0

# to have add-apt-repository available
RUN apt-get install -y software-properties-common

RUN add-apt-repository -y ppa:gnuradio/gnuradio-releases-3.9

# create user gnuario with sudo (and password gnuradio)
RUN apt-get install -y sudo
RUN useradd --create-home --shell /bin/bash -G sudo gnuradio
RUN echo 'gnuradio:gnuradio' | chpasswd

# I create a dir at home which I'll use to persist after the container is closed (need to change its ownership)
RUN mkdir /home/gnuradio/persistent  && chown gnuradio /home/gnuradio/persistent

RUN apt-get update

RUN apt-get install -y gnuradio

# installing other packages needed for downloading and installing OOT modules
RUN apt-get install -y gnuradio-dev cmake git libboost-all-dev libcppunit-dev liblog4cpp5-dev python3-pygccxml pybind11-dev liborc-dev

# of course, nothing useful can be done without vim
RUN apt-get install -y nano 

USER gnuradio

WORKDIR /home/gnuradio

ENV PYTHONPATH=/usr/local/lib/python3/dist-packages:$PYTHONPATH

CMD bash

The above Dockerfile is for GNU Radio 3.9 but making the same changes for other versions would work too.

Once the file is created, we just have to build it using :

docker build -t ubuntu:gnuradio-releases .

This might take some time, but once it’s done, you’re free to run the container :

docker run --net=host --env="DISPLAY" --volume="$HOME/.Xauthority:/root/.Xauthority:rw" --device /dev/snd -v persistent:/home/gnuradio/persistent --device /dev/dri -v /dev/bus/usb/:/dev/bus/usb/ --privileged --group-add=audio -it ubuntu:gnuradio-releases bash

This provides :

  • USB device access (--device /dev/bus/usb)
  • Audio support
  • X11 GUI
  • Network access (for UHD/USRP)
  • A persistent volume for your work directory

Now you’ll find yourself inside the container. I’ll give a high level tutorial on how to interact with the container so you can start, stop it and interact with it at will.

  1. First exit the container, just type in exit.
  2. To check what containers you have and their status : docker ps -a
  3. To start the container : docker start gnuradio
  4. To stop the container : docker stop gnuradio
  5. To access the container : docker exec -it gnuradio bash

Installing the UHD drivers

source : https://kb.ettus.com/Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux

note : The password for the user gnuradio is gnuradio

Once inside the container, make sure to update the packages that are already installed :

sudo apt update && apt upgrade -y

Next, you’ll need to install a bunch of packages :

sudo apt -y install autoconf automake build-essential ccache cmake cpufrequtils doxygen ethtool fort77 g++ gir1.2-gtk-3.0 git gobject-introspection gpsd gpsd-clients inetutils-tools libasound2-dev libboost-all-dev libcomedi-dev libcppunit-dev libfftw3-bin libfftw3-dev libfftw3-doc libfontconfig1-dev libgmp-dev libgps-dev libgsl-dev liblog4cpp5-dev libncurses5 libncurses5-dev libpulse-dev libqt5opengl5-dev libqwt-qt5-dev libsdl1.2-dev libtool libudev-dev libusb-1.0-0 libusb-1.0-0-dev libusb-dev libxi-dev libxrender-dev libzmq3-dev libzmq5 ncurses-bin python3-cheetah python3-click python3-click-plugins python3-click-threading python3-dev python3-docutils python3-gi python3-gi-cairo python3-gps python3-lxml python3-mako python3-numpy python3-numpy-dbg python3-opengl python3-pyqt5 python3-requests python3-scipy python3-setuptools python3-six python3-sphinx python3-yaml python3-zmq python3-ruamel.yaml swig wget

Next, follow these steps to install UHD (USRP Hardware Driver) from source :

1. Prepare the Installation Environment

cd $HOME
mkdir workarea
cd workarea

2. Clone the UHD GitHub Repository

git clone https://github.com/EttusResearch/uhd
cd uhd
git checkout v4.8.0.0

use git tag -l and checkout the latest version (replace v4.8.0.0 with the latest version available at the time).

3. Set Up the Build Directory

cd host
mkdir build
cd build

4. Configure the Build Environment

cmake ..

5. Build and Install

Once the environment is configured, compile UHD using:

make

Then install it with :

sudo make install

6. Post-Installation

Update the shared library cache and add UHD to your environment:

sudo ldconfig
echo 'export LD_LIBRARY_PATH=/usr/local/lib' >> ~/.bashrc

Also, some display problems popped up while I was testing this out, I also recommend applying these changes:

echo 'export DISPLAY=:0.0' >> ~/.bashrc

And if the gnuradio-companion doesn’t work because of display issues after exporting the $DISPLAY environment variable try doing this on your host machine (outside the container).

xhost +local:

7. Test the Installation

To verify that UHD is installed and can detect connected USRP devices:

uhd_find_devices

If a USRP is connected, it should appear in the output.

You can now use GNU Radio with USRP devices inside the Docker container.