This guide provides step-by-step instructions to install Docker and run a ROS container on different operating systems: Windows, macOS, and Ubuntu.
Final Usage (once the whole setup is done) for Docker:
- Windows Installation
- macOS Installation
- Ubuntu Installation
- Native Installation , No docker(not recommened)
- Open PowerShell as Administrator.
- Run the following command:
wsl --install
- Once the installation is complete, reboot your system.
Note: If you already have WSL installed, you can skip this step and move to the next one.You can check if WSL is installed in your system by running
wsl --list --verbose
in the powershell. It will show the list of distros installed in WSL , if you have it already or else it will tell command not found.
- Visit the Docker installation page for Windows.
- Download the
.exe
file for Docker Desktop. - Run the installer and follow the on-screen instructions to complete the installation.
- After installation, reboot your system.
- Open Docker Desktop after logging into your system.
- In the bottom-right corner, open the Docker Terminal.
- Run the following command to start the ROS Docker container:
docker run -p 6080:80 --security-opt seccomp=unconfined --shm-size=512m saravan29/frosty_ros_docker:comb1
- Wait for the container to initialize. This may take around 30 minutes for first-time users.
Note: The first run may take some time to download necessary files and set up the environment.
- Open your web browser.
- In the address bar, type
localhost:6080
and press Enter. - You should now see your ROS environment running inside Docker.
- To stop it , run
contol + C
in the terminal and to run the container again , just toggle the play button in the docker desktop , no need to folow the command line code again :))
Note: you have to only do this once (pasting the commad in the terminal) from the next time just toggle the play button in the containers section of docker desktop has shown in the above pic
- Download and install XQuartz from here.
- Follow the on-screen instructions to complete the installation.
- Visit the Docker installation page for macOS.
- Download the
.dmg
file for Docker Desktop. - Run the
.dmg
file and follow the on-screen instructions.
- Open Docker Desktop after logging into your system.
- In the bottom-right corner, open the Docker Terminal.
- Run the following command to start the ROS Docker container:
docker run -p 6080:80 --security-opt seccomp=unconfined --shm-size=512m saravan29/frosty_ros_docker:comb1
- Wait for the container to initialize. This may take around 30 minutes for first-time users.
Note: The first run may take some time to download necessary files and set up the environment.
- Open your web browser.
- In the address bar, type
localhost:6080
and press Enter. - You should now see your ROS environment running inside Docker.
- To stop it , run
contol + C
in the terminal and to run the container again , just toggle the play button in the docker desktop , no need to folow the command line code again :))
Note: you have to only do this once (pasting the commad in the terminal) from the next time just toggle the play button in the containers section of docker desktop has shown in the above pic
Note: If you are using an environment other than GNOME, install GNOME Terminal using the following command:
sudo apt install gnome-terminal
- Download the
.deb
file for Ubuntu from the Docker installation page.
- Open the terminal and enter the following commands:
sudo apt-get update sudo apt-get install ./docker-desktop-amd64.deb
- Reboot your system.
- Open the Terminal.
- Run the following command to start the ROS Docker container:
docker run -p 6080:80 --security-opt seccomp=unconfined --shm-size=512m saravan29/frosty_ros_docker:comb1
- Wait for the container to initialize. This may take around 30 minutes for first-time users.
Note: The first run may take some time to download necessary files and set up the environment.
- Open your web browser.
- In the address bar, type
localhost:6080
and press Enter. - You should now see your ROS environment running inside Docker.
- To stop it , run
contol + C
in the terminal and to run the container again , just toggle the play button in the docker desktop , no need to folow the command line code again :))
Note: you have to only do this once (pasting the commad in the terminal) from the next time just toggle the play button in the containers section of docker desktop has shown in the above pic
The above method of using using ROS is more then enough , EASY and well organizesd for the bootcamp , but if you want to delve more into robotics in future , its advisable to use ROS natively in ubuntu ,you can follow the below steps to install it :
WARNING - The following installation procedures can make you do stuff like this ...
or even worse.
-
Ubuntu Installation :(( If you are already using ubuntu , then skip to the ROS installation part)
Dual-boot: Follow this Tutorial or this Video Tutorial to dual-boot Ubuntu with Windows. For MacOS, follow the procedure in this video tutorial
[WARNING], Do at your own risk! We will be not responsible if you lose your data. Follow instructions carefully and make backups before you start!
Note: For absolute beginners, we recommend going for any one of the this installation , we suggest you to go with the docker part mentioned above. Dual-booting can be a little daunting. And you can always opt for dual-booting once you're comfortable with linux.
-
Get familiar with Linux: Here are a few additional resources that you can refer to in order to get familiar with Linux:
-
Clearing the Pitch before ROS Installation:
- We will be using ROS2 Humble for the bootcamp , because its well documented and has a large coumminunity . So before you install ROS2 humble in your system , make sure you dont have any previous installs of ROS (even the faulty installs ) for that you can run the below commands.
dpkg -l | grep ros-*
- To check which version of ros is installed. if you get any output other then humble then follow the below commads to remove it
sudo apt remove ~nros-<your-ros-version like>-*
- then run this for cleaning up
sudo apt autoremove
-
ROS Installation/Setup:
- Ubuntu 22.04: ROS2 HUMBLE Go to a particular link and put your first step in the world of ROS. once you have installed ROS , you have to configure it follow this link Configure
If you don’t want to have to source the setup file every time you open a new shell, then you can add the command to your shell startup script:
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc