Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Raspberry Pi OS Kiosk Mode Setup and Configuration

· 5 min read · Home Tech

In this article
  1. How to Install a Minimal Kiosk Environment
  2. How to Disable Screen Blanking and Power Saving
  3. How to Auto-Login to the Console
  4. Which Browser Flags Improve Kiosk Performance
  5. How to Rotate the Display for Vertical Kiosks
  6. How to Manage Kiosk Updates and Remote Control
  7. How to Secure the Kiosk from User Interference

Set up Raspberry Pi OS kiosk mode by configuring the system to boot directly into a full-screen web browser without loading a desktop environment or showing a taskbar. This process involves installing a lightweight window manager like Openbox and a browser like Chromium. These steps ensure the device functions as a dedicated display terminal.

How to Install a Minimal Kiosk Environment

Start by installing Raspberry Pi OS Lite to minimize system overhead and reduce boot times. Because the Lite version lacks a graphical user interface, you must manually install the X Window System and a window manager to display the browser.

  1. Open the terminal and run sudo apt update to refresh the package lists.
  2. Install the X server and Openbox window manager using sudo apt install --no-install-recommends xserver-xorg x11-xserver-utils xinit openbox.
  3. Install the Chromium web browser using sudo apt install chromium-browser.
  4. Create a directory for the Openbox configuration by running mkdir -p ~/.config/openbox.
  5. Create an autostart file with nano ~/.config/openbox/autostart.
  6. Add the command to launch Chromium in kiosk mode: chromium-browser --kiosk http://your-url-here.

How to Disable Screen Blanking and Power Saving

Kiosk displays must remain active 24/7 without the screen turning black or entering sleep mode. This requires disabling the DPMS (Display Power Management Signaling) and the screen saver settings within the X server configuration.

Edit the Openbox autostart file created in the previous section. Add the following three lines before the Chromium launch command to prevent the monitor from timing out:

xset s off
xset s noblank
xset -dpms

These commands tell the system to turn off the screensaver, disable the blanking feature, and deactivate the power management signals that tell a monitor to enter standby mode. If the screen still blanks, check the hardware settings of the monitor itself to disable any built-in "Eco Mode" or "Auto-Sleep" timers.

How to Auto-Login to the Console

To avoid a login prompt at boot, the system must be configured to log in the default user automatically. This is handled through the Raspberry Pi Configuration tool in the terminal.

  1. Run sudo raspi-config in the terminal.
  2. Navigate to System Options.
  3. Select Boot / Auto Login.
  4. Choose Console Autologin to ensure the user is logged in without a password prompt.
  5. Select Finish and reboot the device.

Once auto-login is active, you can add startx to the end of the .bashrc file. This triggers the X server to start immediately upon login, which in turn triggers Openbox and the Chromium kiosk window.

Which Browser Flags Improve Kiosk Performance

Chromium provides specific command-line flags that remove browser UI elements and prevent the system from showing error messages after a power failure. Using these flags creates a seamless user experience where the browser is indistinguishable from a native app.

Flag Function Effect on User
--kiosk Full-screen mode Removes address bar, tabs, and window borders.
--incognito Private browsing Prevents caching of user data and session cookies.
--noerrdialogs Suppress error popups Hides "Chromium didn't shut down correctly" alerts.
--disable-infobars Hide info banners Removes "Chrome is being controlled by automated software" bars.
--disable-session-crashed-bubble Hide crash bubbles Prevents restore session prompts after power loss.

Combine these flags in the autostart file as follows: chromium-browser --kiosk --incognito --noerrdialogs --disable-infobars --disable-session-crashed-bubble http://your-url-here.

How to Rotate the Display for Vertical Kiosks

Many kiosk installations use monitors in portrait orientation. Rotating the display is done via the xrandr tool or the system configuration file depending on the hardware model.

For most current setups, add a rotation command to the Openbox autostart file before the browser launch. Use xrandr --output HDMI-1 --rotate left for a 90-degree counter-clockwise turn, or xrandr --output HDMI-1 --rotate right for a 90-degree clockwise turn. Replace "HDMI-1" with the actual name of your output port, which can be found by typing xrandr in the terminal.

If the hardware does not support xrandr rotation, edit the config.txt file in the boot partition. Add the line display_rotate=1 for 90 degrees, display_rotate=2 for 180 degrees, or display_rotate=3 for 270 degrees. Save the file and reboot for the change to take effect.

How to Manage Kiosk Updates and Remote Control

Since a kiosk lacks a keyboard and mouse for the end-user, management must happen remotely. SSH (Secure Shell) is the standard method for updating the URL or modifying system settings without unplugging the device.

Enable SSH in sudo raspi-config under Interface Options. Once enabled, you can connect from another computer using a terminal. To update the kiosk URL remotely, use a text editor like nano to modify the ~/.config/openbox/autostart file. After saving the changes, restart the X server or reboot the Pi using sudo reboot to apply the new URL.

To prevent the SD card from wearing out due to constant log writing, consider disabling swap or moving the logs to a USB drive. You can install a tool like log2ram, which writes logs to a virtual disk in RAM and only syncs them to the SD card periodically, extending the hardware lifespan by reducing write cycles.

How to Secure the Kiosk from User Interference

Physical security is necessary to prevent users from exiting kiosk mode. While the --kiosk flag removes the UI, certain keyboard shortcuts like Ctrl+Alt+F1 or Alt+Tab can still reveal the underlying system.

To block these, you can use a tool like xmodmap to disable specific keys. For example, to disable the Windows key, add xmodmap -e "clear Mod4" to the autostart file. For high-security environments, use a physical kiosk enclosure that covers the keyboard or use a touch-screen monitor without a physical keyboard attached.

Additionally, set the system to read-only mode using the Raspberry Pi Configuration tool. This prevents any accidental changes to the filesystem and ensures that if the power is cut abruptly, the SD card is less likely to suffer from filesystem corruption.