To make a Raspberry Pi automatically launch a website in full-screen "kiosk mode" and lock down the interface, you need to configure it to boot to the desktop, autostart Chromium with specific flags, and disable screen blanking.
Here is the step-by-step guide based on current Raspberry Pi OS (Bookworm/Wayfire) methods.
Phase 1: Initial Setup
- Open Terminal and ensure your Pi is updated:
- Configure Boot Options: Run
sudo raspi-config.- Navigate to System Options > Boot / Auto Login.
- Select Desktop Autologin (this skips login and opens the desktop automatically).
- Optional: Navigate to Display Options > Screen Blanking and select No.
- Install Necessary Tools: Install
unclutterto hide the mouse cursor when not in use:
Phase 2: Create the Kiosk Script
Create a shell script that tells Chromium to run in full-screen, locks the website, and disables error messages.
- Create the script file:
- Add the following code (replace
https://google.comwith your website): - Save and exit (Ctrl+X, then Y, then Enter).
- Make it executable:
Phase 3: Autostart the Kiosk at Boot
For modern Raspberry Pi OS (Bookworm), you must edit the Wayfire configuration.
- Edit the autostart file:
- Find the
[autostart]section and add the following lines (add it to the end if the section doesn't exist): - Save and exit (Ctrl+X, then Y, then Enter).
Phase 4: Final Lockdown (Optional but Recommended)
To prevent users from closing the browser:
- Disable Key Combinations: The
---kioskflag prevents traditional F11 exiting, but users can still useAlt+F4to close the app. - Prevent Access to Desktop: By using
Desktop Autologinand running only the script, the user only sees the browser. - Alternative Method (Hard Lockdown): Use
openboxinstead of the full desktop environment to prevent desktop icons or panels from loading.
Reboot the Pi:
Troubleshooting
- Browser not opening: The script might be running before the network is ready. Add
sleep 10at the beginning ofrun_kiosk.shto add a 10-second delay. - Exit Kiosk: Press
Alt+F4to close the browser, orCtrl+Alt+F2to switch to a terminal to fix configurations
0 Comments