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-8represents 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-configAdministrative 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.
| Option | What it changes | Typical reason to use it | How to verify |
|---|---|---|---|
| Change Locale | Language, regional formatting, encoding, and the default locale environment | Use local language, date formats, decimal conventions, or character handling | locale and locale -a |
| Change Timezone | Regional rules for displaying local civil time | Correct local clock displays, logs, schedules, and time-dependent services | timedatectl and date |
| Change Keyboard Layout | Keyboard model, regional mapping, variants, and modifier behavior | Make typed characters match the keyboard legends and intended language | Type 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
- Open Internationalisation Options and choose the locale configuration entry.
- On the locale-generation screen, use the arrow keys to highlight the locale you need.
- Press Space to mark one or more locales for generation. A marker appears beside each selected entry.
- Press Tab to reach the confirmation button and press Enter.
- When raspi-config asks for the default system environment, choose one of the locales that was generated.
- 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
localelocale -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
- Open Internationalisation Options and choose the time zone entry.
- Select the broad geographic area, such as Europe, America, Asia, or Australia.
- Select the city or regional location that represents where the Raspberry Pi is operating.
- 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
datetimedatectl 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.
| Choice | Purpose | When to choose it | Potential effect |
|---|---|---|---|
| Keyboard model | Describes physical key arrangement and hardware features | Choose the closest listed model; use a generic definition when necessary | Determines how physical keys and special hardware are interpreted |
| Keyboard layout | Maps keys to a regional character set | Match the country or language represented by the keyboard legends | Changes punctuation, symbols, and national characters |
| Layout variant | Selects a specialized form of a layout | Use only when the keyboard requires that particular variant | Can change individual key positions or available characters |
| AltGr assignment | Chooses a key that provides third-level characters | Assign a substitute when the physical keyboard lacks an AltGr key | Enables accented letters, currency symbols, and alternate punctuation |
| Compose key assignment | Chooses a modifier for multi-key character sequences | Use when convenient character composition is needed | Adds sequence-based text entry in compatible applications |
| Ctrl+Alt+Backspace behavior | Controls whether the shortcut terminates the X server session | Enable only when you intentionally want this recovery shortcut | Can 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
- In locale configuration, mark
de_DE.UTF-8with Space so it is generated. - Apply the selection and choose
de_DE.UTF-8as the default locale. - In time zone configuration, choose the Europe area and Berlin as the regional location.
- In keyboard configuration, select the appropriate German keyboard model and German layout.
- Start a new session, then verify with
locale,timedatectl, anddate. - 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.
- Open the keyboard configuration wizard.
- Choose a generic PC keyboard model if the exact model is unavailable.
- Select the UK layout and the appropriate variant.
- Apply the settings and test representative keys, including quotation marks,
@,#, and£.
Set a headless Pi to local time over SSH
- Connect to the Pi through an SSH terminal.
- Run
sudo raspi-config. - Open Internationalisation Options and select the correct geographic area and city or regional location.
- Verify with
timedatectlanddate.
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
- Open the keyboard wizard and assign a Compose key that is convenient and unused.
- Complete the wizard and start or restart the relevant graphical session if required.
- Try a documented Compose sequence in a compatible editor or terminal.
- 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
localeand confirm the expected default and category values. - Run
locale -aand confirm the required locale was generated. - Use
dateto check local date and time formatting. - Use
timedatectlto 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.
| Symptom | Likely cause | Setting to check | Validation |
|---|---|---|---|
| Punctuation keys produce the wrong characters | Selected layout does not match the physical keyboard, or the wrong variant is active | Keyboard model, layout, and variant | Compare printed legends and test several affected keys |
| Dates or decimal separators use unexpected conventions | Locale is different from the intended regional setting | Default locale and generated locales | Run locale and test a date or numeric value |
| Local clock is offset from expected time | Incorrect time zone, or the clock has not synchronized | Time zone and synchronization status | Run timedatectl and compare date with the expected local time |
| Accented or third-level characters cannot be entered | Wrong layout, missing AltGr assignment, or unsupported Compose sequence | Layout, variant, AltGr, and Compose | Test the character in a compatible terminal or editor |
| Graphical session closes after a key combination | Ctrl+Alt+Backspace is enabled to terminate the X server | X-server shortcut option | Disable 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.