How to Install On-Screen / Virtual Keyboard in Raspberry Pi?

If you have a touch screen on your Raspberry Pi (or no keyboard available for it), it can be really useful to install a virtual keyboard on Raspberry Pi OS.
In this tutorial, I will show you how to install and use this keyboard.

How to install a virtual keyboard on Raspberry Pi?
On Raspberry Pi OS, a package is available in the default repository to enable a virtual keyboard on your screen.
After the installation (with the package manager or apt command), the keyboard is available in the Accessories menu.

That’s particularly useful for touchscreens, like the RasPad 3 I tested in this article.
I will give you all the details in the following on how to install it, use it and a few extra tips 🙂

Install the virtual keyboard package

Etcher vs Imager
Download the Pi Glossary!
If you are lost in all these new words and abbreviations, request my free Raspberry Pi glossary here (PDF format)!

Install Raspberry Pi OS

Obviously, the first step is to install an operating system on your Raspberry Pi
If you need some help to install Raspberry Pi OS (ex Raspbian), you can read my detailed tutorial here
The Desktop version is required to install the virtual screen on it

But, if you don’t have a keyboard at home, you may be quickly stuck during the configuration.
How to configure the network or complete the welcome wizard without keyboard?
That’s why, this tutorial for a headless installation on Raspberry Pi Zero will probably help

You’ll see how to configure the network and enable SSH from your computer, so you don’t need a keyboard.
I often use this method when I create a new SD card, even if I have a good wireless keyboard.
This saves time on each installation 🙂

Raspberry Pi Bootcamp
Sale: 10% off today.
Take it to the next level.
I'm here to help you get started on Raspberry Pi.
Learn all the skills you need in the correct order.

System updates

Ok, once your system installed (or if you already had made this step before reading this tutorial), there is an additional step
As I told you the package is available in the default Raspbian repository
So, it’s a good idea to start by updating your system

Here are the commands to update all packages from a terminal:
sudo apt update
sudo apt upgrade
sudo reboot

You can also do this in the “Add/Remove software” tool if you prefer
Go to the main menu > Accessories > Add/Remove Software
Then click on Options > Check for updates and upgrade everything

Enable SSH

If you use a touch screen or don’t have a keyboard, it’s probably a good idea to enable SSH on your Raspberry Pi
This way, you can install and configure new packages from your computer

This step is not mandatory, but here is how to do this:

  • Open the main menu
  • Go to Preferences > Raspberry Pi Configuration
  • Then enable SSH in the Interfaces tab

You can now connect to your Raspberry Pi from your computer
On Windows, you need a software like Putty
On Linux, you can use a terminal with the command: ssh pi@IP
You’ll find more details in this tutorial if needed

Install the virtual keyboard

We can finally install the virtual keyboard package
I will show you how to do this with two methods: with SSH or directly on Raspbian Desktop

Installation on Raspberry Pi OS Desktop

If you have a keyboard for the installation, you can do this directly in the desktop interface:

  • Open the main menu
  • Go to Preferences > Add/Remove Software
  • In the search field, type “matchbox” and press Enter
  • In the results, find the “on-screen keyboard” package
    The package name is something like matchbox-keyboard
    Check the corresponding box
  • Click on “Apply” to install it
    The system will automatically install the package dependencies

You can now exit this tool and go directly to the keyboard utilization

Installation via SSH

From your computer, you can also install the package on your Raspberry Pi if SSH is enabled:

That’s it!
You can now switch back to the Raspberry Pi screen and read the following part

Use the virtual keyboard

Get My Cheat Sheet!
Grab your free PDF file with all the commands you need to know on Raspberry Pi!

Open the keyboard

Once installed, the keyboard is available in the main menu
Go to “Accessories” and click on “Keyboard”
The keyboard will now show up on your screen:

The desktop icons will move in the bottom part, and you can also move the keyboard where you want (if you prefer it at the bottom for example)

From there, the usage is intuitive (it’s really close from a smartphone keyboard)
On a touch screen it’s perfect, but if you are on a large screen the keyboard probably takes too much space. You can decrease the window size with your mouse, as for any other application.

Master your Raspberry Pi in 30 days
Sale: 10% off today.
Download the eBook.
Uncover the secrets of the Raspberry Pi in a 30 days challenge.
Learn useful Linux skills and practice multiples projects.

Create a shortcut

If you use the virtual keyboard all the time, starting it from the main menu it not the most practical
You can create a shortcut in the top bar:

  • Right-click on an icon from the top bar (Terminal for example)
  • Click on “Application Launch Bar Settings”
  • A window like this shows up:
  • Find the keyboard application on the right and click on “Add” to add it on the left
  • Close the window
  • The icon is now available on the top bar


I already have a post on how to autostart a program on boot
But unfortunately, none of the methods explained works well in this case

There is probably a more elegant way to do this, but here is the one that worked for me:

  • From your computer, connect to the Raspberry Pi via SSH
  • Create a new script in /usr/local/bin (or anywhere else)
    sudo nano /usr/local/bin/
  • Paste the following lines:
    sleep 5
  • Save & exit (CTRL+O, CTRL+X)
  • Add the execution permission:
    sudo chmod +x /usr/local/bin/
  • Edit the following file:
    sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
  • Add this line at the end:
  • Save & exit

If you directly add the matchbox-keyboard command in the autostart file, the keyboard will open at a minimal size, not very useful
So, I created a script with a wait time (sleep 5) while the Desktop is loading
After a reboot, everything is ok, the keyboard shows up in full size automatically

If you find a better way, let me know in the comments 🙂

Support us: Join the community on Patreon to show your support, get behind-the-scenes content and other awesome perks!


That’s it! You now know how to install an on-screen keyboard on your Raspberry Pi.
In general, I prefer using a wireless keyboard (as explained here), but this solution may help if you have no other choice.

Obviously, you can also use a remote access tool like Anydesk to control your Pi from your computer.

I hope this post was useful for you.
If you have any question related to your specific hardware, feel free to leave a comment below, and we will try to find a solution.

This tutorial doesn't work anymore? Report the issue here, so that I can update it!

Patrick Fromaget

I'm the lead author and owner of My goal is to help you with your Raspberry Pi problems using detailed guides and tutorials. In real life, I'm a Linux system administrator with a web developer experience.

Recent Posts

Master your Raspberry Pi in 30 days

Download this eBook and discover:
1. Secrets from my 20-years Linux experience 2. Many step-by-step projects for your Raspberry Pi 3. How to save time by learning the right way
Master your Raspberry Pi - 10% off