# Compiling Suricata from source on macOS

**URL:** <https://forum.suricata.io/t/compiling-suricata-from-source-on-macos/6447>\
**Category:** Guides\
**Created:** [August 28, 2026, 2:21pm UTC](https://forum.suricata.io/t/compiling-suricata-from-source-on-macos/6447 "2026-08-28T14:21:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukashino](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.suricata.io/lukashino/32/1150_2.png) [@lukashino](https://forum.suricata.io/u/lukashino)\
**Post date:** [August 28, 2026, 2:21pm UTC](https://forum.suricata.io/t/compiling-suricata-from-source-on-macos/6447/1 "2026-08-28T14:21:49Z")

</div>

I just went through Suricata compilation on MacOS (26.6.2), and I thought I could capture the process, in here for now.

## Install build dependencies

Install the required build tools and libraries using Homebrew:

```bash
brew install \
    autoconf automake libtool pkgconf \
    rust cbindgen \
    jansson libpcap pcre2 libyaml zlib

```

You may/may not want to install Rust/cbindgen through Homebrew. The alternative is to use `rustup`.

## Cloning the repositories

Assuming the repositories for both Suricata and Suricata-verify are checked out next to each other:

```auto
.
├── suricata
└── suricata-verify

```

Enter `suricata` folder.

## **Install build dependencies**

Install the required build tools and libraries using Homebrew:

```bash
./autogen.sh
./configure \
    --with-libjansson-includes="$(brew --prefix jansson)/include" \
    --with-libjansson-libraries="$(brew --prefix jansson)/lib" \
    --with-libyaml-includes="$(brew --prefix libyaml)/include" \
    --with-libyaml-libraries="$(brew --prefix libyaml)/lib" \
    --with-libpcre2-includes="$(brew --prefix pcre2)/include" \
    --with-libpcre2-libraries="$(brew --prefix pcre2)/lib"

```

After a successful configure, Suricata can be compiled using all available logical CPU cores:

```bash
make -j$(sysctl -n hw.logicalcpu)

```

The compiled Suricata binary will be in `./src/suricata`

## **Running suricata-verify**

If you also want to run the `suricata-verify` test suite, install the Python YAML dependency:

```bash
python3 -m pip install PyYAML

```

you can run the tests from inside the Suricata source directory with:

```bash
python3 ../suricata-verify/run.py -q -j$(sysctl -n hw.logicalcpu)

```

## **One-step full build and test command**

For a fresh Git checkout of both Suricata and Suricata-verify, the complete sequence is:

```bash
./autogen.sh && \
./configure \
--with-libjansson-includes="$(brew --prefix jansson)/include" \
--with-libjansson-libraries="$(brew --prefix jansson)/lib" \
--with-libyaml-includes="$(brew --prefix libyaml)/include" \
--with-libyaml-libraries="$(brew --prefix libyaml)/lib" \
--with-libpcre2-includes="$(brew --prefix pcre2)/include" \
--with-libpcre2-libraries="$(brew --prefix pcre2)/lib" && \
make -j$(sysctl -n hw.logicalcpu) && \
python3 ../suricata-verify/run.py -q -j$(sysctl -n hw.logicalcpu)

```

This will:

1. Generate the build system with `autogen.sh`.

2. Configure Suricata using the Homebrew library locations.

3. Compile Suricata.

4. Run the complete `suricata-verify` test suite.
