How to Configure Raspberry Pi to Run Programs On Startup


In this post, I’ll show you how to configure your Raspberry Pi so that your programs can run as soon as you plug in your Raspberry Pi to a power source.


Here are the requirements:

  • Run a program as soon as the Raspberry Pi is turned on.


Power up your Raspberry Pi, and open up a terminal window.


sudo nano /etc/rc.local

Scroll down the file to the area right after fi but before exit 0. Type:

python3 /home/pi/robot/ &

The format is

python3 /your/file/path/here/ &

Press CTRL-X, and save the file.

Restart your Raspberry Pi.

sudo reboot

Your program,, should run on startup.