Change the keyboard layout of the Linux console

Set the console keyboard layout of a CentOS or other systemd-based Linux server with localectl, and list the keymaps you can choose from.

Contents

On a virtual server, the console often starts with a US keyboard layout. On CentOS, and on any Linux distribution that uses systemd, localectl changes it to the layout you are used to.

Set the keyboard layout

For a Swiss French keyboard, for example:

localectl set-keymap ch-fr

The plain ch keymap is the Swiss German layout. localectl applies the change straight away and writes it to /etc/vconsole.conf as KEYMAP=ch-fr, so it persists after a reboot.

List the available layouts

localectl list-keymaps

The full list from a CentOS 7 server is at the end of this article.

Other ways

  • Edit /etc/vconsole.conf by hand and set KEYMAP= to the keymap you want. It takes effect at the next boot.
  • loadkeys ch-fr changes the layout of the current console only, until the next reboot.
  • For graphical sessions, use setxkbmap or the keyboard settings of your desktop environment.

The localectl man page describes the other options.

Full list of keymaps

 ANSI-dvorak
 al
 al-plisi
 amiga-de
 amiga-us
 applkey
 at
 at-mac
 at-nodeadkeys
 at-sundeadkeys
 atari-de
 atari-se
 atari-uk-falcon
 atari-us
 az
 azerty
 ba
 ba-alternatequotes
 ba-unicode
 ba-unicodeus
 ba-us
 backspace
 bashkir
 be
 be-iso-alternate
 be-latin1
 be-nodeadkeys
 be-oss
 be-oss_latin9
 be-oss_sundeadkeys
 be-sundeadkeys
 be-wang
 bg-cp1251
 bg-cp855
 bg_bds-cp1251
 bg_bds-utf8
 bg_pho-cp1251
 bg_pho-utf8
 br
 br-abnt
 br-abnt2
 br-dvorak
 br-latin1-abnt2
 br-latin1-us
 br-nativo
 br-nativo-epo
 br-nativo-us
 br-nodeadkeys
 br-thinkpad
 by
 by-cp1251
 by-latin
 bywin-cp1251
 ca
 ca-eng
 ca-fr-dvorak
 ca-fr-legacy
 ca-multi
 ca-multix
 carpalx
 carpalx-full
 cf
 ch
 ch-de_mac
 ch-de_nodeadkeys
 ch-de_sundeadkeys
 ch-fr
 ch-fr_mac
 ch-fr_nodeadkeys
 ch-fr_sundeadkeys
 ch-legacy
 cm
 cm-azerty
 cm-dvorak
 cm-french
 cm-mmuock
 cm-qwerty
 cn
 cn-altgr-pinyin
 croat
 ctrl
 cz
 cz-bksl
 cz-cp1250
 cz-dvorak-ucw
 cz-lat2
 cz-lat2-prog
 cz-qwerty
 cz-qwerty-mac
 cz-qwerty_bksl
 cz-rus
 cz-us-qwertz
 de
 de-T3
 de-deadacute
 de-deadgraveacute
 de-deadtilde
 de-dsb
 de-dsb_qwertz
 de-dvorak
 de-latin1
 de-latin1-nodeadkeys
 de-mac
 de-mac_nodeadkeys
 de-mobii
 de-neo
 de-nodeadkeys
 de-qwerty
 de-ro
 de-ro_nodeadkeys
 de-sundeadkeys
 de-tr
 de_CH-latin1
 de_alt_UTF-8
 defkeymap
 defkeymap_V1.0
 dk
 dk-dvorak
 dk-latin1
 dk-mac
 dk-mac_nodeadkeys
 dk-nodeadkeys
 dk-winkeys
 dvorak
 dvorak-ca-fr
 dvorak-es
 dvorak-fr
 dvorak-l
 dvorak-la
 dvorak-programmer
 dvorak-r
 dvorak-ru
 dvorak-sv-a1
 dvorak-sv-a5
 dvorak-uk
 dz
 ee
 ee-dvorak
 ee-nodeadkeys
 ee-us
 emacs
 emacs2
 en-latin9
 epo
 epo-legacy
 es
 es-ast
 es-cat
 es-cp850
 es-deadtilde
 es-dvorak
 es-mac
 es-nodeadkeys
 es-olpc
 es-sundeadkeys
 es-winkeys
 et
 et-nodeadkeys
 euro
 euro1
 euro2
 fi
 fi-classic
 fi-kotoistus
 fi-mac
 fi-nodeadkeys
 fi-smi
 fi-winkeys
 fo
 fo-nodeadkeys
 fr
 fr-afnor
 fr-azerty
 fr-bepo
 fr-bepo-latin9
 fr-bepo_afnor
 fr-bepo_latin9
 fr-bre
 fr-dvorak
 fr-latin0
 fr-latin1
 fr-latin9
 fr-latin9_nodeadkeys
 fr-latin9_sundeadkeys
 fr-mac
 fr-nodeadkeys
 fr-oci
 fr-old
 fr-oss
 fr-oss_latin9
 fr-oss_nodeadkeys
 fr-oss_sundeadkeys
 fr-pc
 fr-sundeadkeys
 fr-us
 fr_CH
 fr_CH-latin1
 gb
 gb-colemak
 gb-dvorak
 gb-dvorakukp
 gb-extd
 gb-intl
 gb-mac
 gb-mac_intl
 gb-pl
 ge
 ge-ergonomic
 ge-mess
 ge-ru
 gh
 gh-akan
 gh-avn
 gh-ewe
 gh-fula
 gh-ga
 gh-generic
 gh-gillbt
 gh-hausa
 gr
 gr-pc
 hr
 hr-alternatequotes
 hr-unicode
 hr-unicodeus
 hr-us
 hu
 hu-101_qwerty_comma_dead
 hu-101_qwerty_comma_nodead
 hu-101_qwerty_dot_dead
 hu-101_qwerty_dot_nodead
 hu-101_qwertz_comma_dead
 hu-101_qwertz_comma_nodead
 hu-101_qwertz_dot_dead
 hu-101_qwertz_dot_nodead
 hu-102_qwerty_comma_dead
 hu-102_qwerty_comma_nodead
 hu-102_qwerty_dot_dead
 hu-102_qwerty_dot_nodead
 hu-102_qwertz_comma_dead
 hu-102_qwertz_comma_nodead
 hu-102_qwertz_dot_dead
 hu-102_qwertz_dot_nodead
 hu-nodeadkeys
 hu-qwerty
 hu-standard
 hu101
 ie
 ie-CloGaelach
 ie-UnicodeExpert
 ie-ogam_is434
 il
 il-heb
 il-phonetic
 in-eng
 iq-ku
 iq-ku_alt
 iq-ku_ara
 iq-ku_f
 ir-ku
 ir-ku_alt
 ir-ku_ara
 ir-ku_f
 is
 is-Sundeadkeys
 is-dvorak
 is-latin1
 is-latin1-us
 is-mac
 is-mac_legacy
 is-nodeadkeys
 it
 it-fur
 it-geo
 it-ibm
 it-intl
 it-mac
 it-nodeadkeys
 it-scn
 it-us
 it-winkeys
 it2
 jp
 jp-OADG109A
 jp-dvorak
 jp-kana86
 jp106
 kazakh
 ke
 ke-kik
 keypad
 kr
 kr-kr104
 ky_alt_sh-UTF-8
 kyrgyz
 kz-latin
 la-latin1
 latam
 latam-colemak
 latam-colemak-gaming
 latam-deadtilde
 latam-dvorak
 latam-nodeadkeys
 latam-sundeadkeys
 lk-us
 lt
 lt-ibm
 lt-lekp
 lt-lekpa
 lt-std
 lt-us
 lt.baltic
 lt.l4
 lv
 lv-adapted
 lv-apostrophe
 lv-ergonomic
 lv-fkey
 lv-modern
 lv-tilde
 ma-french
 mac-be
 mac-de-latin1
 mac-de-latin1-nodeadkeys
 mac-de_CH
 mac-dk-latin1
 mac-dvorak
 mac-es
 mac-euro
 mac-euro2
 mac-fi-latin1
 mac-fr
 mac-fr_CH-latin1
 mac-it
 mac-pl
 mac-pt-latin1
 mac-se
 mac-template
 mac-uk
 mac-us
 md
 md-gag
 me
 me-latinalternatequotes
 me-latinunicode
 me-latinunicodeyz
 me-latinyz
 mk
 mk-cp1251
 mk-utf
 mk0
 ml
 ml-fr-oss
 ml-us-intl
 ml-us-mac
 mm
 mt
 mt-alt-gb
 mt-alt-us
 mt-us
 ng
 ng-hausa
 ng-igbo
 ng-yoruba
 nl
 nl-mac
 nl-std
 nl-sundeadkeys
 nl2
 no
 no-colemak
 no-dvorak
 no-latin1
 no-mac
 no-mac_nodeadkeys
 no-nodeadkeys
 no-smi
 no-smi_nodeadkeys
 no-winkeys
 pc110
 ph
 ph-capewell-dvorak
 ph-capewell-qwerf2k6
 ph-colemak
 ph-dvorak
 pl
 pl-csb
 pl-dvorak
 pl-dvorak_altquotes
 pl-dvorak_quotes
 pl-dvp
 pl-legacy
 pl-qwertz
 pl-szl
 pl1
 pl2
 pl3
 pl4
 pt
 pt-latin1
 pt-latin9
 pt-mac
 pt-mac_nodeadkeys
 pt-mac_sundeadkeys
 pt-nativo
 pt-nativo-epo
 pt-nativo-us
 pt-nodeadkeys
 pt-olpc
 pt-sundeadkeys
 ro
 ro-cedilla
 ro-std
 ro-std_cedilla
 ro-winkeys
 ro_std
 rs-latin
 rs-latinalternatequotes
 rs-latinunicode
 rs-latinunicodeyz
 rs-latinyz
 ru
 ru-cp1251
 ru-cv_latin
 ru-ms
 ru-yawerty
 ru1
 ru2
 ru3
 ru4
 ru_win
 ruwin_alt-CP1251
 ruwin_alt-KOI8-R
 ruwin_alt-UTF-8
 ruwin_alt_sh-UTF-8
 ruwin_cplk-CP1251
 ruwin_cplk-KOI8-R
 ruwin_cplk-UTF-8
 ruwin_ct_sh-CP1251
 ruwin_ct_sh-KOI8-R
 ruwin_ct_sh-UTF-8
 ruwin_ctrl-CP1251
 ruwin_ctrl-KOI8-R
 ruwin_ctrl-UTF-8
 se
 se-dvorak
 se-fi-ir209
 se-fi-lat6
 se-ir209
 se-lat6
 se-latin1
 se-mac
 se-nodeadkeys
 se-smi
 se-svdvorak
 se-us
 se-us_dvorak
 sg
 sg-latin1
 sg-latin1-lk450
 si
 si-alternatequotes
 si-us
 sk
 sk-bksl
 sk-prog-qwerty
 sk-prog-qwertz
 sk-qwerty
 sk-qwerty_bksl
 sk-qwertz
 slovene
 sr-cy
 sun-pl
 sun-pl-altgraph
 sundvorak
 sunkeymap
 sunt4-es
 sunt4-fi-latin1
 sunt4-no-latin1
 sunt5-cz-us
 sunt5-de-latin1
 sunt5-es
 sunt5-fi-latin1
 sunt5-fr-latin1
 sunt5-ru
 sunt5-uk
 sunt5-us-cz
 sunt6-uk
 sv-latin1
 sy-ku
 sy-ku_alt
 sy-ku_f
 tj_alt-UTF8
 tm
 tm-alt
 tr
 tr-alt
 tr-crh
 tr-crh_alt
 tr-crh_f
 tr-f
 tr-intl
 tr-ku
 tr-ku_alt
 tr-ku_f
 tr-sundeadkeys
 tr_f-latin5
 tr_q-latin5
 tralt
 trf
 trf-fgGIod
 trq
 ttwin_alt-UTF-8
 ttwin_cplk-UTF-8
 ttwin_ct_sh-UTF-8
 ttwin_ctrl-UTF-8
 tw
 tw-indigenous
 tw-saisiyat
 ua
 ua-cp1251
 ua-utf
 ua-utf-ws
 ua-ws
 uk
 unicode
 us
 us-acentos
 us-alt-intl
 us-altgr-intl
 us-colemak
 us-dvorak
 us-dvorak-alt-intl
 us-dvorak-classic
 us-dvorak-intl
 us-dvorak-l
 us-dvorak-r
 us-dvp
 us-euro
 us-hbs
 us-intl
 us-mac
 us-norman
 us-olpc2
 us-workman
 us-workman-intl
 uz-latin
 vn
 vn-fr
 vn-us
 wangbe
 wangbe2
 windowkeys

Join the discussion

Comments are hosted on comments.vciso.ch, a server I run myself. Nothing is loaded from it until you press the button below. Loading comments connects your browser to that server, and signing in with GitHub sets a cookie there. See the privacy page for details.

Type to search.

↑ ↓ to move, Enter to open, Esc to close