Note that you need to edit third-party/LuaJIT-2.0.3/src/Makefile and change "CC= gcc" into "CC= cc" prior to start the compilation.

pkg install git wget autoconf autoconf-wrapper automake automake-wrapper libtool sqlite3 mysql56-client libxml2 glib gmake bash rrdtool redis pkgconf

echo 'redis_enable="YES"' >> /etc/rc.conf
service redis start

mkdir ~/build
cd ~/build
git clone https://github.com/ntop/nDPI.git
git clone https://github.com/ntop/ntopng.git
cd nDPI
./autogen.sh
gmake
cd ../ntopng
./autogen.sh
./configure
perl -p -i -e 's/OpenBSD/FreeBSD/' Makefile
perl -p -i -e 's/CC= gcc/CC= cc/' third-party/LuaJIT-2.0.3/src/Makefile
gmake
gmake install
sysctl net.inet6.ip6.v6only=0
ntopng

Courtesy of Joe Rizzo <jrizzo@rizzos.net>