How to install a virtual keyboard in a Raspberry Pi
In this tutorial, make tech easier than ever to show you how to install and use this keyboard type.
Install and use on-screen keyboard for Pi
Install the operating system for the Raspberry Pi
Obviously, the first step is to install the operating system on the Raspberry Pi. If you need help installing an operating system on a Raspberry Pi (e.g. Raspbian), you can read the detailed instructions at: How to Install an Operating System for the Raspberry Pi.
However, if you don't have a keyboard at home, you can quickly get 'stuck' in the configuration process.
How to configure network or complete welcome wizard without keyboard? That's why the guide to setting up headless on your Raspberry Pi can be helpful.
You will see how to configure the network and enable SSH from your computer, so no keyboard is required.
This method is often used when creating a new SD card, even if you have a good wireless keyboard. This saves time for each installation.
System update
Once the system is installed (or if you've taken that step before reading this guide), there's an additional step.
With that said, this virtual keyboard pack is available in the default Raspbian repository. So, you should 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 want. Go to the main menu, choose Accessories> Add / Remove Software .
Then click Options , then check for updates and upgrades for everything.
Turn on SSH
If you use a touchscreen or don't have a keyboard, you should probably enable SSH on your Raspberry Pi. This way, you can install and configure new packages from your computer.
This step isn't required, but if you need it here's how:
- 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
Install a virtual keyboard
Finally, you can also install the on-screen keyboard package. The article will show you how to do this using two methods: via SSH or directly on Raspbian Desktop.
Install on Raspberry Pi OS Desktop
If you have a keyboard to install, 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, look for the on-screen keyboard package . The package name will be the same as matchbox-keyboard. Check the corresponding box.

Click Apply to install it. The system will automatically install the dependencies.
You can now exit this tool and go directly to the section using the keyboard.
Install over SSH
From your computer, you can also install the package on your Raspberry Pi, if SSH is enabled:
- Connect to the Raspberry Pi using SSH.
- Enter the following command:
sudo apt install matchbox-keyboard
Now, you can switch back to the Raspberry Pi screen and read the following.
Use the virtual keyboard
Open the keyboard
Once installed, the keyboard will be available in the main menu. Go to Accessories and click on Keyboard.
The keyboard should now be visible on your screen:

Desktop icons will move to the bottom, and you can also move the keyboard where you want.
Using the virtual keyboard is very intuitive (it really resembles a smartphone keyboard).
On a touchscreen, this virtual keyboard is perfect, but if you're using a large screen the keyboard can take up too much space. You can reduce the window size with the mouse, as you can with any other application.
Create a shortcut
If you use the virtual keyboard all the time, launch it from the main menu. You can create a shortcut in the top bar:
- Right click on an icon from the top bar (Example: Terminal).
Click Application Launch Bar Settings .
- A window like this will display:

Find a keyboard app on the right and click Add to add it on the left.
- Close the window.
- The icon is now available in the top bar.

Automatically started
From your computer, connect to your Raspberry Pi via SSH. Create a new script in / usr / local / bin (or anywhere else).
sudo nano /usr/local/bin/keyboard.sh
- Paste the following lines:
#!/bin/bash sleep 5 /usr/bin/matchbox-keyboard
- Save and exit ( CTRL
+ O
, CTRL
+ X
).
- Add execution permission:
sudo chmod +x /usr/local/bin/keyboard.sh
- Edit the following file:
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
Add this line to the end:
@/usr/local/bin/keyboard.sh
- Save and exit.
If you add the matchbox-keyboard command directly to the autostart file, the keyboard will open at a minimum size (which is not very useful). So I created a script with time to wait (sleep 5) while the desktop loads. After the reboot, everything was fine, the keyboard automatically showed up in full size.
You should read it
- How to get the most out of virtual keyboards on Windows 10
- 3 tips for using good virtual keyboard for iPhone, iPad
- How to open the virtual keyboard on Windows 10
- How to fix the virtual keyboard automatically opens on Windows 10
- Steps to disable the virtual keyboard on Windows 10
- How to resize virtual keyboard/touch keyboard on Windows 11
- Fix virtual keyboard not working in Windows 10
- How to change the theme and background color of the Windows 11 virtual keyboard
May be interested
- Learn Pi Imager, How to Use Raspberry Pi Imagerthe raspberry pi foundation recently released a new application for recording sd cards for the raspberry pi. the new program, called raspberry pi imager, launches march 5, 2020.
- How to connect directly to a Raspberry Pi without Internetthe versatility of raspberry pi means that at some point you may have to use it outside or out of range of wireless networks. so how can you use it without plugging in the keyboard and screen?
- How to fix the virtual keyboard automatically opens on Windows 10when updating to windows 10 fall creator, users will sometimes encounter a virtual keyboard error that automatically appears without you starting. so how to fix this?
- Steps to disable the virtual keyboard on Windows 10this article will show you how to disable the virtual keyboard that appears on the login screen in windows 10.
- How to install an operating system for Raspberry Pithe article will show you how to install and run your new operating system on pi, as well as how to copy your perfect settings to fix errors quickly.
- How to resize virtual keyboard/touch keyboard on Windows 11virtual keyboard (touch keyboard) a useful feature that many windows users have been using regularly every day. however, not everyone knows that the size of the virtual keyboard on the screen can be adjusted flexibly.
- How to install NordVPN on Raspberry Piyou've always wanted to get the most out of your raspberry pi and in today's article, we will share tips on how to easily configure openvpn encryption on your device.
- How to open virtual keyboard on Windows 10 for Laptop and PCopening a virtual keyboard on windows 10 is a quick and convenient alternative for users who have technical problems with the physical keyboard. if you still don't know how to open the windows 10 virtual keyboard in the simplest and most effective way, please refer to the 6 ways to start the virtual keyboard below from free download.
- Fix virtual keyboard not working in Windows 10if the virtual keyboard stops working, you may be in for a bit of trouble. fortunately, there are some simple tips to fix the on-screen keyboard not working problem in windows 10.
- How to install LibreELEC on Raspberry Pi 4the raspberry pi 4 is the most powerful piece of hardware to come from the pi platform. it has usb 3.0, more ram and faster cpu. for this reason, the pi 4 is perfect for a linux-based media player operating system like libreelec.