Raspberry Pi online course

Configure Locale, Time Zone, and Keyboard Settings with raspi-config

Learn how to use raspi-config on Raspberry Pi OS to configure locale, time zone, keyboard layout, AltGr, Compose, and graphical keyboard options.

Raspberry Pi OS includes regional settings for language, formatting, time, and keyboard input. You can configure these settings with raspi-config, the menu-based system configuration utility.

These settings are especially useful after installing Raspberry Pi OS, moving a Pi to another country, connecting a keyboard with a different layout, or preparing a headless Pi for local scheduled tasks and accurate logs.

What internationalisation settings control

Internationalisation means configuring system behavior for language, regional conventions, time zones, and input devices. In raspi-config, these controls are grouped under Internationalisation Options.

Three settings are related but different:

  • Locale: A named combination of language, region, character encoding, and formatting conventions. A value such as de_DE.UTF-8 represents German language conventions for Germany using UTF-8 encoding.
  • Time zone: A regional rule set that converts system time to local civil time. It can include daylight-saving time transitions.
  • Keyboard layout: A mapping from the physical keys and modifiers on a keyboard to characters and actions.

A locale can affect display language, date and time formats, decimal separators, currency formatting, paper conventions, sorting, and character handling. A time zone changes how time is displayed and interpreted locally. A keyboard layout changes the characters produced when keys are pressed.

You may need to change these settings when the initial installation used English and UK defaults, when your keyboard legends do not match the characters appearing on screen, when applications use the wrong regional formatting, or when the clock displays the wrong local time.

Open raspi-config

Open a terminal locally or through SSH and run:

sudo raspi-config

Administrative privileges are required because these choices change system-wide configuration. If you need a terminal refresher, see Terminal in Raspbian. For remote administration, see Access Raspbian Remotely.

In the text interface, use the arrow keys to move through menu items. Use Enter to open a highlighted item, Tab to move between controls such as OK and Cancel, and Space to mark or clear a selection. Use the arrow keys to highlight a button, then press Enter to confirm it.

Select Internationalisation Options. Depending on the Raspberry Pi OS release, the menu wording or available choices may vary slightly, but the locale, time zone, and keyboard controls serve the same purposes.

OptionWhat it changesTypical reason to use itHow to verify
Change LocaleLanguage, regional formatting, encoding, and the default locale environmentUse local language, date formats, decimal conventions, or character handlinglocale and locale -a
Change TimezoneRegional rules for displaying local civil timeCorrect local clock displays, logs, schedules, and time-dependent servicestimedatectl and date
Change Keyboard LayoutKeyboard model, regional mapping, variants, and modifier behaviorMake typed characters match the keyboard legends and intended languageType representative characters in a terminal or editor

Change the locale

Locale concepts

A locale is a set of language and regional conventions used by programs. The default locale is the locale exported by default into system and user sessions.

Changing a locale can influence:

  • Application language, when translations are installed and supported.
  • Date and time presentation, such as month names and ordering.
  • Decimal separators and thousands separators.
  • Currency and paper-format conventions.
  • Alphabetical sorting and comparison behavior.
  • Character encoding and the handling of non-ASCII text, where applicable. UTF-8 is normally the appropriate modern choice.

Users who want to keep the existing English-oriented configuration may not need to change the locale. A keyboard layout or time zone can be changed independently.

Generate and select a locale

  1. Open Internationalisation Options and choose the locale configuration entry.
  2. On the locale-generation screen, use the arrow keys to highlight the locale you need.
  3. Press Space to mark one or more locales for generation. A marker appears beside each selected entry.
  4. Press Tab to reach the confirmation button and press Enter.
  5. When raspi-config asks for the default system environment, choose one of the locales that was generated.
  6. Confirm the choice and allow the configuration process to finish.

You can generate more than one locale, but choose the locale that should be exported by default for normal system and user sessions. For a German-speaking user in Berlin, an appropriate example is de_DE.UTF-8.

Check the result with:

locale -a
locale

locale -a lists generated locales. locale displays the locale variables used by the current shell, including values such as LANG and the category-specific LC_* variables.

A new login session is often needed before applications inherit the updated environment. Log out and back in, restart the desktop session, reconnect an SSH session, or reboot when necessary. An application-specific language preference can override the system locale.

Change the time zone

