If you, too, are a Sublime Text user and your recent switch to Linux has you missing the editor, or you’re just getting started with programming and wish to try out a new code editor, you’ll want to get Sublime Text running on your Linux machine.

To make things easier, here’s a guide with step-by-step instructions to install Sublime Text on Linux.

Install Sublime Text Using a Package Manager

Sublime Text is available on most Linux distros via their respective package managers. If you’re running Ubuntu, Arch Linux, CentOS, Fedora, or openSUSE, you can follow the instructions in the sections below to install Sublime Text on your machine.

Installing Sublime Text on Ubuntu/Debian

Running Ubuntu or its derivatives means you can use the APT package manager to install programs, and that’s what we’ll use to install Sublime Text too.

For this, first, open the terminal. Now, enter the following command to add the GPG key:

Add the Sublime Text repository to the system with:

Finally, update the APT sources and install Sublime Text by entering:

If you wish to remove Sublime Text from your system, run:

Installing Sublime Text on Arch Linux

On Arch Linux, you can install Sublime Text using pacman. For this, start by adding the GPG keys. You can do this using the following command:

Then, add the repository by running:

Once it’s added, update the repository and install Sublime Text with:

To delete Sublime Text, run:

Installing Sublime Text on CentOS

CentOS uses YUM, which simplifies the package installation process on the system. To install Sublime Text with YUM, first, add the GPG keys using the following command:

Now, add the Sublime Text repository with:

And finally, run the commands below to install Sublime Text:

In case you no longer want to use Sublime Text, you can delete it from your computer with:

Installing Sublime Text on Fedora

On Fedora, you can install and manage packages using DNF. To install Sublime Text, first, run the command below in the terminal to add the GPG key:

Then, add the repository for Sublime Text with:

Once it’s added, update the package list and install Sublime Text by running:

For removing Sublime Text, run:

Installing Sublime Text on openSUSE

Installing Sublime Text on openSUSE is made easy thanks to the Zypper package manager. To do this, first, run the command below to add the GPG key:

Next, add the Sublime Text repository with:

And lastly, update the package list and install Sublime Text by running:

At any point, if you want to remove Sublime Text from your system, use:

How to Install Sublime Text Using Snap

While the package manager installation method covers most Linux distros, in case you’re using a distro other than the ones mentioned in the previous section—or if you’re facing issues with installing Sublime Text using a package manager—you can use Snap for the installation instead.

But before you can install Sublime Text via Snap, you must first install and set up Snap on your computer.

In case you’re uncertain whether Snap is installed on your system, you can verify this by running:

If this outputs the Snap description, it indicates that Snap is present on your system, and so you can skip the installation and move on to the next step. In case it doesn’t, follow our detailed guide on Snap to learn how to do this.

Once you’ve successfully set up Snap, open the terminal and run the following command to install Sublime Text:

To remove Sublime Text, run:

How to Set Up Sublime Text

Considering you’ve followed the instructions for your Linux distro carefully, you should have Sublime Text successfully installed on your machine.

To launch it, access the applications menu and search for Sublime Text. Click on the most relevant result or hit Enter.

Now, before you jump in and start using the program to write/edit code, there are a few things you should do for a better experience.

To begin with, if you’ve been a Sublime Text user—up to version 3—and you used minimap to navigate through a file effortlessly, you’d notice that the latest version (Sublime Text 4) doesn’t have the option enabled by default.

However, there’s a way to enable it. To do this, click on Preferences and select Settings. In the Preferences.sublime-settings file, add the following line between the curly brackets ({}):

Hit Ctrl + S or go to File > Save to save the changes.

As soon as you save the file, you’ll notice that the minimap viewport is back and fully functional on Sublime Text 4.

Similarly, if you’d like to use a fixed font size for all your files, you can add the following line to the same file to avoid having to change the font size for each file again and again:

You can also set tab size if that’s something that bothers you by adding:

Or, translate tabs to spaces using:

Another important feature you must enable (install rather) is Package Control, which makes it easier to find, install, and keep packages updated on the app.

To install Package Control, click Tools > Install Package Control. Sublime Text will now take a few seconds and automatically install it for you.

Bring up Command Palette by pressing Ctrl + Shift + P, and then search “package control” in the search window. This will show you all the various Package Control options that you can use to carry out different operations.

One such operation is installing packages, which we’re going to use to integrate Git into Sublime Text to simplify file management between your local computer and remote repositories. (If you have Git installed on your system, you can skip this.)

For adding Git, press Ctrl + Shift + P to invoke Command Palette. Here, start typing “package control” and select Package Control: Install Package.

On the following screen, click on the search window and type Git. Click the result that reads Git to install it.

Once Git is installed, you’ll find it under Tools. Do note that you’ll need to set it up before you start using it.

Write Efficient Code on Linux Using Sublime Text

With Sublime Text installed and configured on your Linux computer, you should now be able to use it to write code in various programming languages efficiently.

Moving forward, as you start using the editor for your work, you’ll find the need to install additional packages to simplify certain operations. Thanks to Package Control, you can now do this easily and enhance Sublime Text’s functionality to your needs.

If you’d like to explore more options, you may want to check out some other IDEs and code editors for Linux.