trevorblackman.dev

Documentation

Launch Chromium in Kiosk Mode on Raspberry Pi OS Lite

Step-by-step instructions for configuring Raspberry Pi OS Lite to automatically start Chromium in kiosk mode and display a specified URL on boot.

This document explains how to configure Raspberry Pi OS Lite without a desktop environment to automatically launch Chromium in kiosk mode and display a chosen URL on startup.

1. Start Raspberry Pi OS Lite

Start from a clean installation of Raspberry Pi OS Lite.

  • Ensure SSH is enabled so you can connect remotely if needed.

2. Update and Install Required Packages

sudo apt update
sudo apt upgrade -y
sudo apt install -y chromium-browser xserver-xorg x11-xserver-utils xinit openbox

3. Create the Kiosk Launch Script

Create a script to launch Chromium in kiosk mode.

sudo nano /home/pi/kiosk.sh

Add the following contents and replace the URL as needed:

#!/bin/bash
xset s off
xset s noblank
xset -dpms

sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/Default/Preferences
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' ~/.config/chromium/Default/Preferences

/usr/bin/chromium-browser --noerrdialogs --disable-infobars --kiosk https://google.com

Make the script executable:

sudo chmod +x /home/pi/kiosk.sh

4. Configure Openbox

Create the Openbox configuration directory and autostart file:

mkdir -p ~/.config/openbox
nano ~/.config/openbox/autostart

Add:

~/kiosk.sh &

5. Configure the X Session

Create or edit .xinitrc:

nano ~/.xinitrc

Add:

exec openbox-session

6. Configure Automatic Start on Login

Edit .bash_profile:

nano ~/.bash_profile

Add this line at the end:

[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx -- -nocursor

7. Enable Automatic Login

Run the Raspberry Pi configuration tool:

sudo raspi-config

Navigate to System Options -> Boot / Auto Login -> Console Autologin, then reboot:

sudo reboot

8. Configure Wi-Fi

Use nmtui to add or edit wireless connections:

sudo nmtui

Select Add a New Network and complete the setup.

9. Optionally Remove Old Wi-Fi Configurations

NetworkManager stores connection profiles in /etc/NetworkManager/system-connections/.

Each saved network is stored as a separate file named after the SSID or a UUID.