A time zone defines how a system represents local civil time relative to UTC, or Coordinated Universal Time. It is separate from clock synchronization: the time zone chooses the local representation, while synchronization keeps the underlying clock accurate.

Correct time zone configuration matters for:

  • Displayed local time and calendar information.
  • Scheduled tasks that run at local times.
  • Log timestamps and event ordering.
  • TLS certificate validation and other time-sensitive security checks.
  • Services that calculate dates, deadlines, or recurring events.

Select an area and location

  1. Open Internationalisation Options and choose the time zone entry.
  2. Select the broad geographic area, such as Europe, America, Asia, or Australia.
  3. Select the city or regional location that represents where the Raspberry Pi is operating.
  4. Confirm the selection and allow raspi-config to apply it.

Choose a named regional zone rather than a fixed UTC offset when daylight-saving time applies. A regional zone contains the applicable seasonal rules; a fixed offset does not.

Verify the result with:

timedatectl
date

timedatectl reports local time, UTC time, the configured time zone, and synchronization status on systems using systemd. date shows the current local date and time from the shell.

If the configured zone is correct but the clock is inaccurate, investigate network access and time synchronization separately. A Pi may have the correct time zone while its clock has not synchronized after boot.

Change the keyboard layout

Model, layout, and variant

The keyboard model describes the physical keyboard arrangement and hardware features. The keyboard layout maps those physical keys to characters and actions. A keyboard variant is a specialized version of a layout, such as a national, ergonomic, or alternative arrangement.

Choose a keyboard model first, then choose the regional layout. If the exact hardware model is not listed, select an appropriate generic PC keyboard definition. The physical legends are more important than the manufacturer name.

Select the layout and variant that match both the printed key legends and the language you intend to type. A layout changes punctuation, national characters, number-row symbols, and the meaning of key positions.

ChoicePurposeWhen to choose itPotential effect
Keyboard modelDescribes physical key arrangement and hardware featuresChoose the closest listed model; use a generic definition when necessaryDetermines how physical keys and special hardware are interpreted
Keyboard layoutMaps keys to a regional character setMatch the country or language represented by the keyboard legendsChanges punctuation, symbols, and national characters
Layout variantSelects a specialized form of a layoutUse only when the keyboard requires that particular variantCan change individual key positions or available characters
AltGr assignmentChooses a key that provides third-level charactersAssign a substitute when the physical keyboard lacks an AltGr keyEnables accented letters, currency symbols, and alternate punctuation
Compose key assignmentChooses a modifier for multi-key character sequencesUse when convenient character composition is neededAdds sequence-based text entry in compatible applications
Ctrl+Alt+Backspace behaviorControls whether the shortcut terminates the X server sessionEnable only when you intentionally want this recovery shortcutCan abruptly close the graphical session and lose unsaved work

AltGr and Compose

AltGr is a modifier used by many layouts to access third-level characters. It can produce accented letters, currency symbols, and alternate punctuation. If the physical keyboard does not have an AltGr key, the wizard can assign an AltGr-equivalent key.

The Compose key allows characters to be entered through a sequence of key presses. For example, a Compose sequence may combine two characters to produce a special character, but exact sequences and application support vary. After assigning Compose, test it in a graphical text editor or terminal that supports the configured input method.

The keyboard wizard may also offer Ctrl+Alt+Backspace. When enabled, this shortcut terminates the graphical X server session. It can be useful as an intentional recovery shortcut, but it may abruptly end graphical work. Do not enable it casually, and save work before testing it.

Practical configuration examples

German locale, Berlin time zone, and German keyboard

  1. In locale configuration, mark de_DE.UTF-8 with Space so it is generated.
  2. Apply the selection and choose de_DE.UTF-8 as the default locale.
  3. In time zone configuration, choose the Europe area and Berlin as the regional location.
  4. In keyboard configuration, select the appropriate German keyboard model and German layout.
  5. Start a new session, then verify with locale, timedatectl, and date.
  6. Test an umlaut such as ä and a symbol that requires AltGr, using a terminal or text editor.

Correct a US layout applied to a UK keyboard

Typical symptoms include quotation marks, the at sign, hash, or pound-sign keys producing unexpected characters. The physical key positions may be correct, but the logical mapping is wrong.

  1. Open the keyboard configuration wizard.
  2. Choose a generic PC keyboard model if the exact model is unavailable.
  3. Select the UK layout and the appropriate variant.
  4. Apply the settings and test representative keys, including quotation marks, @, #, and £.

