Overview

View source on GitHub

OpenThread Border Router (OTBR) provides Docker support, and can be run in a Docker container rather than directly on your local machine.

This guide focuses on running OTBR Docker on the Raspberry Pi (RPi) or any Linux-based machine, and has only been tested on those platforms.

Raspberry Pi setup

Install the Raspberry Pi OS with Desktop OS on the RPi. Follow the instructions in the Download and Install the OS step from the Raspberry Pi Overview, but make sure to use Raspberry Pi OS with Desktop as the OS.

Once installed, boot up the RPi and open a terminal window.

  1. Update the system:

    sudo apt-get update
    sudo apt-get upgrade
    

  2. Install Docker:

    curl -sSL https://get.docker.com | sh
    
  3. If you want to use Docker as non-root, without requiring sudo before each command, modify your user settings. Sign out for the changes to take effect:

    sudo usermod -aG docker $USER
    

  4. Start Docker if it is not already running:

    sudo dockerd
    

  5. Install git:

    sudo apt install git
    

  6. OTBR firewall scripts create rules inside the Docker container. Run modprobe to load the kernel modules for iptables:

    sudo modprobe ip6table_filter
    

Linux setup

Use the same instructions as the RPi:

  1. Update the system:

    sudo apt-get update
    sudo apt-get upgrade
    

  2. Install Docker:

    curl -sSL https://get.docker.com | sh
    

  3. If you want to use Docker as non-root, without requiring sudo before each command, modify your user settings. Sign out for the changes to take effect:

    sudo usermod -aG docker $USER
    

  4. Start Docker if it is not already running:

    sudo dockerd
    

  5. Install git:

    sudo apt install git
    

  6. OTBR firewall scripts create rules inside the Docker container. Run modprobe to load the kernel modules for iptables:

    sudo modprobe ip6table_filter
    

Mac or Windows

To use OTBR Docker on Mac or Windows, install Docker Toolbox. This is required as running OTBR Docker involves mounting virtual serial ports, which is only supported by Docker Toolbox on those systems.

Get the OTBR Docker image

Get the OTBR Docker image by pulling it directly from the OpenThread Docker Hub, or by cloning the OTBR repository and building the included Dockerfile locally.

We recommend pulling the image from Docker Hub, as it has been tested and verified by the OpenThread team.

Pull the image from Docker Hub

This image is as of Commit ID e80def4.

  1. Pull the image:

    docker pull openthread/otbr:latest
    

  2. It should now appear in your list of Docker images:

    docker images
    REPOSITORY           TAG          IMAGE ID           CREATED           SIZE
    openthread/otbr      latest       98416559dcbd       2 weeks ago       1.15GB
    

Build the Dockerfile

To create the image yourself, clone the OpenThread Border Router repository and build the included Dockerfile.

  1. Clone the OTBR repository:

    cd ~
    git clone https://github.com/openthread/ot-br-posix
    cd ot-br-posix
    

  2. Build the Dockerfile:

    docker build --no-cache -t openthread/otbr -f etc/docker/Dockerfile .