So I'm pretty new to the pi. I'm trying to run chromium in kiosk mode on boot and point it to a local page. I've tried many tutorials online and they're all for versions of the pi that are older than the most recent on that I'm using. I don't know what to do. I've tried to edit the "rc.local" file include "home/pi/myproject.py" at the second to last line, just above exit 0. I've tried to edit the .bashrc file in a similar way. I've had mild success running it as a service. I have my the service calling "/home/pi/myproject.py" and when I "systemctl start sample.service", the script runs great, but I can't get it to run on boot. Here is the contents of my "myproject.py" script:

DISPLAY=:0 chromium-browser --noerrdialogs --disable-infobars --kiosk http://localhost/b &

cd /var/www/myproject
php artisan websockets:serve

If I leave it like that, I get a syntax error on the ":" of "DISPLAY=:0". If I delete that section and begin the line with "chromium-browser", i get an error on the ":" of "http://localhost". If I delete THAT, I get an error on the "/" of "localhost/b". I don't know how to rewrite this as I'm not familiar with shell scripting or python or anything like this. Any help would be greatly appreciated in getting this script to run on boot. Thanks in advance.

1 Answer 1


You tried several methods to start chromium in kiosk mode on boot. Using /etc/rc.local is not a good idea because it is deprecated. It has limitations due to Compatibility with SysV. We have seen many problems here on this site using it. Following the recommendation of the developers from systemd you should avoid using it.

Using ~/.bashrc will not work because it only for initializing a bash session, e.g. if you login in. It will not start on boot up.

Using a systemd Unit file is the right way nowadays to start programs on boot. You will find an accepted answer for your problem at start chromium on raspberry pi in kiosk mode using systemd service instead of through LXDE-pi/autostart.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.