DEV Community

Cover image for Start Chromium in Kiosk Mode on Raspberry Pi OS
Kevin Lewis for Deepgram

Posted on • Originally published at developers.deepgram.com

Start Chromium in Kiosk Mode on Raspberry Pi OS

Earlier this month I built a wearable transcription device using Deepgram and a Raspberry Pi. The project is a web application running in a fullscreen browser on the Pi. However, when the device first starts, it requires a fiddly set of touchscreen interactions to get it in a ready state - opening the browser, navigating to the correct URL, and then fullscreening the browser. In this quick guide, I will show you the steps I took to automate this on device launch.

This tutorial works for Raspberry Pi OS 10 - Buster

Open your terminal and type the following:

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
Enter fullscreen mode Exit fullscreen mode

This will open a new text file which will be executed when the desktop environment (LXDE) launches. In the file type the following:

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi

@xset s off
@xset -dpms
@xset s noblank

@chromium-browser --kiosk https://deepgram.com
Enter fullscreen mode Exit fullscreen mode

Click Control + X to quit the app, and then Y to say 'yes' and save your file.

The first section sets up the environment and profile for the Pi, and the second section stops the Pi sleeping or starting the screensaver.

The final line is the most crucial - it starts Chromium (the built-in browser on which Google Chrome is based) in fullscreen mode at the specified URL. Kiosk mode also stops other user input outside of the browser - effectively locking the user into the browser.

I hope this helps you build web-based Raspberry Pi projects. If you have any questions, please feel free to reach out on Twitter - we're @DeepgramDevs.

Discussion (0)