Install Dependencies
Snort 3 requires the following packages. Install them using your system’s package manager before building.Required dependencies:
On Ubuntu/Debian:Install DAQ from source:
| Dependency | Purpose |
|---|---|
| CMake | Build system |
| DAQ | Packet I/O abstraction layer |
| dnet | Network utility functions |
| flex >= 2.6.0 | JavaScript syntax parser |
| g++ >= 7 (or any C++17 compiler) | Compilation |
| hwloc | CPU affinity management |
| LuaJIT | Configuration and scripting |
| OpenSSL | SHA/MD5 signatures, SSL detection |
| pcap | Packet capture and tcpdump-style logging |
| PCRE2 | Regular expression pattern matching |
| pkgconfig | Locates build dependencies |
| zlib | Decompression (>= 1.2.8 recommended) |
DAQ must be built and installed from source. See Building Snort 3 for instructions on setting
PKG_CONFIG_PATH when DAQ is installed to a non-system path.Clone the Repository
Get the latest Snort 3 source from GitHub:
Alternatively, download a source tarball from snort.org and extract it:
Build and Install
Set your install prefix and build using the provided If you are familiar with cmake, you can run
configure_cmake.sh script. This script automatically creates and populates a build/ subdirectory.If DAQ was installed to a custom path, export
PKG_CONFIG_PATH before running configure_cmake.sh:cmake or ccmake directly instead of configure_cmake.sh. See Building Snort 3 for all available build methods and cmake options.Verify the Build
Confirm Snort built and installed correctly by printing the version:You should see output similar to:You can also explore the available help:
Run Your First Capture
Read and decode packets from a pcap file — no configuration or rules required:Snort decodes and counts every packet, then prints statistics at exit. Only non-zero counts are shown.To see full packet details including TCP/UDP payloads:To read from a live interface (replace To capture 10 packets from a live interface to a pcap file for later analysis:
eth0 with your interface name):Use
-n <count> to limit the number of packets processed, or press Ctrl-C to stop a live capture.Run IDS Mode with Rules
Load a configuration file and a rules file to enable intrusion detection.First, verify your configuration loads cleanly:Run IDS mode against a pcap with Run against a full pcap directory with multiple packet threads:Suppress a specific rule at runtime without editing the config:To see all available alert output types:
cmg alert output (header + hex payload):The
-A cmg flag is equivalent to -A fast -d -e — it shows alert header details followed by the packet payload in hex and text. Other formats include -A u2 (unified2 binary), -A csv (customizable CSV), and -A alert_fast (one-line summary).Configuration Basics
Snort’s configuration file is a Lua script. The defaultsnort.lua shipped with Snort is a good starting point. A minimal working example looks like:
Command line options override Lua configuration values. Use
--lua to inject or override settings inline:Next Steps
- Review Building Snort 3 for advanced build options, Hyperscan integration, and platform-specific notes.
- Run
snort --help-countsto see all available peg count statistics. - Use
snort --help-module <name>to explore any module’s configuration parameters.

