netatalk.io

Installing Netatalk on Debian Linux


Install the latest Netatalk

Netatalk is distributed as a deb package in all Debian releases except Debian 12 Bookworm. You can install it with apt and other package managers.

The recent release series at the time of writing, we distribute Debian deb packages built for Bookworm amd64 together with Debian releases. See the assets attached with releases on GitHub.

For building and installing from source yourself, find links to the official documentation below.

Installation

This guide was written for Netatalk 2.4.x for the legacy Autotools build system. In most cases, you want to follow the instructions in the links at the top of this page to install a later version instead.

Install dependent packages with the package manager of your choice. Some of these are mandatory to build and run netatalk; others are optional and provide additional functionality.

sudo apt install \
    autoconf \
    automake \
    docbook-xsl \
    libacl1-dev \
    libavahi-client-dev \
    libcrack2-dev \
    libcups2-dev \
    libdb-dev \
    libgcrypt-dev \
    libkrb5-dev \
    libldap2-dev \
    libltdl-dev \
    libpam0g-dev \
    libssl-dev \
    libtirpc-dev \
    libtool \
    libtool-bin \
    libwrap0-dev \
    quota \
    tcpd \
    xsltproc

Mandatory packages

Depending on your Debian version, if you don’t already have a C compiler and make installed, you may also need build-essential.

Optional packages (generally useful)

Optional packages (specialized use cases)

Description of all dependencies can be found in the Installation chapter of the Netatalk manual

Build the code

Get the latest release tarball of Netatalk 2, or clone the netatalk git repository and check out the latest bleeding-edge Netatalk 2 branch.

If you chose the latter option, you need to first bootstrap the build system with autoconf to generate the configure script.

git clone https://github.com/Netatalk/netatalk.git -b branch-netatalk-2-4 netatalk2
./bootstrap

Run the configure script with the following parameters, then compile and install the software:

./configure --enable-systemd --sysconfdir=/etc --with-uams-path=/usr/lib/netatalk
make all
sudo make install

If this process finishes without errors, you should now have the Netatalk software installed on your system. The next step is to tweak the configuration.

First off, decide on the directory(ies) that you want to share, as well as the user that you want sharing them. You will need the Linux username and password of the user to access the shared directories, and due to limitations of classic Mac OS the password cannot be longer than 8 characters.

The following example uses the a user called “pi”, a single shared directory, and a single routerless AppleTalk network without Zones.

mkdir ~/afpshare $ chmod 2775 ~/afpshare

Edit the following configuration files:

sudo pico /etc/netatalk/AppleVolumes.default

At the bottom of the file, add this line:

/home/pi/afpshare "File Server"

Tip: You can append adouble:v1 volcharset:ASCII if you are having issues with very old versions of Mac OS.

Next file to edit:

sudo pico /etc/netatalk/afpd.conf

Add this to the bottom of the file:

- -transall -uamlist uams_guest.so,uams_clrtxt.so,uams_dhx2.so -nosavepassword

You may customize the -uamlist option to disable and enable various authentication methods. For instance, remove uams_guest.so if you want to disallow guest access.

Note that the -nosavepassword is for additional security, and you may opt omit this if you’re on a private network.

If your Mac OS system is using a codepage different from MAC_ROMAN, e.g. MAC_CYRILLIC, you can specify this in -maccodepage. See the afpd.conf documentation for more info. Similarly, if your host system uses a different codepage than UTF-8, you can specify that with -unixcodepage.

For troubleshooting, append something like this:

-setuplog "default log_maxdebug /var/log/afpd.log"

See the man page for ‘afpd.conf’ for a breakdown of all of the options available.

(Optional - Netatalk will autodetect the network in most cases) Finally, edit this file:

sudo pico /etc/netatalk/atalkd.conf

Specify the interface you want Netatalk to use by adding this to the bottom of the file using eth0 as an example:

eth0

If you are running into issues connecting to your File Server, you can try to change this line to:

eth0 -phase 2 -net 0-65534 -addr 65280.163

AppleTalk Support in Kernel

In order to use AppleShare / AFP over AppleTalk (DDP) the Linux system must have an AppleTalk networking stack. Luckily, Debian’s Linux kernel comes with a module called “appletalk”, which provides this functionality. Without an AppleTalk networking stack, you will only be able to use Netatalk with TCP.

To check if your kernel has AppleTalk support, issue this command and inspect the output:

lsmod | grep appletalk

If the module isn’t detected, try launching atalkd first and try again. If atalkd errors out complaining about “Address family not supported by protocol”, you may have to try another version of Linux, or compile the Linux kernel yourself. There are guides elsewhere on this topic that you can follow.

Using Netatalk

At this point, you should be able to run the Netatalk daemons on your system.

sudo systemctl enable atalkd.service afpd.service cnid.service
sudo systemctl start atalkd.service afpd.service cnid.service

Optional services:

sudo systemctl enable papd.service timelord.service a2boot.service
sudo systemctl start papd.service timelord.service a2boot.service

This is a mirror of the Netatalk GitHub Wiki. Please visit the original page if you want to correct an error or contribute new contents.

Last updated 2024-12-09