How to set up Chromium Kiosk mode on Debian

This guide allows you to configure a headless server for running a web app as full screen, so the computer will act as an appliance for this single app.

Basic Server Setup

Install latest debian, disable desktop environments during install and enable ssh, add authorized keys so you can remotely administer the server

Install Dependencies

Log in as root and install the dependencies
apt install -y chromium xorg unclutter

Service Files

Create the following files to configure the relevant services:
    /etc/systemctl/system/xorg.service - This starts X which manages the screen
cat xorg.service 
[Unit]
Description=Service for Xorg X11

[Service]
ExecStart=/usr/bin/Xorg

[Install]
WantedBy=multi-user.target
    /etc/systemctl/system/kiosk.service - This runs chromium as full screen for a HD sized screen. Be sure to change the URL from google to the web app you want to show
[Unit]
Description=Service for Chromium in kiosk mode
After=xorg.service
Wants=network-online.target

[Service]
ExecStart=/usr/bin/chromium --no-sandbox --kiosk --window-size=1920,1080 https://google.com
Environment=DISPLAY=:0

[Install]
WantedBy=multi-user.target
    /etc/systemctl/system/configx.service - This will disable the display blanking feature of X which turns off the display after 10 minutes
[Unit]
Description=Disable display blanking on X
After=xorg.service

[Service]
ExecStartPre=/bin/sleep 5
ExecStart=/usr/bin/xset -dpms
Environment=DISPLAY=:0
Type=oneshot

[Install]
WantedBy=multi-user.target
    /etc/systemctl/system/unclutter.service - This will hide the cursor if it is not moving after one second, to keep your UI clean
[Unit]
Description=Hide cursor
After=xorg.service

[Service]
ExecStartPre=/bin/sleep 5
ExecStart=unclutter -idle 1
Environment=DISPLAY=:0

[Install]
WantedBy=multi-user.target
Note: because X takes a moment to make the display available, we need to add these sleep items that will wait a few seconds before configuring X and hiding the cursor

Enable Services

Start all four services with these commands:
systemctl enable --now xorg
systemctl enable --now kiosk
systemctl enable --now configx
systemctl enable --now unclutter

Done

Now when rebooting your server it will automatically run the web app in kiosk mode

Etc

If you change these files later run systemctl daemon-reload and then restart the relevant services.