How to Install Insomnia on Ubuntu 24.04, 22.04 or 20.04

This guide will demonstrate how to install Insomnia on Ubuntu 24.04, 22.04, or 20.04 LTS utilizing the command-line terminal with the official Insomnia APT repository for the latest version and for easy future upgrades via CLI commands.

Insomnia is a powerful API client that simplifies the process of building, debugging, and testing APIs. Designed for developers, it offers a user-friendly interface and a suite of tools to manage requests and responses efficiently. Whether you’re working on REST, GraphQL, or other types of APIs, Insomnia provides the functionality needed to send requests, inspect responses, and automate testing. It stands out for its ease of use, flexibility, and robust features that cater to both beginners and seasoned professionals in the field of software development.

Key Benefits of Using Insomnia:

  • Simplifies API Interaction: Offers a clean, intuitive interface for sending requests and viewing responses.
  • Supports Multiple API Standards: Compatible with REST, GraphQL, and other protocols.
  • Enables Environment Management: Easily switch between different environments for testing.
  • Facilitates Automation: Automate tests and streamline your workflows.
  • Enhances Productivity: Save requests for future use, organize them into collections, and share them with teammates.
  • Customizable: Tailor the workspace to your needs with themes and plugins.
  • Secures Data: Provides encryption for sensitive information like API keys and passwords.
  • Open Source: Benefit from community-driven enhancements and integrations.

Transitioning from understanding the significance of Insomnia in API development to installing it on your Ubuntu system is seamless.

Install Insomnia on Ubuntu via APT

Update Ubuntu Before Insomnia Installation

It’s a good practice to ensure your system is up-to-date with all the existing packages before installing Insomnia to avoid potential conflicts.

sudo apt update && sudo apt upgrade

Install the Required Packages

You’ll need to install some dependencies to install Insomnia on your Ubuntu system.

sudo apt install apt-transport-https

Install Insomnia on Ubuntu via APT Command

To start the installation process of Insomnia on your Ubuntu system, you’ll need to begin by importing the repository. You can do this by entering the following command in your terminal. This command will enable your system to access the necessary files and packages for installation:

echo "deb [trusted=yes arch=amd64] https://download.konghq.com/insomnia-ubuntu/ default all" | sudo tee /etc/apt/sources.list.d/insomnia.list

After importing the repository, you should run an APT update to ensure your system reflects the changes. This will allow your system to access the newly imported repository and retrieve the necessary files and packages for installation.

sudo apt update

At this point, you’re ready to install Insomnia on your Ubuntu system. You can do this by entering the following command in your terminal, and this will initiate the installation process and install the Insomnia software on your system.

sudo apt install insomnia

Launch Insomnia on Ubuntu via CLI or GUI

Now that you have successfully installed Insomnia, you can launch the tool using either of the two available methods.

CLI Command to Launch Insomnia

If you prefer the command line terminal, you can quickly launch Insomnia by entering the following command.

insomnia

GUI Method to Locate and Launch Insomnia

For desktop users who prefer not to use the command line terminal, the best way to launch Insomnia is by opening the application’s graphical user interface (GUI).

You can do this by following the path to the Insomnia application on your system.

Activities > Show Applications > Insomnia
Launching Insomnia API client from the Ubuntu applications menu.
How to Open Insomnia from Ubuntu’s Applications Menu.

Tips on Getting Started with Insomnia on Ubuntu

Now that you have successfully installed Insomnia on Ubuntu, here are some first-time tips on getting started with the software:

General Tips for Using Insomnia on Ubuntu

  • Explore Keyboard Shortcuts: Familiarize yourself with Insomnia’s keyboard shortcuts to improve your workflow efficiency. For example, Ctrl + N creates a new request, and Ctrl + Shift + R sends the current request.
  • Utilize the Response Viewer: The response viewer is highly versatile, allowing you to view responses in various formats. Make use of the Pretty, Raw, and Preview modes to analyze your API responses effectively.
  • Environment Variables: Set up environment variables for different stages of development, such as testing, staging, and production. This allows for seamless switching and testing across different environments without the need to change your requests manually.
  • Secure Your Credentials: Use Insomnia’s environment variables to store sensitive information like API keys and passwords. This not only keeps your credentials secure but also makes them easily reusable across multiple requests.

