Installing Mockoon on Linux: A Step-by-Step Guide to API Mocking

APIs or Application Programming Interfaces are quite complex and if left open in the wild, it’s hard to predict what it might do. So I present you Mockoon to mock your API in a controlled and simulated environment. In the article, we will learn about Mockoon and see how to install it in Linux. So let’s get into it.

Mockoon is a free, open-source tool designed for API mocking on Linux systems. It offers a user-friendly GUI as well as a command-line interface. You can install Mockoon using various methods such as AppImage, Snap, or AUR. This article provides a comprehensive guide on how to install and use Mockoon on Linux, making API testing efficient and effective.

Introduction to Mockoon: The API Mocking Tool

We all have worked with APIs, in cloud services like AWS most of the services are accessed using APIs. They are convenient but developing them could be difficult(for me it’s usually trial and error). So it is important that we test it properly, but just testing is not as important as the quality of testing.

Mockoon offers a local testing environment for simulating API behavior. Though the one we will install offers GUI you can also opt for a command line interface. You can also mock on Postman, but it’s not built for this and on top of that it has a limit to the amount of calls you can make.

Mockoon is open-source and provides its services completely free. It also offers a premium subscription that lets you harness the power of AI but it’s your choice. For personal use, I don’t think you will require Mockoon Pro.

Now let me list some of the features of Mockoon.

  • Unlimited Mocking – It’s free and unlimited so go crazy with your mocking.
  • Mockoon requires no account or deployment, making it hassle-free
  • Support for Docker container.
  • Available on Cloud and also serverless compatible.

I won’t go too deep into it, but it’s a simple application and does one thing, that is mocking an API and it does it good so let’s see how to install it.

How to Install Mockoon on Linux

According to their official website, Mockoon is available on Snap and AUR(Arch User Repository). You can also get a Debian package and an RPM package. But the main thing is Mockoon is a software that is also used on the Cloud and there is extensive documentation covering that functionality, especially the serverless part, but I won’t be covering that nevertheless, I will add their Github link in references. Alright, let’s get started.

Installing Mockoon Using AppImage

AppImage has made the whole process of using software on Linux pretty easy. No hassle of dealing with dependencies as all the libraries and necessary components comes bundled inside it. The good thing is that the AppImage file usually comes directly from the author, so you get the latest version that contains all the bug fixes.

To download Mockoon AppImage, head over to the Mockoon website. Click on download and then click on AppImage to download it. For reference check the image below.

Mockoon AppImage
Mockoon AppImage

Well, the download page covers all the download methods(which makes my job easier), but anyway, now you have AppImage in your system. Now just right-click on it and make it executable or you could just run the command below.

chmod +x mockoon-4.1.0.AppImage

Remember to change the AppImage file name if you have a different version of Mockoon AppImage downloaded, otherwise, it will just say “Can’t find the file”.

After making the AppImage executable, simply double-click it to launch Mockoon.

Installing Mockoon Using Package Managers

For those using Arch, they can run the command below to install this software in their system.

yay -S mockoon-bin

If you don’t have Yay, then you have to set it up. It is an AUR helper tool for package management tasks. While you are looking for AUR helper, you can also check this article on AUR helper.

For other distro users, I will recommend using Snap to install the software. If you don’t have Snap installed in your system then you can check this tutorial on Snap. Once installed you can run the command below.

sudo snap install mockoon

For reference, you can check the image below. I ran the snap info command to check which version of Mockoon is available.

Mockoon On Snap
Mockoon On Snap

With this, you should have Mockoon installed in your Linux and it should look like the image below.

Mockoon Langing Page
Mockoon Landing Page

Conclusion: Why Mockoon for API Testing

In this guide, you’ve learned how to install and use Mockoon, a powerful tool for API mocking on Linux. With its user-friendly interface and robust features, Mockoon is an invaluable addition to your developer toolkit. So, are you ready to take your API testing to the next level?

References