The Docker installation path lets you run ROS2 Humble on Windows, macOS, or any Linux distribution without modifying your host operating system. Everything runs inside an isolated container, making it straightforward to start fresh, share environments with teammates, or run multiple ROS2 versions side-by-side. GUI tools such as RViz2 and Gazebo are supported on Windows via X11 forwarding using Xming/Xlaunch.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/xXThanatosXx/MobileRobot/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Docker Desktop
Install Docker Desktop for your platform (Windows, macOS, or Linux). Ensure the Docker daemon is running before executing any
docker commands.Xlaunch / Xming
Required on Windows for GUI display forwarding. Install Xming and launch Xlaunch before starting the container to enable tools like RViz2 to render their windows on your desktop.
Container Setup
- Pull Pre-built Image
- Build from Dockerfile
The fastest way to get started is to pull the pre-built ROS2 Humble image published to Docker Hub. Open a terminal (CMD, PowerShell, or bash) and run the following commands.Pull the image:Verify the image was downloaded:You should see This drops you directly into a bash shell inside the container. The Stop the running container:
xxthanatosxx/ros2-humble listed with tag 1.0.0 in the output.Create and start an interactive container:--name flag assigns a memorable name so you can manage the container easily.Start the container again after stopping it:ROS2 Configuration Inside the Container
Once you have a running container (from either tab above), complete the following steps to configure the ROS2 environment and verify the GUI stack.Source the ROS2 setup file
In the container’s bash shell, source the ROS2 environment for the current session:
Persist the source line in .bashrc
Open Add the following line at the end of the file, then save with Ctrl + O and exit with Ctrl + X:
.bashrc with nano so the environment is loaded automatically in every new shell:Launch RViz2
With Xlaunch running on your host, launch RViz2 to confirm that GUI forwarding is working correctly:The RViz2 window should appear on your host desktop, rendered through Xming. If the window does not appear, ensure Xlaunch is running and that the
DISPLAY variable inside the container is set to host.docker.internal:0.File Transfer Between Host and Container
You can copy files and folders in both directions between your Windows host and the running container usingdocker cp.
Copy from host to container:
The
docker cp command works regardless of whether the container is running or stopped, making it a reliable way to extract build artifacts or log files after a session ends.