Raspberry Pi: setting the German keyboard layout

If Y and Z are swapped on your Raspberry Pi and the umlauts are missing, the English (UK or US) keyboard layout is still active. Ideally you set the German layout when writing the SD card in Raspberry Pi Imager. Afterwards there are several ways to change it – and they work the same for any other layout.

With raspi-config

sudo raspi-config

Under Localisation Options → Keyboard, choose the keyboard model (usually “Generic 105-key PC”), then Other → German → German. Watch out while typing: as long as the English layout is active, a German keyboard produces Y where you expect Z. The same menu also lets you set the language (Locale, e.g. de_DE.UTF-8) and the time zone.

Directly in the configuration file

sudo nano /etc/default/keyboard

Adjust the line with XKBLAYOUT – using straight quotation marks:

XKBLAYOUT="de"
XKBVARIANT="nodeadkeys"

nodeadkeys makes characters such as ^ and ` appear immediately instead of waiting for the next letter – handy in the console. Apply without rebooting:

sudo setupcon

On the desktop

On Raspberry Pi OS with desktop: Raspberry menu → Preferences → Control Centre (or Raspberry Pi Configuration) → Localisation → Keyboard → layout “German”. Alternatively in the console:

sudo localectl set-x11-keymap de

Check

localectl status

The lines VC Keymap and X11 Layout should now show de.

If you want to run the Pi without any keyboard at all, the article Raspberry Pi headless setup has the matching guide.

Originally published in 2019, revised in November 2026.