Our step-by-step guide to configure a Raspberry Pi as a kiosk display that runs automatically on boot.
Learn how we at reelyActive configure a Raspberry Pi as a kiosk display.
The Raspberry Pi can act as a digital display driver thanks to its HDMI port.
A Raspberry Pi (or equivalent) with Raspberry Pi OS Lite installed.
Install the X Window System (X11), the Chromium browser and kiosk-mode dependencies.
Both the Pi and the computer used for its configuration must be on the same network, with which they can access the Internet.
With the prepared micro SD card inserted into the Pi, complete the following:
ssh pi@xxx.xxx.xxx.xxx
replacing the x values with the Pi's IP address If you're still using the default password, this is as good a time as any to change it. Simply run sudo raspi-config
From the same terminal connected to the Pi via SSH:
sudo apt-get install --no-install-recommends xserver-xorg
sudo apt-get install --no-install-recommends xinit
sudo apt-get install --no-install-recommends x11-xserver-utils
From the same terminal connected to the Pi via SSH:
sudo apt-get install chromium-browser
sudo apt-get install matchbox-window-manager xautomation unclutter
sudo apt-get install fonts-noto-color-emoji
Auto-login on boot and start kiosk mode from a script.
From the same terminal connected to the Pi via SSH:
Create a new file called kiosk in the pi user's home folder with the command nano ~/kiosk
and paste in the following template, updating the URL on the last line as required (unless you like this tutorial so much that you plan to display it on a big screen!):
#!/bin/sh xset -dpms # disable DPMS (Energy Star) features. xset s off # disable screen saver xset s noblank # don't blank the video device matchbox-window-manager -use_titlebar no & unclutter & # hide X mouse cursor unless mouse activated chromium-browser --display=:0 --kiosk --incognito --window-position=0,0 https://reelyactive.github.io/diy/pi-kiosk/
Make the kiosk script file executable with the command chmod 755 ~/kiosk
Initiation of the X Windows System and the kiosk script will be added to the pi user's .bashrc file which runs each time the Pi boots.
Edit the ~/.bashrc file with the command nano ~/.bashrc
to include the following as the last line:
xinit /home/pi/kiosk -- vt$(fgconsole)
From the command prompt on the Pi , enter the command sudo raspi-config
which will open a text-based menu. Update the configuration as per the following table where the settings are indicated in [ ].
# | Option | Action(s) |
---|---|---|
2 | Display Options |
D2 Underscan
|
1 | System Options |
S5 Boot / Auto Login
|
Upon completing the above, select <Finish> and select <Yes> when prompted to reboot. If a display is connected via HDMI, following the boot sequence, the Chromium browser should open in kiosk mode and display the specified webpage.
Depending on your display and Pi configuration, it may be necessary to configure additional settings to achieve the desired functionality. Many of these settings can be found in The config.txt file, which is well documented—and the place to look first!
An increasing number of web pages & applications (like this one!) support light/dark themes. To prioritise dark themes, add the --enable-features=WebUIDarkMode and --force-dark-mode flags to the chromium-browser startup script command, like this:
chromium-browser --display=:0 --kiosk --incognito --window-position=0,0 --enable-features=WebUIDarkMode --force-dark-mode https://reelyactive.github.io/diy/pi-kiosk/
This should update the prefers-color-theme media feature which triggers compatible web pages & applications (ex: Bootstrap 5.3 and our own web-style-guide) to automatically render the desired theme.
Edit the display_rotate_hdmi property and disable the DRM VC4 V3D driver for portrait displays:
# /boot/config.txt # 0 = 0°, 1 = 90°, 2 = 180°, 3 = 270° display_hdmi_rotate=1 # Comment out DRM VC4 V3D driver for portrait mode #dtoverlay=vc4-kms-v3d #max_framebuffers=2
Thanks to Mike for validating this configuration on a Pi 3B!
Again, check The config.txt file first! And if you complete a non-obvious kiosk configuration that you think would benefit the community, contact us and we'll be happy to document it here.
For additional settings, see also:
If Pareto Anywhere is running on the Pi, any of the Pareto Anywhere Apps can be displayed in kiosk mode, such as the following, simply by updating the URL in the kiosk file (see Part 1):
Tutorial prepared with ♥ by jeffyactive.
You can reelyActive's open source efforts directly by contributing code & docs, collectively by sharing across your network, and commercially through our packages.Continue exploring our open architecture and all its applications.