Set a headless Pi to local time over SSH

  1. Connect to the Pi through an SSH terminal.
  2. Run sudo raspi-config.
  3. Open Internationalisation Options and select the correct geographic area and city or regional location.
  4. Verify with timedatectl and date.

Keyboard settings on the Pi mainly affect its local console and graphical input. They do not change the physical keyboard attached to the SSH client. If characters are wrong in an SSH session, inspect the client keyboard settings as well as the server configuration.

Use Compose on a compact keyboard

  1. Open the keyboard wizard and assign a Compose key that is convenient and unused.
  2. Complete the wizard and start or restart the relevant graphical session if required.
  3. Try a documented Compose sequence in a compatible editor or terminal.
  4. Remember that sequences are not universal across all desktop applications.

Confirm and test the result

Use several tests rather than relying only on the configuration menu:

  • Run locale and confirm the expected default and category values.
  • Run locale -a and confirm the required locale was generated.
  • Use date to check local date and time formatting.
  • Use timedatectl to confirm the active time zone and inspect synchronization status.
  • Type punctuation, currency symbols, accented characters, and number-row symbols in a terminal or text editor.
  • Test AltGr and Compose if they were configured.

Log out and back in when applications retain the old locale. Restart the desktop session or reboot if the graphical environment has not inherited the changes. Reconnect SSH after changing session environment settings. A reboot is not always necessary, but it is a straightforward way to ensure system services and new sessions see the configuration.

SymptomLikely causeSetting to checkValidation
Punctuation keys produce the wrong charactersSelected layout does not match the physical keyboard, or the wrong variant is activeKeyboard model, layout, and variantCompare printed legends and test several affected keys
Dates or decimal separators use unexpected conventionsLocale is different from the intended regional settingDefault locale and generated localesRun locale and test a date or numeric value
Local clock is offset from expected timeIncorrect time zone, or the clock has not synchronizedTime zone and synchronization statusRun timedatectl and compare date with the expected local time
Accented or third-level characters cannot be enteredWrong layout, missing AltGr assignment, or unsupported Compose sequenceLayout, variant, AltGr, and ComposeTest the character in a compatible terminal or editor
Graphical session closes after a key combinationCtrl+Alt+Backspace is enabled to terminate the X serverX-server shortcut optionDisable the option and avoid testing it with unsaved work

Troubleshooting

The intended locale is not available as the default

Return to locale configuration and mark the required locale with Space. Complete locale generation, then choose the generated locale as the default. If the configuration session was exited before applying changes, repeat the process and verify with locale -a.

Applications still use the old language or formatting

The application may have started before the environment changed, or the desktop or remote session may still be active. Log out and back in, restart the desktop session, or reboot if necessary. Confirm the shell environment with locale. If only one application is affected, inspect its own language and regional preferences.

The time zone is correct but the clock is inaccurate

Check timedatectl and separate the two questions: is the regional zone correct, and is the system clock synchronized? If synchronization is unavailable, check network connectivity and the time synchronization status. Changing the time zone will not correct an unsynchronized clock.

Keys produce unexpected symbols

Compare the keyboard's printed legends with the selected model, layout, and variant. Choose a compatible generic model if necessary, then test several affected keys. During SSH use, remember that the client keyboard and the Pi's local-console or desktop keyboard settings are separate.

A special character cannot be entered

Check whether the layout places the character on a third level accessed through AltGr. Configure an AltGr substitute if needed. You can also configure Compose, but verify that the target application supports the chosen sequence.

Ctrl+Alt+Backspace closes the graphical session

The X-server termination shortcut is enabled. Reopen keyboard configuration and disable that option if it is not wanted. Save work before testing keyboard shortcuts because termination can close graphical applications abruptly.

Safe configuration practices

  • Record the original locale, time zone, and keyboard choices before making changes.
  • Be especially careful when changing keyboard settings during SSH administration; the Pi's keyboard mapping does not remap the SSH client's physical keyboard.
  • Test scripts after locale changes if they parse dates, compare sorted text, convert decimal numbers, or depend on a specific encoding.
  • Use a named regional time zone when daylight-saving rules apply instead of selecting only a fixed UTC offset.
  • Save graphical work before testing Ctrl+Alt+Backspace.

For broader configuration tasks, see Raspi Config and Set Up Raspberry Pi.