Netatalk Installation

This guide covers installing Netatalk from source on UNIX-like operating systems.

Netatalk uses the Meson build system with Ninja as the backend.

Meson only supports out-of-tree builds, and must be passed a directory to put built and generated sources into. We’ll call that directory “build” here. It’s recommended to create a separate build directory for each configuration you might want to use.

Get the source code

To build from a release tarball, download and unpack the tarball.

tar xjf netatalk-*.tar.xz                               # unpack the sources
cd netatalk-*                                           # change to the toplevel directory

To build from the Netatalk GitHub repo, make sure you have Git installed, then clone the source tree.

git clone https://github.com/netatalk/netatalk.git      # clone the repository
cd netatalk                                             # change to the repo directory

Install software dependencies

At this point, you need to install the software dependencies for building and running Netatalk.

This list is not exhaustive, and you may need to install additional software depending on your platform and configuration. See the Compilation documentation for more details.

Required

These are the libraries that are hard requirements for netatalk.

Package Details
bstring built as subproject when shared library not found
iniparser v3.1 or later
libevent2 OR libev
libgcrypt v1.2.3 or later

CNID Backend Requirements

At least one CNID backend is required for netatalk to function.

Package Backend Details
Berkeley DB dbd v4.6.0 or later (often packaged as bdb or sometimes db)
mysql-client OR mariadb-client mysql
sqlite3 sqlite

Required for Build Environment

In order to build netatalk from source code, the following components are required at the bare minimum.

Package Details
C compiler clang or gcc are recommended
meson v0.62.0 or later
ninja often packaged as ninja-build

Optional Features

Package Details
avahi OR mDNSresponder Zeroconf support
cmark OR cmark-gfm OR pandoc generating documentation
cracklib and cracklib dictionary password strength check in afppasswd
Kerberos V krbV UAM support
libacl ACL support
libldap LDAP support
libpam PAM support
libtirpc OR libquota Quota support
libunwind symbolized backtraces when a daemon crashes
Perl admin scripts
po4a localization of documentation
stuffit-ffi StuffIt support in nad
talloc Spotlight support
tcpwrap TCP wrapper support
UnicodeData.txt regenerating Unicode lookup tables

Optional Spotlight Backends

In order to enable more advanced Spotlight (Finder search) functionality such as content searching or metadata, install the dependencies for one of the following search backends.

LocalSearch

Package Details
bison or compatible Yacc parser
D-Bus daemon
DConf sometimes packaged as dconf-cli
GLib 2 and GIO
flex or compatible lexer
localsearch OR tracker v3.0 or later
tinysparql

Xapian

Package Details
C++ compiler clang++ or g++ are recommended
libmagic MIME type detection; sometimes packaged as file
xapian-core

Build the software

Use the meson command to compile and install Netatalk.

meson setup build                                       # configure the build
meson compile -C build                                  # build Netatalk

# Become root and install

sudo meson install -C build                             # install Netatalk

To uninstall Netatalk:

sudo ninja -C build uninstall                           # uninstall Netatalk

To test (requires the -Dwith-tests=true flag at configure time):

cd build && meson test

Configuration flags

When using Meson, to review the options which Meson chose, run:

meson configure

With additional arguments the meson setup build command can be used to configure Netatalk according to user preference. All generic options passed to this command take the form -Doption=value.

For example, to install Netatalk in a specific location:

meson setup build -Dprefix=/tmp/install

By default meson enables all Netatalk features if their dependencies are available. However, many features can be enabled or disabled at configure time.

If meson cannot find the some required dependencies at configure time then the user can also specify the path a library if it is installed in an unconventional location.

Please see meson_options.txt for full details of all Netatalk-specific options, and the Meson documentation for details of generic Meson options.

OS Specific Compilation Examples

Below are instructions on how to compile Netatalk from source for specific operating systems.

Note: Installation commands may require sudo privileges depending on your system configuration.

Alpine Linux

Install dependencies

