Skip to content

How to install and use Espanso, a text expander, on Ubuntu

November 6th, 2023 Ubuntu Image of a keyboard, the left half, on a yellow-ish background

Tired of typing the same phrases, email addresses, or code snippets repeatedly?

I know I was and I started looking for way to automate typing of recurring pieces of text. A text expander like Espanso can be a time-saving tool for you.

Espanso is an open-source, cross-platform text expander that allows you to create custom text snippets, macros, and shortcuts to quickly insert text in any application. In this tutorial, I'll guide you through the process of installing and using Espanso on Ubuntu.


Before we dive into the installation and usage of Espanso, make sure you have the following prerequisites:

  1. A machine running Ubuntu (this guide is based on Ubuntu 23.10, but the process should be similar for other versions).

  2. Access to the terminal and administrative privileges (sudo access).

Choosing the right install method

Espanso comes in two flavours, one for the X11 desktop environment and one for Wayland. First you need to check which one you are using. Check you desktop environment by typing the following in a terminal:


For Ubuntu, there are four installation options, this note will only use the Snap package installation and assume you are running on X11. If you are running on Wayland, you can only install with a DEB package. Let’s install it!

1. Open your terminal: You can do this by pressing Ctrl + Alt + T or searching for "Terminal" in the application menu.

2. Update your package list: Before installing Espanso, it's a good practice to ensure your package list is up to date. Run the following command:

sudo apt update

3. Install Espanso: Once your package list is updated, you can install Espanso using Snap with the following command:

sudo snap install espanso --classic --channel=latest/edge

The Snap package manager will download and install Espanso on your system. When this command finishes, you can test if it worked, by checking the version of Espanso with espanso --version .

4. Install Espanso as a systemd service: After the installation is complete, regsiter Espanso as a systemd service with the following command:

espanso service register

And then start Espanso with:

espanso start

Espanso will run in the background, ready to assist you with text expansion.

Configuration and usage

Now that Espanso is installed and running, let's explore how to configure it and create text snippets for text expansion.

Before we start using or configuring Espanso, let’s first introduce a few concepts that Espanso uses:

  • Trigger: This is the keyword that Espanso tries to find a match for in its configuration file. When Espanso finds a trigger it will replace the trigger with its longer equivalent (replacement text).

  • Replacement Text: This is the longer text that replaces its equivalent trigger when you type it.

  • Match: A match is a key-value pair that associates a trigger with its replacement text.

Espanso can have static and dynamic matches. Static matches replace a trigger with a set replacement text, while dynamic matches can replace a trigger with a variable, for instance a date or time.

Configuration File

The configuration file for Espanso is located at ~/.config/espanso/default.yml. You can edit this file to define your custom text expansion rules. You can use your preferred text editor to open and edit this file.

Create Snippets

To create a text snippet, add an entry in the configuration file in the following format:

- trigger: ":shrug"
replace: "¯\\_(ツ)_/¯"

In this example, typing :shrug will automatically replace it with the famous shrug emoticon. Whenever you edit file sin the config directory Espanso will automatically reload all the config files, so changes are usable immediately.


Espanso is a versatile text expander that can significantly boost your productivity by reducing repetitive typing tasks. By following this guide, you should now have Espanso up and running on your Ubuntu system and be well on your way to creating and using your own custom text expansions. Explore its extensive documentation and get creative with your snippets to streamline your workflow and save time.

Photo by Aditya Rathod

About Marcel Bootsman

Marcel discovered the web in 1995. Since then he has paid attention to and worked with lots of technologies and founded his own WordPress oriented business in 2009.

Currently Marcel is Marketing Manager for the Dutch Market at Kinsta where he helps Kinsta's client base grow in the Managed WordPress and Application & Database hosting arena.

You can contact Marcel on a diverse range of online platforms. Please see the Connect section on the homepage for the details.