Setting up an Ubuntu machine to act as an Apple Time Machine server is surprisingly simple. This example uses a directory on the boot drive (
/srv/netatalk/time-machine), but it’s more likely that you want to use a directory on a large disk.
Here are the steps…
Install the needed packages:
sudo apt install netatalk avahi-daemon
Edit the netatalk config file:
sudo vi /etc/netatalk/afp.conf
Add a section for your Time Machine:
[Time Machine] path = /srv/netatalk/time-machine time machine = yes
Create a directory to act as the Time Machine drive:
sudo mkdir -p /srv/netatalk/time-machine sudo chown nobody:nogroup /srv/netatalk/time-machine sudo chmod 777 /srv/netatalk/time-machine
sudo service netatalk restart
Now, on your Mac, you should be able to open the Time Machine settings in System Preferences and use Select Disk… to pick your new Time Machine backup drive.
Update for Ubuntu 20.04 and other notes
Since I first wrote this, I have updated to Ubuntu 20.04 and everything still seems to work. However, I never made it clear that you must make sure your backup drive is available and connected on your Mac before you can use it as a Time Machine backup drive.
Once your drive is set up under Ubuntu, go to your Mac and open a Finder window. Under the Network section in the sidebar, you should see your Ubuntu machine listed. Double-click on the machine name, and you should see any shared folders on the machine. You may have to click on the Connect button in the upper right of the window to login before you can use the drive.
Once you are logged in, you should then be able to use the drive with Time Machine.