ROS 1 by default does not start on bootup, but its really handy to be able to just power on a robot and have all your ROS nodes launch. There are many ways to do this in linux including the systemd, rc.local file. We recommend using systemd because it has logging builtin, it can be configured to try again if there are errors in bringup, and it can be stopped and restarted.

Systemd setup

You will need to create 3 files to setup systemd


This file will start roscore, you need to make sure to fill in your user name where is says [TODO] and change kinetic to whichever ROS version you are using

User=[TODO enter user name here]
# Start roscore as a fork and then wait for the tcp port to be opened
# —————————————————————-
# Source all the environment variables, start roscore in a fork
# Since the service type is forking, systemd doesn’t mark it as
# ‘started’ until the original process exits, so we have the
# non-forked shell wait until it can connect to the tcp opened by
# roscore, and then exit, preventing conflicts with dependant services
ExecStart=/bin/sh -c “. /opt/ros/kinetic/; . /etc/ros/; roscore & while ! echo exit | nc localhost 11311 > /dev/null; do sleep 1; done”


This file stores your environment variables

export ROS_HOSTNAME=$(hostname).localexport ROS_MASTER_URI=http://$ROS_HOSTNAME:11311


This file defines a systemd service that runs your launch file. Again make sure to replace the [TODO] with your user name

After=NetworkManager.service roscore.service
User=[TODO enter user name here]


This file is responsible for running the launch file you specify. Make sure to enter your username and the name of your launch file

source ~/catkin_ws/devel/setup.bash
source /etc/ros/
export ROS_HOME=$(echo ~[TODO unter your username here)/.ros
[TODO place your roslaunch command here] &
wait “$PID”

Next make you script executable and enable your systemd scripts by exceuting the following in a terminal

$ sudo systemctl enable roscore.service
$ sudo systemctl enable roslaunch.service
$ sudo chmod +x /usr/sbin/roslaunch

Next Reboot!

Once the computer has rebooted run “$ rostopic list” to verify that ROS is now running.

Get In Touch

Need help using ROS to build an autonomous solution? Contact us to discuss our consulting capabilities.

Contact Us