How to Install Sublime Text 4 on Ubuntu and Other Linux Distros

Learn various ways to install Sublime Text on Ubuntu and other Linux distribution for free. Both GUI and command line ways have been discussed.
Warp Terminal

Sublime Text is a cross-platform proprietary text editor used for β€œcode, markup, and prose”. It has often been termed the best code editor for a long time.

Sublime Text has been facing tough competition due to new modern code editors like Visual Studio Code. Despite that, Sublime Text on Linux still has a decent user base.

βœ‹
Non-FOSS Warning! Please note that Sublime Text is not an open source software. It may be downloaded and evaluated for free for an unlimited time, however, a license must be purchased for continued use.

There are various ways of installing Sublime Text on Linux:

  • Download the DEB/RPM file
  • Add the repository (for Ubuntu/Debian)
  • Use Snap packaging (works for all distributions that support Snap)
  • Run the editor in the classic Linux method using its tar file

I’ll show the steps for each method here. You can choose to go with the one you prefer.

Method 1: Install Sublime Text on Ubuntu using the DEB file

Sublime Text provides DEB/RPM files for Ubuntu/Fedora, SUSE, etc. You can go to their official page in Ubuntu and download the DEB installer file.

download sublime text deb package
Download Sublime Text DEB file

After downloading, open it in the Ubuntu software center.

open sublime text deb file with software center
Open Sublime Text DEB file with Ubuntu Software Center

Now, you can install sublime text by pressing the install button on Ubuntu Software center.

install downloaded sublime text deb package using ubuntu software centre
Install the downloaded Sublime Text DEB package using Ubuntu Software Centre

Or you can use other methods like the GDebi package installer to install the downloaded deb file, which will search and install any necessary dependencies also.

Similarly, you can download and use the RPM file in Fedora/openSUSE systems.

sublime text installed in ubuntu
Sublime Text installed in Ubuntu

Method 2: Install Sublime Text on Ubuntu using the official repository

Since installation through the DEB file won’t add any repository to your system, you may need to reinstall if a new version is out.

Sublime text officially provides a repository, through which you can install Sublime Text either through the stable channel or the dev channel.

Before starting, make sure that apt is set up to work with HTTPS sources:

sudo apt-get install apt-transport-https

Now open a terminal and use the following command one by one:

wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/sublimehq-archive.gpg > /dev/null
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt update 
sudo apt install sublime-text

This will add the Sublime Text repository to your system. Now you are getting Sublime Text directly from the developers. If there is a new version available, your installed version gets updated along with the system updates.

You can visit the official installation guide to install Sublime text in other popular distributions like Fedora, Arch Linux, OpenSUSE, etc.

Method 3: Install Sublime Text on any Linux distribution using Snap

Installing Sublime Text on Ubuntu is way easier thanks to Snap support in Ubuntu Software Center. All you need to do is to search for Sublime Text in the software center and install it from there in a couple of clicks.

install sublime text snap application through ubuntu software centre
Install the Sublime Text snap application through Ubuntu Software Centre

What you get in Ubuntu Software Center can also be achieved in the command line and is not limited to just Ubuntu.

If your Linux distribution has Snap support enabled, you can use this command to install Sublime Text.

sudo snap install sublime-text

Method 4: The classic Linux way

You can download the tar package from the official download page.

download sublime text tar file
Download Sublime Text tar file

Now extract the tar file. Inside the folder, you will find a sublime_text file.

sublime text file inside the extracted tar file
sublime_text file inside the extracted tar file

Double-click on it and it will open Sublime Text.

Bonus Tip: Installing older versions of Sublime Text

I have discussed how to install Sublime Text latest version (v4) in Linux distributions. But if you want to run a previous version of Sublime Text, say version 3, you can do that as well.

Sublime Text provides installation media for version 3 as a deb file and version 2 as a tar package on their official download page.

download sublime text version 3
Download Sublime Text version 3

Here, you can download the deb/rpm file and install it, as mentioned in the previous step.

Once installed, it will prompt you that a newer version of Sublime Text is available. but you can ignore that and continue using version 3.

In the end...

Sublime Text is excellent but unfortunately it is not open source. The good thing is that there are plenty other good open source code editors available.

7 Best Modern Open Source Text Editors For Coding in Linux
Looking for the best text editors in Linux for coding? Here’s a list of the best code editors for Linux. The best part is that all of them are free and open-source software. If you ask experienced Linux users, their answers would probably include Vim, Emacs, Nano, etc. No

I hope this tutorial helped you to install Sublime Text on Linux. Please let me know in the comment section below if you have any questions or suggestions.

About the author
Abhishek Prakash

Abhishek Prakash

Created It's FOSS 11 years ago to share my Linux adventures. Have a Master's degree in Engineering and years of IT industry experience. Huge fan of Agatha Christie detective mysteries πŸ•΅οΈβ€β™‚οΈ

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

It's FOSS

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.