Time Machine with netatalk and Linux

By | 2010/10/30

How can I make a networked or remote Time Machine on a Linux server?

You can use netatalk on your Linux server of choice to act as a networked Time Machine for OS X!

I’ll show you how to set this up on CentOS, though this can work on any various Linux distro.

1. Make sure these are installed:

$ yum install libgcrypt-devel openssl-devel gcc make automake

2. Download Berkeley DB 4.8.30:

Note: As of netatalk 2.1.3 Berkeley DB 5.x is supported, though it’s somewhat of pain to download latest releases from the Oracle website.


3. Compile the Berkeley DB as follows:

cd db-4.8.30.NC/build_unix
../dist/configure –prefix=/usr/local/db-4.8.30 && make -j 2 && make install

4. Fetch and install Netatalk:


cd netatalk-2.1.4
./configure –enable-redhat –with-bdb=/usr/local/db-4.8.30 –prefix=/usr/local/netatalk-2.1.4 –with-mutex=x86/gcc-assembly && make -j 2 && make install

5. Once all is installed, edit these two netatalk config files:



My afpd.conf looks like this:

– -transall -uamlist uams_dhx.so,uams_dhx2_passwd.so -setuplog “default log_info /var/log/netatalk.log”

My AppleVolumes.default looks like this, giving me a 200GB time machine (make sure to use option ‘tm’ either in the default line, or your specific share configuration):

# The line below sets some DEFAULT, starting with Netatalk 2.1.
: DEFAULT: options:upriv,usedots,tm dperm:0775 fperm:0660

/home/scott/bkup “Time Machine” allow:scott volsizelimit:200000

# The “~” below indicates that Home directories are visible by default.
# If you do not wish to have people accessing their Home directories,
# please put a pound sign in front of the tilde or delete it.

6. Finally, set netatalk to run at boot:

chkconfig netatalk on

Now that netatalk is up and running, on the OS X side you must first mount the afp share.

Press Apple + K from the Finder and input your server’s url or ip address as afp://yourserver.com.
(Username / password to connect are the local Centos user account username / password.)


Now go to the Time Machine preferences and select this networked afp share as your Time Machine.


Then wait for Time Machine to do its thing. As normal, the first backup can take a long time.



Credit: Adapted from this post.

2 thoughts on “Time Machine with netatalk and Linux

  1. imcaptor

    I use redhat must add this option when build bdb.



Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.