apk add acl-dev avahi-compat-libdns_sd avahi-dev bison build-base ca-certificates cargo cracklib cracklib-dev cracklib-words cups cups-dev curl db-dev dbus-dev dconf flex file-dev gcc glib iniparser-dev krb5-dev libev-dev libgcrypt-dev libtirpc-dev libtracker linux-pam-dev localsearch mariadb-dev meson ninja openldap-dev openrc pandoc perl pkgconfig rpcsvc-proto-dev rust sqlite-dev talloc-dev tinysparql-dev valgrind xapian-core-dev

Configure

meson setup build -Dbuildtype=release -Dwith-appletalk=true -Dwith-cups-pap-backend=true -Dwith-eventloop=libev -Dwith-statedir-path=/var/lib -Dwith-stuffit=true -Dwith-tests=true -Dwith-testsuite=true

Build

meson compile -C build

Test

meson test -C build

Install

meson install -C build

Arch Linux

Install dependencies

pacman -Sy --noconfirm avahi bison cmark-gfm cracklib cups curl db dconf flex file gcc iniparser libev localsearch mariadb-clients meson ninja perl pkgconfig rpcsvc-proto rust sqlite talloc tinysparql xapian-core

Configure

meson setup build -Dbuildtype=release -Dwith-appletalk=true -Dwith-cups-pap-backend=true -Dwith-eventloop=libev -Dwith-init-hooks=true -Dwith-stuffit=true -Dwith-tests=true -Dwith-testsuite=true

Build

meson compile -C build

Test

meson test -C build

Install

meson install -C build

Debian Linux

Install dependencies

apt-get update
apt-get install --assume-yes --no-install-recommends bison cargo ca-certificates cmark-gfm cracklib-runtime curl dconf-cli file flex g++ gcc libacl1-dev libavahi-client-dev libcrack2-dev libcrypt-dev libcups2-dev libdb-dev libdbus-1-dev libev-dev libgcrypt20-dev libglib2.0-dev libiniparser-dev libkrb5-dev libldap2-dev libmagic-dev libmariadb-dev libpam0g-dev libsqlite3-dev libtalloc-dev libtirpc-dev libtracker-sparql-3.0-dev libwrap0-dev libxapian-dev make meson ninja-build quota systemtap-sdt-dev tcpd tracker tracker-miner-fs valgrind

Configure

meson setup build -Dbuildtype=release -Dwith-appletalk=true -Dwith-cups-pap-backend=true -Dwith-eventloop=libev -Dwith-init-hooks=true -Dwith-init-style=debian-sysv,systemd -Dwith-pkgconfdir-path=/etc/netatalk -Dwith-stuffit=true -Dwith-tests=true -Dwith-testsuite=true

Build

meson compile -C build

Test

meson test -C build

Install

meson install -C build

Fedora Linux

Install dependencies

dnf --setopt=install_weak_deps=False --assumeyes install avahi-devel bison cargo chkconfig cracklib-devel curl cups-devel dbus-devel dconf flex gcc-c++ glib2-devel iniparser-devel krb5-devel libacl-devel libdb-devel libev-devel file-devel libgcrypt-devel libtalloc-devel localsearch make mariadb-connector-c-devel meson ninja-build openldap-devel pam-devel pandoc perl quota-devel sqlite-devel rust systemd systemtap-sdt-devel tinysparql-devel valgrind xapian-core-devel

Configure

meson setup build -Dbuildtype=release -Dwith-appletalk=true -Dwith-cups-pap-backend=true -Dwith-eventloop=libev -Dwith-init-hooks=true -Dwith-stuffit=true -Dwith-tests=true -Dwith-testsuite=true

Build

meson compile -C build

Test

meson test -C build

Install

sudo meson install -C build

Ubuntu Linux

Install dependencies

apt-get update
apt-get install --assume-yes --no-install-recommends bison cargo ca-certificates cmark-gfm cracklib-runtime curl dconf-cli file flex g++ gcc libacl1-dev libavahi-client-dev libcrack2-dev libcups2-dev libdb-dev libdbus-1-dev libev-dev libgcrypt20-dev libglib2.0-dev libiniparser-dev libkrb5-dev libldap2-dev libmagic-dev libmariadb-dev libpam0g-dev libsqlite3-dev libtalloc-dev libtirpc-dev libtracker-sparql-3.0-dev libwrap0-dev libxapian-dev make meson ninja-build quota systemtap-sdt-dev tcpd tracker tracker-miner-fs

