This article describes how to create a Time Capsule replacement for Apple Time Machine Backups using any Ubuntu 20.04 running computer. We use Ubuntu server distro for this but you should be able do this on your desktop as well.
We assume you have your Ubuntu in a working condition. We also recommend you to use one drive for the boot and another for the backup data.
Let’s get going:
sudo apt install netatalk avahi-daemon
Netatalk is a Open Source AFP (Apple Filing Protocol) fileserver. Avahi enables you to use service discovery on a local network via the mDNS/DNS-SD protocol suite. It is compatible with Apple MacOS X Bonjour / Zeroconf.
Now edit netatalk config:
sudo vi /etc/netatalk/afp.conf
Add this (you may change the path to your liking):
[TimeMachine] path = /mnt/timemachine time machine = yes
Save the file and exit (:w and :q)
Create the directory (please, match the path in the last step; if you need to mount a partition do it after the first row)
sudo mkdir -p /mnt/timemachine sudo chown nobody:nogroup /mnt/timemachine sudo chmod 777 /mnt/timemachine
The final step is to restart the netatalk service:
sudo service netatalk restart
Now, you should be able to use this network share with your Mac. Open the Time Machine settings in System Preferences and use “Select Disk…” to pick your newly created Time Machine backup share.