Configure a Raspberry Pi as a kiosk display

Our step-by-step guide to configure a Raspberry Pi as a kiosk display that runs automatically on boot.

Configure a Raspberry Pi as a kiosk display

The TL;DR (Too Long; Didn't Read)

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.


What will this accomplish?
The Pi will automatically display a specific web page in full screen mode on any HDMI-connected screen via the Chromium browser.
Why use a Pi?
A Pi is a cost-effective and easily sourceable device for driving kiosk displays.
Does this apply only to the Pi?
The process should apply equally well to other Debian Linux-based platforms.

Prerequisites

A Raspberry Pi (or equivalent) with Raspberry Pi OS Lite installed.

Installing X11 and Chromium   Step 1 of 2

Install the X Window System (X11), the Chromium browser and kiosk-mode dependencies.


Do I need to SSH into the Pi?
Yes. If you forgot how, recall Step 4 from the Pi Prep tutorial.
Why X11?
Raspberry Pi OS Lite does not include a display system by default, so the the X Window System must be installed manually.
X11 and Chromium for Pi kiosk display

Prerequisites

Both the Pi and the computer used for its configuration must be on the same network, with which they can access the Internet.

Boot the Pi and connect via SSH Part 1

With the prepared micro SD card inserted into the Pi, complete the following:

  1. Apply power to the Raspberry Pi
  2. Open a terminal on the computer and SSH into the Pi with the command ssh pi@xxx.xxx.xxx.xxx replacing the x values with the Pi's IP address
  3. When prompted enter the password (berryinsecure is the default)

If you're still using the default password, this is as good a time as any to change it. Simply run sudo raspi-config

Install the X Window System (X11) Part 2

From the same terminal connected to the Pi via SSH:

  1. Install xserver-xorg with the command sudo apt-get install --no-install-recommends xserver-xorg
  2. Install xinit with the command sudo apt-get install --no-install-recommends xinit
  3. Install x11-xserver-utils with the command sudo apt-get install --no-install-recommends x11-xserver-utils

Install Chromium and kiosk dependencies Part 3

From the same terminal connected to the Pi via SSH:

  1. Install chromium-browser with the command sudo apt-get install chromium-browser
  2. Install the kiosk dependencies with the command sudo apt-get install matchbox-window-manager xautomation unclutter

Configure boot and display options   Step 2 of 2

Auto-login on boot and start kiosk mode from a script.


Why auto-login?
The pi user will launch X and Chromium, and therefore must be logged in.
Why call a script from .bashrc?
It is difficult to get Chromium to run (as the pi user) from the rc.local file.
Pi autologin and kiosk script

From the same terminal connected to the Pi via SSH:

Create the kiosk startup script Part 1

This optional step applies only if the pi-suite tutorial was not completed.

If kiosk scripts are present in the /home/pi/reelyActive/pi-suite/kiosk/ folder, skip ahead to Part 2.

Create a new file called kiosk in the pi user's home folder based on 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 http://reelyactive.github.io/diy/pi-kiosk/

Make the kiosk script file executable with the command chmod 755 kiosk

Add the kiosk script to .bashrc Part 2

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 to include the following as the last line, adjusting the script name as required:

xinit /home/pi/reelyActive/pi-suite/kiosk/chromium-hello-showcase -- vt$(fgconsole)

If a kiosk script was optionally created in Part 1, instead change the file path above to /home/pi/kiosk

Configure boot and display with the raspi-config tool Part 3

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)
7 Advanced Options A2 Overscan
  • Enable compensation? [No]
3 Boot Options B1 Desktop/CLI
  • [CLI]
B2 Console Autologin
  • [Yes]

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.


Embrace the ambient data in your space

Pareto Anywhere is open source software that runs anywhere to digitally transform any space.


Where to next?

Continue exploring our open architecture and all its applications.