Configure

meson setup build -Dbuildtype=release -Dwith-appletalk=true -Dwith-cups-pap-backend=true -Dwith-eventloop=libev -Dwith-init-hooks=true -Dwith-stuffit=true -Dwith-tests=true -Dwith-testsuite=true

Build

meson compile -C build

Test

meson test -C build

Install

meson install -C build

macOS

Install dependencies

brew update
brew install berkeley-db@5 bstring cmark-gfm cracklib iniparser libev libiconv mariadb meson openldap rust talloc

Configure

export PATH="$(brew --prefix bison)/bin:$PATH"
meson setup build -Dbuildtype=release -Dwith-homebrew=true -Dwith-stuffit=true -Dwith-tests=true -Dwith-testsuite=true

Build

meson compile -C build

Test

meson test -C build

Install

sudo meson install -C build

DragonFlyBSD

Install dependencies

pkg install -y avahi curl cmark db5 gmake iniparser libev file libgcrypt meson mysql80-client openldap26-client perl5 pkgconf py39-gdbm py39-sqlite3 py39-tkinter rust sqlite talloc xapian-core
curl --proto '=https' --location --fail -o stuffit-rs.tar.gz "${{ env.STUFFIT_RS_TARBALL_URL }}"
mkdir -p /tmp/stuffit-rs
tar -xzf stuffit-rs.tar.gz -C /tmp/stuffit-rs --strip-components=1
cd /tmp/stuffit-rs
cargo build --release --locked -p stuffit-ffi
gmake -C stuffit-ffi install-files PREFIX=/usr/local

Build and install

export LD_LIBRARY_PATH=/usr/local/lib
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/libdata/pkgconfig
meson setup build -Dbuildtype=release -Dwith-appletalk=true -Dwith-eventloop=libev -Dwith-stuffit=true -Dwith-tests=true -Dwith-testsuite=true
meson compile -C build
meson test -C build
meson install -C build

FreeBSD

Install dependencies

pkg install -y avahi bison cmark curl db5 dconf flex git gmake iniparser libev file libgcrypt libsunacl localsearch meson mysql97-client openldap26-client perl5 pkgconf rust sqlite3 talloc xapian-core
curl --proto '=https' --location --fail -o stuffit-rs.tar.gz "${{ env.STUFFIT_RS_TARBALL_URL }}"
mkdir -p /tmp/stuffit-rs
tar -xzf stuffit-rs.tar.gz -C /tmp/stuffit-rs --strip-components=1
cd /tmp/stuffit-rs
cargo build --release --locked -p stuffit-ffi
gmake -C stuffit-ffi install-files PREFIX=/usr/local

Build and install

export LD_LIBRARY_PATH=/usr/local/lib
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/libdata/pkgconfig
meson setup build -Dbuildtype=release -Dpkg_config_path=/usr/local/libdata/pkgconfig -Dwith-eventloop=libev -Dwith-stuffit=true -Dwith-tests=true -Dwith-testsuite=true
meson compile -C build
meson test -C build --no-rebuild
meson install -C build --no-rebuild

FreeBSD

Install dependencies

pkg install -y avahi bison cmark curl db5 dconf flex git gmake iniparser libev file libgcrypt libsunacl localsearch meson mysql97-client openldap26-client perl5 pkgconf rust sqlite3 talloc xapian-core
curl --proto '=https' --location --fail -o stuffit-rs.tar.gz "${{ env.STUFFIT_RS_TARBALL_URL }}"
mkdir -p /tmp/stuffit-rs
tar -xzf stuffit-rs.tar.gz -C /tmp/stuffit-rs --strip-components=1
cd /tmp/stuffit-rs
cargo build --release --locked -p stuffit-ffi
gmake -C stuffit-ffi install-files PREFIX=/usr/local

Build and install

export LD_LIBRARY_PATH=/usr/local/lib
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/libdata/pkgconfig
meson setup build -Dbuildtype=release -Dpkg_config_path=/usr/local/libdata/pkgconfig -Dwith-eventloop=libev -Dwith-stuffit=true -Dwith-tests=true -Dwith-testsuite=true
meson compile -C build
meson test -C build --no-rebuild
meson install -C build --no-rebuild

