Getting started with Snort on Ubuntu 22.04
One way to keep your system secure is to monitor the packets, and having a reliable intrusion prevention and detection system comes in handy. Snort is an open-source and lightweight intrusion detection system, and there are several ways to install it on Ubuntu. This guide covers installing snint using suitable and apt-get on Ubuntu 22.04. Also, we’ll see how to install Snort from source.
Method 1. Install Snort with apt-get update
The apt database provides the easiest way to install snort and you only need two commands to install snort on your system.
First, start by updating your apt database with the following command.
Updating ensures you get the details of the latest version of snort to be installed with the next command.
After updating the source list, we can run the following command to install snort on Ubuntu 22.04
That -y The flag is optional, but we’re adding it to skip being asked to answer questions when installing the tool.
You can confirm the installation by checking the version of snort on your system.
We installed Snort version 2.9.15.1 as shown in the image above.
Method 2. Install Snort with apt update
Installing snort with apt is the same as using apt-get. We start updating the apt database with the following command.
After updating, use the following command to install Snort on your Ubuntu.
That’s it. You installed snort using the apt and apt-get commands.
How to Remove Snort on Ubuntu
If at any point you feel you need to remove snort from your system and all of its dependencies, use the following command.
Method 3. Install Snort on Ubuntu 22.04 from source
If you prefer to see the installation in action and have control over the process, you can install snort from source. To do this, you need to download snort from the release page, extract it, and then run the installation commands. Let’s see how this works.
First, download the Snort version you want to install from the Snort releases page wget and make sure you are in the ../ directory where you want to install snort.
Also, you need to install some essential build tools for the installation to be successful. Use the following command.
In this case we install the Snort version 2.9.20. The command would be as follows
$ wget https://www.snort.org/Downloads/snort/snort-2.9.20.tar.gz
After downloading snort using the above command, extract the tar file.
Navigate to the Snort directory containing the installation file.
Finally, use the following command to install snort on your Ubuntu 22. Note that we also use the make Command to compile the source code when installing the package.
Hopefully you now have snort installed and ready to configure.
Conclusion
This guide covers the different methods of installing Snort on your Ubuntu 22.04. Use apt or apt-get for quick and easy installation. All steps for installation are shown in the instructions. Try them.