Chapter 2. Installation

Table of Contents

How to obtain Netatalk
Binary packages
Source packages
Compiling Netatalk
Compiling Netatalk
Compiling a new Berkeley DB for Netatalk


If you have previously used an older version of Netatalk, please read the chapter about upgrading first !!!

How to obtain Netatalk

Please have a look at the netatalk page on sourceforge for the most recent informations on this issue.

Binary packages

Binary packages of Netatalk are included in some Linux and UNIX distributions. You might want to have a look at the usual locations, too (,,, etc.)

Source packages


Prepacked tarballs in .tar.gz and tar.bz2 format are available on the netatalk page on sourceforge

Read-only Git

Downloading the Git repository can be done quickly and easily.

  1. Make sure you have Git installed. which git should produce a path to git.

    $> which git
  2. If you don't have one make a source directory. cd to this directory.

    $> mkdir /path/to/new/source/dir
    $> cd /path/to/new/source/dir
  3. Now get the source:

    $> git clone git://
    Initialized empty Git repository in /path/to/new/source/dir/netatalk/.git/
    remote: Counting objects: 2503, done.

    This will create a local directory called "netatalk" containing a complete and fresh copy of the whole Netatalk source from the Git repository.

  4. In order to keep your repository copy updated, occasionally run:

    $> git pull
  5. Now cd to the netatalk directory and run ./bootstrap. This will create the configure script required in the next step.

    $> ./bootstrap

Compiling Netatalk


System requirements

Your system needs to meet the following requirements:

  • A C compiler, Netatalk compiles fine with gcc > 2.7.95

To be able to compile with AFP3 support, your system has to support large files (>2GB).


On linux systems glibc > 2.2 is required.

Required third party software

Netatalk makes use of sleepycats' Berkeley DB. At the time of writing, the following versions are supported:

  • mimimum 4.6.x

In case Berkeley DB is not installed on your system, please download it from:

and follow the installation instructions.

Optional third party software

Netatalk can use the following third party software to enhance it's functionality.

  • OpenSSL or libgcrypt (recommended)

    Required for encrypted passwords. Without it, the password will be sent over the network in clear text. OpenSSL is needed for the older DHCAST128, libgcrypt is needed for DHX2.

    OpenSSL can be downloaded from:

    libgcrypt can be downloaded from:

  • TCP wrappers

    Wietse Venema's network logger, also known as TCPD or LOG_TCP.

    Security options are: access control per host, domain and/or service; detection of host name spoofing or host address spoofing; booby traps to implement an early-warning system.

    TCP Wrappers can be downloaded from:

  • PAM

    PAM provides a flexible mechanism for authenticating users. PAM was invented by SUN Microsystems. Linux-PAM is a suite of shared libraries that enable the local system administrator to choose how applications authenticate users.

    You can get the Linux PAM documentation and sources from

  • OpenSLP

    SLP (Service Location Protocol) is an IETF standards track protocol that provides a framework to allow networking applications to discover the existence, location, and configuration of networked services in enterprise networks.

    Mac OS X 10.4 and earlier uses it to locate AFP servers, even though 10.2 and later prefer Bonjour.

    You can download OpenSLP from:

  • iconv

    iconv provides conversion routines for many character encodings. Netatalk uses it to provide charsets it does not have built in conversions for, like ISO-8859-1. On glibc systems, Netatalk can use the glibc provided iconv implementation. Otherwise you can use the GNU libiconv implementation.

    You can download GNU libiconv from:

Compiling Netatalk

Configuring the build

To build the binaries, first run the program ./configure in the source directory. This should automatically configure Netatalk for your operating system. If you have unusual needs, then you may wish to run

$> ./configure --help

to see what special options you can enable.

The most used configure options are:

  • --enable-[redhat/suse/cobalt/netbsd/fhs]

    This option helps netatalk to determine where to install the start scripts.

  • --with-bdb=/path/to/bdb/installation/

    In case you installed Berkeley DB in a non-standard location, you will have to give the install location to netatalk, using this switch.

Now run configure with any options you need

$> ./configure [arguments] [--with-bdb=/bdb/install/path]

Configure will end up in an overview showing the settings the Netatalk Makefiles have been created with.

If this step fails please visit the troubleshooting guide.


With recent RedHat releases, Berkeley DB links to libpthread. Netatalk does not link to libpthread, so detection of Berkeley DB fails when running configure. It's recommended to (re)compile Berkeley DB with --with-mutex="x86/gcc-assembly" (on x86 platforms) to disable the use of libpthread. Alternatively you could use

$> LIBS="-lpthread" ./configure [arguments]

to trick Netatalk into linking to libpthread. However, this is not recommended, as there have been some trouble reports indicating that linking to libpthread badly damages performance.

Next, running

$> make

should produce the Netatalk binaries (this step can take several minutes to complete).

When the process finished you can use

$> make install

to install the binaries and documentation (must be done as "root" when using default locations).

Compiling a new Berkeley DB for Netatalk

Netatalk 2.1 requires Berkeley DB version 4.6 or newer. Even if you already have a supported version of Berkeley DB installed on your system, there are several reasons, why you might still want to consider building a new version for Netatalk.

Many linux distributions provide a precompiled Berkeley DB version. This is usually nice, but also has one major drawback: If you update your system to a newer release, the installed version of Berkeley DB may change. This can lead to a number of problems, starting with strange behaviour of Netatalk, unreadable CNID Databases. Most likely Netatalk(afpd) won't start anymore, so you'll have to recompile Netatalk.

For instructions compiling Berkeley DB, you should generally refer to the documentation provided by Sleepycat. The following information is meant to help you avoid problems, users experienced in the past.

In case you are building on a recent RedHat release, please use --with-mutex="x86/gcc-assembly" on x86 platforms to prevent Berkeley DB from linking against libpthread.

Using a statically linked Berkeley DB

To link Netatalk statically to Berkeley DB, you have to disable shared libraries when building Berkeley DB. If shared libraries exist, Netatalk will always link to them, even if a static version exists in the same location.

root# cd build_unix
root# ../dist/configure --prefix=/install/path --disable-shared
root# make
root# make install

You should now continue with building Netatalk.

Using a dynamically linked Berkeley DB

Building a shared version of Berkeley DB is rather straightforward. However, especially under Linux, some care needs to be taken. Underlying system libraries, i.e. libnss_db, might be using Berkeley DB as well. As these libraries have likely been build with another, i.e. older, version of Berkeley DB, linking afpd to a newer version can lead to unexpected results.

You need to configure Berkeley DB with the --with-uniquename configure switch to avoid these kind of problems. This insures your new version will not interfere with another installation of Berkeley DB on your system.

root# cd build_unix
root# ../dist/configure --prefix=/install/path --with-uniquename
root# make
root# make install

If you select an install path other than /usr/local, you will have to configure your linker to look for libraries in this directory.

On many operating systems, this is done by adding a new entry to /etc/

root# echo /install/path/lib >/etc/
root# ldconfig

You should now continue with building Netatalk.