NetBSD

Install dependencies

export PKG_PATH="https://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r|cut -f '1 2' -d.)/All"
pkg_add cmark curl db5 gcc13 gmake heimdal iniparser libev libgcrypt meson file mysql-client perl pkg-config rust sqlite3 talloc xapian
curl --proto '=https' --location --fail -o stuffit-rs.tar.gz "${{ env.STUFFIT_RS_TARBALL_URL }}"
mkdir -p /tmp/stuffit-rs
tar -xzf stuffit-rs.tar.gz -C /tmp/stuffit-rs --strip-components=1
cd /tmp/stuffit-rs
cargo build --release --locked -p stuffit-ffi
gmake -C stuffit-ffi install-files PREFIX=/usr/local

Build and install

export LD_LIBRARY_PATH=/usr/local/lib
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
meson setup build -Dbuildtype=release -Dwith-appletalk=true -Dwith-cups-pap-backend=true -Dwith-dtrace=false -Dwith-eventloop=libev -Dwith-stuffit=true -Dwith-tests=true -Dwith-testsuite=true
meson compile -C build
meson test -C build --no-rebuild
meson install -C build --no-rebuild

OpenBSD

Install dependencies

pkg_add -I avahi cmark curl db-4.6.21p8v0 dbus git gmake gtar-1.35p1 heimdal iniparser libev libgcrypt libmagic libtalloc mariadb-client meson openldap-client-2.6.13v0 openpam rust sqlite3 xapian-core
curl --proto '=https' --location --fail -o stuffit-rs.tar.gz "${{ env.STUFFIT_RS_TARBALL_URL }}"
mkdir -p /tmp/stuffit-rs
gtar -xzf stuffit-rs.tar.gz -C /tmp/stuffit-rs --strip-components=1
cd /tmp/stuffit-rs
cargo build --release --locked -p stuffit-ffi
gmake -C stuffit-ffi install-files PREFIX=/usr/local

Build and install

export LD_LIBRARY_PATH=/usr/local/lib
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
meson setup build -Dbuildtype=release -Dwith-eventloop=libev -Dwith-gssapi-path=/usr/local/heimdal -Dwith-kerberos-path=/usr/local/heimdal -Dwith-stuffit=true -Dwith-tests=true -Dwith-testsuite=true
meson compile -C build
meson test -C build --no-rebuild
meson install -C build --no-rebuild

OmniOS

Install dependencies

pkg install build-essential pkg-config
# This installs the SmartOS pkgsrc bootstrap, which is a self-contained pkgsrc environment
# containing a pkgin package manager and a /opt/local prefix.
# The bootstrap is used to install the required dependencies for building netatalk on OmniOS.
# This step can be skipped if the bootstrap is already installed.
curl --proto '=https' --location --fail -o bootstrap.tar.gz "${{ env.SMARTOS_BOOTSTRAP_URL }}"
bootstrap_sha256=$(digest -a sha256 bootstrap.tar.gz)
if [ "$bootstrap_sha256" != "${{ env.SMARTOS_BOOTSTRAP_SHA256 }}" ]; then
  echo "bootstrap.tar.gz SHA-256 mismatch" >&2
  exit 1
fi
tar -zxpf bootstrap.tar.gz -C /
export PATH=/opt/local/sbin:/opt/local/bin:/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin:$PATH
pkgin -y install avahi cmark dconf gmake gnome-tracker gtar-base iniparser libev file libbstring libgcrypt meson mysql-client rust sqlite3 talloc xapian
curl --proto '=https' --location --fail -o stuffit-rs.tar.gz "${{ env.STUFFIT_RS_TARBALL_URL }}"
mkdir -p /tmp/stuffit-rs
gtar -xzf stuffit-rs.tar.gz -C /tmp/stuffit-rs --strip-components=1
cd /tmp/stuffit-rs
cargo build --release --locked -p stuffit-ffi
gmake -C stuffit-ffi install-files PREFIX=/opt/local

