Skip to content

Installing Netatalk on Ubuntu

Daniel Markstedt edited this page Aug 31, 2025 · 10 revisions

Install Netatalk

netatalk is distributed as a package in Ubuntu. You can use apt to install it.

Ex. (with root privileges)

apt install netatalk

For building and installing from source yourself, for instance to get a newer version, follow the guides linked here.

Setting Up

Edit /usr/local/etc/afp.conf.

Ex:

[Global]

[Homes]

   basedir regex = /home

[Test Volume]

   path = /export/test1

[My Time Machine Volume]

   path = /export/timemachine
   time machine = yes

It's recommended to enable extended attributes of filesystem. You can check it by getfattr and setfattr commands.

If you use ACL, you shoud check it by getfacl and setfacl commands.

If these are disabled, use tune2fs command or edit /etc/fstab file.

Ex:

/dev/sdc2    /mountpoint    ext4    defaults,user_xattr,acl    0 2

You should check firewall. AFP's port number is 548. Zeroconf's port number is 5353.

Enabling and Starting

The systemd unit file is /lib/systemd/system/netatalk.service. You must run Avahi ahead of Netatalk.

$ sudo systemctl enable avahi-daemon
$ sudo systemctl enable netatalk
$ sudo systemctl start avahi-daemon
$ sudo systemctl start netatalk

Spotlight Feature

If you use Spotlight feature, read Spotlight section in Netatalk Manual.

Set spotlight = yes.

Set spotlight = no for Time Machine's volume. The mining for sparsebundle is wasteful.

Ex:

[Global]

   spotlight = yes

[Homes]

   basedir regex = /home

[Test Volume]

   path = /export/test1

[My Time Machine Volume]

   path = /export/timemachine
   time machine = yes
   spotlight = no

A problem has been reported.

Interoperation with Samba

Recent Netatalk and Samba can store metadata in the compatible format.

Using this way, the following access becomes possible.

  • from Mac to Netatalk
  • from Mac to Samba
  • from Windows to Samba

Netatalk

Using vol preset option, the same configuration is set for all volumes.

Using ea = samba, Extended Attributes become compatible with Samba.

Edi /usr/local/etc/afp.conf.

Ex:

[Global]

   vol preset = my default values

[my default values]

   ea = samba

[Homes]

   basedir regex = /home

[Test Volume]

   path = /export/test1

[My Time Machine Volume]

   path = /export/timemachine
   time machine = yes

Samba

Setting various options in [global], the same configuration is set for all shares.

Three vfs objects (catia, fruit and streams_xattr) provide enhanced compatibility with Apple SMB clients and interoperability with a Netatalk.

Using hide files, the invisible files created via Netatalk are hidden from Windows. Use hide files, not veto files.

Don't set the time machine at both of Netatalk and Samba, otherwise advertisement by Avahi will duplicate.

Edit /etc/samba/smb.conf.

Ex:

[global]
    foo = bar
    baz = qux

    ea support = Yes
    vfs objects = catia fruit streams_xattr
    fruit:locking = netatalk
    fruit:encoding = native
    streams_xattr:prefix = user.
    streams_xattr:store_stream_type = no
    mdns name = mdns

    hide files = /.DS_Store/Network Trash Folder/TheFindByContentFolder/TheVolumeSettingsFolder/Temporary Items/.TemporaryItems/.VolumeIcon.icns/Icon?/.FBCIndex/.FBCLockFolder/

    read only = No

[homes]

[Test Volume]
    path = /export/test1

[My Time Machine Volume]
    path = /export/timemachine
    time machine = yes

Clone this wiki locally