Customization Tips for Enhanced Productivity

  • Themes and Plugins: Personalize your Insomnia interface with themes and plugins available through the application settings. This can help in reducing eye strain and integrating additional functionalities into your workflow.
  • Workspace Organization: Organize your requests and projects into different workspaces. This keeps your API calls structured and makes collaboration with teammates smoother if you’re working on shared projects.
  • Response History: Take advantage of Insomnia’s response history feature to compare past responses with current ones. This is invaluable for debugging and understanding how your API behavior changes over time.
  • Use Snippets for Repeated Requests: If you find yourself using the same JSON bodies or parameters frequently, save them as snippets. This saves time and ensures consistency across your requests.

Linux-Specific Tips for Insomnia

  • Custom SSL Certificates: On Ubuntu, you might need to deal with custom SSL certificates. Insomnia allows you to configure custom certificates via its settings, ensuring secure connections to your APIs.
  • Filesystem Integration: Leverage Ubuntu’s filesystem for managing large payloads or scripts. You can reference external files in your requests within Insomnia, making it easier to manage large data sets or complex scripts.
  • Shortcut Creation for Quick Access: Although not directly within Insomnia, creating a desktop shortcut or a quick launch command via your terminal can speed up your access to Insomnia. Use gnome-desktop-item-edit ~/.local/share/applications/ --create-new and follow the prompts to create a launcher.
  • Networking Tools: Utilize Ubuntu’s networking tools alongside Insomnia for advanced API testing scenarios. Tools like curl and netcat can be used for preliminary testing or debugging before importing the requests into Insomnia.

Other Essential Tips

  • Back Up Your Workspaces: Regularly export your workspaces and environment settings. This not only serves as a backup but also allows you to share your setup with new machines or team members easily.
  • Documentation Generation: Use Insomnia’s ability to generate documentation for your APIs directly from your requests. This can be a great way to share your API’s capabilities with others or simply document them for your future reference.
  • Collaboration Features: If you’re working in a team, explore Insomnia’s collaboration features to share workspaces, requests, and environments. This ensures that everyone is on the same page and can contribute efficiently.
  • Stay Updated with the Community: Engage with the Insomnia community on GitHub or other forums. This is a great way to stay informed about new features, plugins, and best practices.

Incorporating these tips into your workflow, you’ll not only maximize your productivity with Insomnia on Ubuntu but also ensure a smooth and efficient API testing and development process.

Insomnia API client ready for use on Ubuntu Linux.
Insomnia Launched Successfully on Ubuntu.

Additional Insomnia Commands with Ubuntu

Remove Insomnia

If you remove the video conference software from your system, you can use the following command in your terminal. This will initiate the removal process and delete the software from your system.

sudo apt remove insomnia

If you have no plans to re-install the software, you can remove the repository using the following command. This will remove the repository and prevent your system from accessing it in the future.

sudo rm /etc/apt/sources.list.d/insomnia.list

Conclusion

In wrapping up, this guide walked you through installing Insomnia on Ubuntu, alongside dishing out first-time user tips to kickstart your journey with this robust API client. We dove into the essentials of using Insomnia effectively, touching on customization, Linux-specific advice, and ways to enhance your workflow. The final piece of advice? Dive in, explore Insomnia’s features, and don’t hesitate to personalize your experience to suit your development needs. Remember, the more comfortable you are with the tool, the smoother your API testing and development process will be. Keep experimenting, stay curious, and happy coding!

Leave a Comment


Your Mastodon Instance
Share to...