Learn the commands to install Insomnia in Ubuntu 22.04 Jammy or Ubuntu 20.04 Focal using the command terminal for testing HTTP and REST APIs.
Insomnia is a free and GPL-licensed software for developers who are in the field of testing and debugging HTTP and REST APIs. The best thing about Insomnia is it provides a user-friendly graphical interface to send requests, view responses, and analyze API interactions.
It allows developers to create and organize requests or customized them with various parameters. Moreover, due to its intuitive interface, it becomes easy for programmers to build and compose HTTP requests. Developers can select different API/HTTP request methods such as GET, POST, PUT, URL endpoints, query parameters, request bodies, and more.
Other features of Insomnia are Response Inspection, environment variables support, authentication, and security methods which include basic, digest, OAuth, and JWT (JSON Web Tokens); Code Generation, Collaboration & Sync, and a plugin System.
This API testing software is cross-platform and available for all popular operating systems including Linux and has been widely used by developers, API designers, and testers to streamline the development and testing of APIs.
Steps to install Insomnia on Ubuntu 22.04 or 20.04 LTS Linux
#1st-way using Snap Store
1. Open GUI Software Store
On your respective version of Ubuntu, click on the Activities link given in the Taskbar and search for “Snap Store” or Software. Open, when it comes to the search results.
2. Install Insomnia on Ubuntu
Next, in the Software store, click on the Search icon and then search for Insomnia, as its icon appears click to open it. In the further window, you will get the Install button, Hit that, and this API testing software will be on your system.
To run the software, go to the Application menu and search for it.
#2nd method using APT repository
3. Add APT Source repository
There are many Linux users, who won’t prefer Snap to install applications, those can use the APT package repository of Insomnia on their Ubuntu 22.04 / 20.04 Linux. Another reason for using the package repository over SNAP is the installation of software updates can be applied easily just by running the regular system update command.
echo "deb [trusted=yes arch=amd64] https://download.konghq.com/insomnia-ubuntu/ default all" \
| sudo tee -a /etc/apt/sources.list.d/insomnia.list
4. Installing Insomnia on Ubuntu 22.04/20.04
After adding the repository, run the system update command and use the APT package manager to install Insomnia on your Ubuntu Linux system.
sudo apt update
sudo apt install insomnia
#3rd way directly using the Debian binary
5. Download Deb Binary
Another way to get Insomnia is by directly downloading and installing the Debian binary of this API application from its official website. Alternatively, open your command terminal and execute the given.
wget "https://updates.insomnia.rest/downloads/ubuntu/latest?&app=com.insomnia.app&source=website" -O insomnia.deb
6. Setup Insomnia using Deb
Once you have the Debian binary of Insomnia, use the DPKG tool to install it via the Terminal.
sudo dpkg -i insomnia.deb
7. Launch the HTTP/REST API Tester
Using any of the given methods, when it comes to running Insomnia, click on Activities, and then in the search box type – Insomnia. Once in the search results, it shows, click to run the same.
8. How to Update
When it comes to updating Insomnia in the future, you have to go according to the method you have used to install it.
For APT Repository users: They can open the command terminal and run the system update and upgrade command:
sudo apt update && sudo apt upgrade
Whereas those who have used the Debian binary, need to download and install it again as we have shown in its method.
If you have used the Software GUI to install Insomnia then again open it and search for this application. As you have it in the results, open it and if some update is available, you will have an Update button for the same.
If you are not happy with this API and HTTP testing application, go according to your installation method to remove Insomnia from Ubuntu Linux.
For APT and Debian binary users:
sudo apt autoremove --purge insomnia
Whereas the GUI users, need to go to their software GUI app, search for Insomnia, open it, and click the Bin icon.