Build and install

export PATH=/opt/local/sbin:/opt/local/bin:/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin:$PATH
export LD_LIBRARY_PATH=/opt/local/lib
export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig
meson setup build --prefix=/opt/local -Dbuildtype=release -Dpkg_config_path=/opt/local/lib/pkgconfig -Dwith-eventloop=libev -Dwith-ldap-path=/opt/local -Dwith-stuffit=true -Dwith-tests=true -Dwith-testsuite=true
meson compile -C build
meson test -C build
meson install -C build

OpenIndiana

Install dependencies

pkg install archiver/gnu-tar compress/gzip database/sqlite-3 developer/build/cmake developer/build/gnu-make developer/build/meson developer/build/ninja developer/build/pkg-config developer/cargo-c developer/gcc-14 developer/lang/rustc library/libev library/security/cracklib runtime/perl system/library/security/libgcrypt web/curl
curl --proto '=https' --location --fail -o iniparser.tar.gz "${{ env.INIPARSER_TARBALL_URL }}"
curl --proto '=https' --location --fail -o stuffit-rs.tar.gz "${{ env.STUFFIT_RS_TARBALL_URL }}"
mkdir -p /tmp/iniparser
gtar -xzf iniparser.tar.gz -C /tmp/iniparser --strip-components=1
mkdir -p /tmp/stuffit-rs
gtar -xzf stuffit-rs.tar.gz -C /tmp/stuffit-rs --strip-components=1
cd /tmp/iniparser
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local ..
make all
make install
cd /tmp/stuffit-rs
cargo build --release --locked -p stuffit-ffi
gmake -C stuffit-ffi install-files PREFIX=/usr/local

Build and install

export PATH=/opt/local/sbin:/opt/local/bin:/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin:$PATH
export LD_LIBRARY_PATH=/usr/local/lib
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/amd64/pkgconfig
meson setup build -Dbuildtype=release -Dpkg_config_path=/usr/lib/amd64/pkgconfig -Dwith-eventloop=libev -Dwith-iniparser-path=/usr/local -Dwith-stuffit=true -Dwith-tests=true -Dwith-testsuite=true
meson compile -C build
meson test -C build
meson install -C build
# Multicast DNS is a dependency of the netatalk SMF service.
svcadm enable svc:/network/dns/multicast:default

Solaris

Install dependencies

pkg install archiver/gnu-tar cmake developer/build/gnu-make developer/rust/cargo developer/rust/rustc gcc libevent libgcrypt meson ninja pkg-config sqlite-3
curl --proto '=https' --location --fail -o cmark.tar.gz "${{ env.CMARK_TARBALL_URL }}"
curl --proto '=https' --location --fail -o iniparser.tar.gz "${{ env.INIPARSER_TARBALL_URL }}"
curl --proto '=https' --location --fail -o stuffit-rs.tar.gz "${{ env.STUFFIT_RS_TARBALL_URL }}"
mkdir -p /tmp/cmark
gtar -xzf cmark.tar.gz -C /tmp/cmark --strip-components=1
mkdir -p /tmp/iniparser
gtar -xzf iniparser.tar.gz -C /tmp/iniparser --strip-components=1
mkdir -p /tmp/stuffit-rs
gtar -xzf stuffit-rs.tar.gz -C /tmp/stuffit-rs --strip-components=1
cd /tmp/cmark
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/usr
cmake --build build
cmake --install build
cd /tmp/iniparser
mkdir build
cd build
cmake ..
make all
make install
cd /tmp/stuffit-rs
cargo build --release --locked -p stuffit-ffi
gmake -C stuffit-ffi install-files PREFIX=/usr/local

Build and install

export LD_LIBRARY_PATH=/usr/local/lib
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/amd64/pkgconfig
meson setup build --prefix=/usr/local -Dbuildtype=release -Dpkg_config_path=/usr/lib/amd64/pkgconfig -Dwith-iniparser-path=/usr/local -Dwith-stuffit=true -Dwith-tests=true -Dwith-testsuite=true
meson compile -C build
meson test -C build
meson install -C build
export PATH=/usr/local/sbin:/usr/local/bin:$PATH