Yes, it can. (I've been doing this for years.)

Types of disks you can use with Time Machine on Mac

On network volumes, TM backups are stored as sparsebundles.

Samba v4.8 or higher, has to be configured with macOS extensions, plus the share has to be configured for Time Machine.

Configure Samba to Work Better with Mac OS X

Depending on the host system, there might be a GUI (Synology DSM), otherwise Samba's smb.conf needs to be modified accordingly.

Answer from user302097 on Stack Exchange
Top answer
1 of 4
5

Yes, it can. (I've been doing this for years.)

Types of disks you can use with Time Machine on Mac

On network volumes, TM backups are stored as sparsebundles.

Samba v4.8 or higher, has to be configured with macOS extensions, plus the share has to be configured for Time Machine.

Configure Samba to Work Better with Mac OS X

Depending on the host system, there might be a GUI (Synology DSM), otherwise Samba's smb.conf needs to be modified accordingly.

2 of 4
1

Starting with macOS Tahoe, the AFS protocol for Time Machine is no longer accepted. One must use Samba with modern macOS for a homemade Time Machine.

At the time of writing, Tahoe is the latest macOS.

  1. Install samba. Make a group smbgroup and add a new user intended to only be used with the Samba connection:

    • sudo groupadd smbgroup
    • sudo useradd -M -s /usr/sbin/nologin timemachine
    • sudo usermod -aG smbgroup timemachine
  2. Set that new user's Samba password with smbpasswd and enable the account:

    • sudo smbpasswd -a timemachine
    • sudo smbpasswd -e timemachine
  3. Set up ACL support

    • sudo apt install acl (or equivalent for your package manager if not using a Debian-based distro)
  4. Create the Time Machine directory. I keep it in /srv as it's the idiomatic place to keep it on Linux.

    • sudo mkdir -p /srv/timemachine
    • sudo chown timemachine:smbgroup /srv/timemachine
    • sudo chmod 2770 /srv/timemachine
    • We use 2770 rather than 770 because the 2 (setgid bit) ensures new files are owned by smbgroup.
  5. Add ACLs

    • sudo setfacl -m group:smbgroup:rwx /srv/timemachine
    • sudo setfacl -d -m group:smbgroup:rwx /srv/timemachine

There are several guides on how to configure smb.conf correctly for Time Machine. I will share my config below, just in case it helps. This is on Debian 13 and only serves macOS clients on Sequoia and Tahoe. I don't use Avahi/Zeroconf because the server remains connected around the clock without any issues.

[global]
   server role = standalone server
   workgroup = WORKGROUP
   netbios name = fileserver
   security = user

   log file = /var/log/samba/log.%m
   max log size = 1000

   server min protocol = SMB3
   client signing = required

   obey pam restrictions = yes
   pam password change = yes
   unix password sync = yes

   inherit acls = yes
   map to guest = Bad User

   vfs objects = catia fruit streams_xattr
   fruit:metadata = stream
   fruit:resource = stream

[TimeMachine]
   path = /srv/time-machine
   browsable = yes
   read only = no
   guest ok = no
   valid users = @smbgroup
   vfs objects = catia fruit streams_xattr
   fruit:time machine = yes
   fruit:model = TimeCapsule
   fruit:metadata = stream
   create mask = 0660
   directory mask = 0770

Pro Tip: If making a fresh partition for Time Machine use, XFS is recommended more so than EXT4, because XFS is not susceptible to issues that could arise with an EXT4 FS, especially on larger drives. Basically, each file creates an inode for its metadata, but you have a limited number of inodes in ext4, whereas this isn't a problem that exists in XFS. This matters because Time Machine creates many very small files, so it would be possible to run out of inodes. This is what -T news exists for (the term is from news servers would would have many small text files). Formatting ext4 with -T news gives you more inodes if XFS isn't an option, so if you must use ext4, it would be recommended to format it with the news flag.

Discussions

Any Way to use a SMB Server for Time Machine?
My ReadyNAS system has the TimeMachine backup option in its configuration. Under the hood, the ReadyNAS system is a version of Debian Linux, so there’s probably some package that may make it show up as a TimeMachine backup rather than just a Windows share. More on reddit.com
🌐 r/MacOS
5
6
July 9, 2021
Samba functions but unable to use it as a MacOS Time Machine destination | The FreeBSD Forums
This user has been configured as a samba user (sambapasswd -a timemachine). The target /data/timemachine is a zfs dataset with compression=lz4 and quota=2TB, and otherwise default properties. The directory is user- and group-owned by timemachine. drwx------ 2 timemachine timemachine 3 Apr 17 10:54 /data/timemachine/ Permissions on the directory have been tested at 0700 and 0777 with no change in results. On my macbook, in Finder I'm able to see the Time Machine share ... More on forums.freebsd.org
🌐 forums.freebsd.org
April 17, 2021
Backing Up macOS via Time Machine to a network SMB share

you can also use a synology device: https://www.synology.com/en-uk/knowledgebase/DSM/tutorial/Backup_Restore/How_to_back_up_files_from_Mac_to_Synology_NAS_with_Time_Machine

More on reddit.com
🌐 r/macsysadmin
17
16
December 5, 2018
Issues with TimeMachine / Samba on MacOS 13.2 Ventura
Similar set up, similar issues after upgrading to 13.2. Multiple other posts in this r/ with other's impacted in similar fashions (plain old "not Time Machine" SMB file sharing appears to have issues as well). Consensus is that a software defect that was introduced in 13.2 that's rendered SMB unusable. Hoping to see a 13.2.1 update to address this quickly. More on reddit.com
🌐 r/MacOS
13
2
January 30, 2023
🌐
Stefan Johner
blog.jhnr.ch › 2023 › 01 › 09 › setup-apple-time-machine-network-drive-with-samba-on-ubuntu-22.04
Setup Apple Time Machine network drive with Samba on Ubuntu 22.04 - Stefan Johner
January 9, 2023 - During christmas vacations I added a Time Machine network drive for the backup of my MacBook to my Ubuntu 22.04 based home server. For this you will need samba and avahi-daemon packages. Basically Samba shares the network drive and avahi makes ...
🌐
Al4
blog.al4.co.nz › 2024 › 04 › samba-config-for-apple-time-machine
Samba config for Apple Time Machine | Al4
April 4, 2024 - In /etc/samba/smb.conf under the [global] section, I have the following (not complete config, just the relevant settings): protocol=SMB3 vfs objects = acl_xattr fruit streams_xattr aio_pthread fruit:aapl = yes fruit:model = MacSamba fruit:posix_rename = yes fruit:metadata = stream fruit:nfs_aces = no recycle:keeptree = no oplocks = yes locking = yes ... I believe SMB3 is required – Time Machine struggles with older protocols.
🌐
Sarah Robin
sarah-robin.com › blog › ultimate-guide-samba-time-machine-backups
Ultimate Guide to Configuring Samba for Time Machine Backups on Debian Servers | Blog | Sarah Robin
November 1, 2024 - This setup allows Time Machine to recognize the share and store backups here. Samba’s support for fruit:time machine = yes eliminates the need for creating sparsebundles, as each macOS device will automatically create its own bundle within the share.
🌐
SambaWiki
wiki.samba.org › index.php › Configure_Samba_to_Work_Better_with_Mac_OS_X
Configure Samba to Work Better with Mac OS X - SambaWiki
December 1, 2025 - [Global] vfs objects = fruit ... yes [TimeMachineBackup] fruit:time machine = yes # fruit:time machine max size = SIZE · Beware! This configures VFS objects in the global section, setting vfs objects in a share will *overwrite* the globally configured option, it will NOT ...
🌐
FreeBSD Foundation
freebsdfoundation.org › home › written › samba-based time machine backups
Samba-based Time Machine Backups | FreeBSD Foundation
September 6, 2024 - Samba-based Time Machine Backups # zfs create -o refquota=500g -o refreservation=500g backup/timemachine/tim The two of them will never be able to log into my backup server (they don’t care anyway), but they still need to have a user on the system to mount the storage for Time Machine.
Find elsewhere
Top answer
1 of 2
2

I encountered the same issue, having my Mac refusing to create the initial sparse bundle files on my samba server. After incorporating the hints on https://wiki.samba.org/index.php/Configure_Samba_to_Work_Better_with_Mac_OS_X it finally started the backup.

Although I can only assume, the following comment caught my attention: How to store OS X metadata: fruit:metadata = stream

You could try switching from netatalk to stream. Maybe using netatalk prevents time machine from storing its metadata.

Good luck, Kay

2 of 2
2

Thought I'd post some additional info for people. My currently working smb.conf is as follows. Adding fruit:metadata = stream worked for only a short while for me, so below are the results of hours of additional testing.

Note this is on Debian 10 (Buster) so things like password change command will be different on other distributions. Also note that the order of modules in the setting vfs objects = catia fruit streams_xattr is significant and important.

# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic 
# errors. 
[global]
   workgroup = WORKGROUP
   min protocol = SMB2


   log file = /var/log/samba/log.%m
   max log size = 5000
   logging = file
   security = USER
   
   panic action = /usr/share/samba/panic-action %d

   server role = standalone server
   obey pam restrictions = yes
   unix password sync = yes

   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
   pam password change = yes
   username map = /etc/samba/users.map
   map to guest = bad user
   guest account = XXXYOURGUESTACCOUNT

# Time Machine settings
   vfs objects = catia fruit streams_xattr
   fruit:model = RackMac
   fruit:advertise_fullsync = true
   fruit:metadata = stream
   fruit:veto_appledouble = no
#default is yes, not necessary to specify fruit:posix_rename = no
#default is yes, not necessary to specify fruit:zero_file_id = yes
   fruit:wipe_intentionally_left_blank_rfork = yes
   fruit:delete_empty_adfiles = yes
   ea support = yes


#default is yes, not necessary to specify   fruit:aapl = yes

   # Make share visible to Windows
#Disabled for a Mac-Only network
#   lanman auth = no
#   ntlm auth = yes
#   wins support = yes
#   local master = yes
#   preferred master = yes

   # Allow symlinks
#   follow symlinks = yes
#   wide links = yes
#   unix extensions = no

#======================= Share Definitions =======================
[SHARED DRIVE]

   path = /PATH/TO/YOUR/SHARED/FOLDER
   valid users = @YOURGUESTUSERGROUP
   writable = yes
   durable handles = yes
   kernel oplocks = no
   kernel share modes = no
   posix locking = no
   vfs objects = catia fruit streams_xattr
#default is yes, not necessary to specify   ea support = yes
#default is yes, not necessary to specify browseable = yes
   read only = no
   inherit acls = yes
   fruit:time machine = yes
   fruit:metadata = stream
   fruit:locking = netatalk
   guest ok = yes

[Time Machine]
   path = /PATH/TO/YOUR/SHARED/FOLDER
   valid users = @YOURGUESTUSERGROUP
   writable = yes
   durable handles = yes
   kernel oplocks = no
   kernel share modes = no
   posix locking = no
   vfs objects = catia fruit streams_xattr
#default is yes, not necessary to specify   ea support = yes
   browseable = no
   read only = no
   inherit acls = yes
   fruit:time machine = yes
   fruit:metadata = stream
   fruit:locking = netatalk
   fruit:time machine max size = 1.9T

**EDIT: Turns out Samba 4.9 on Debian 10 DOES automatically advertise TimeMachine destinations, as long as there are no Samba-related advertisements in /etc/avahi/services. My system wasn't advertising the TimeMachine share because I also had a manual smb share setup for avahi. When I disabled BOTH, Samba properly advertised both.

*** OLD SEE ABOVE Also note that The Samba build with Debian 10 currently does not have built-in support for advertising Time Machine shares. Normally specifying fruit:time machine = yes will trigger Samba to advertise a Time Machine destination via Avahi, but this specific support is not built with the Samba included in Debian 10. You'll need to configure a .service definition in /etc/avahi/services/. I created time_machine_advert.service in that folder. You'll need to restart avahi to be sure it gets applied with sudo systemctl restart avahi. I have two Time Machine destinations. Multiples can be advertised within a single file by simply duplicating the txt record and incrementing dkX, i.e. dk1, dk2 etc.

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
 <name replace-wildcards="yes">%h</name>
 <service>
   <type>_adisk._tcp</type>
   <txt-record>sys=waMa=0,adVF=0x100</txt-record>
   <txt-record>dk0=adVN=SAMBA SHARE NAME EXACTLY,adVF=0x82</txt-record>
   <txt-record>dk1=adVN=SAMBA SHARE NAME #2 EXACTLY,adVF=0x82</txt-record>
 </service>
  <service>
    <type>_smb._tcp</type>
    <port>445</port>
  </service>
</service-group>

There are some additional useful sites for Samba configuration with regards to Time Machine here:

Samba team's official guide to Time Machine configuration, although this alone didn't get a working config for me: https://wiki.samba.org/index.php/Configure_Samba_to_Work_Better_with_Mac_OS_X

smb.conf reference: https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html

vfs_fruit (the Apple compatibility module for Samba) reference https://www.samba.org/samba/docs/current/man-html/vfs_fruit.8.html

Ken Murphy's smb.conf on GitHub that finally pushed me over the edge and got my setup working: https://github.com/KenMurphy/SambaConfigs/blob/master/smb.conf

A general Samba on Debian guide: https://www.antoneliasson.se/journal/time-machine-compatible-samba-on-debian-buster/

🌐
Jpatrickfulton
jpatrickfulton.dev › blog › 2023-06-23-samba-and-timemachine
Samba and macOS Time Machine - jpatrickfulton.dev
October 3, 2023 - Add the following to the end of the file to create a dedicated share for time machine backups: ... [backupshare] comment = Apple Backup Shared Folder path = /mnt/samba/applebackups fruit:time machine = yesforce user = smbuser force group = smbgroup read only = no browseable = yes create mask = 0664 force create mode = 0664 directory mask = 0775 force directory mode = 0775
🌐
GitHub
github.com › danielewood › misc › blob › master › Samba-TimeMachine.md
misc/Samba-TimeMachine.md at master · danielewood/misc
Recently Samba and in turn FreeNAS have added support for a Samba share to act as a SMB based Time Machine Target for Apple devices. We had a need for allowing multiple users to backup to a Time Machine Target but didn’t want them to have to enable encryption with a password they may forget ...
Author   danielewood
🌐
OneUptime
oneuptime.com › home › blog › how to configure samba for macos time machine backups on ubuntu
How to Configure Samba for macOS Time Machine Backups on Ubuntu
March 2, 2026 - [global] # Basic server settings workgroup = WORKGROUP server string = Ubuntu Backup Server server role = standalone server # Enable Apple Extensions for Time Machine support fruit:metadata = stream fruit:model = MacSamba fruit:veto_appledouble = no fruit:wipe_intentionally_left_blank_rfork = yes fruit:delete_empty_adfiles = yes # Security settings security = user encrypt passwords = yes passdb backend = tdbsam # Logging log file = /var/log/samba/log.%m max log size = 1000 logging = file [TimeMachine] # Share path - adjust to your backup directory path = /mnt/backup/timemachine valid users = t
🌐
Oh Ok
ohok.org › home › how to use any smb share for time machine backups
How to use any SMB share for Time Machine backups - oh, ok.
July 21, 2025 - For that, launch the Automator App and build this simple workflow: Get Specified Servers (add the SMB share root) -> Connect to Servers | (ignore input) | Get Specified Finder Items (add the Time Machine File) -> Open Finder Items.
🌐
Manjaro
manjaro.site › home › how to configure time machine to backup to samba shared folder
How to Configure Time Machine to Backup to Samba Shared Folder - Manjaro dot site
December 25, 2020 - It comes with every macOS installation and actually it works very well. As a Hackintosh user, I do not like how the Time Machine save the backup. By default it does not supports Windows shared folder or samba share.
🌐
Alihomafar
alihomafar.com › blog › 2019 › 04 › samba-timemachine-backup
Remote Time Machine Backups with Samba Mini-guide / Ali Homafar
April 16, 2019 - [timemachine] comment = Time Machine path = /data/backup/timemachine browseable = yes writeable = yes create mask = 0600 directory mask = 0700 vfs objects = catia fruit streams_xattr fruit:aapl = yes fruit:time machine = yes · Note that we are taking advantage of the vfs_fruit module. Fedora builds this module for us. For this network share to be reachable we will need to open ports for Samba and Avahi (Avahi is mDNS/zeroconf.
🌐
Blackhats
fy.blackhats.net.au › blog › 2021-03-22-time-machine-on-samba-with-zfs
Time Machine on Samba with ZFS - Firstyear's blog-a-log
In smb.conf you define the share that exposes the timemachine backup location. You need to set additional metadata on this so that macos will recognise it correctly. [global] min protocol = SMB2 ea support = yes # This needs to be global else time machine ops can fail.
🌐
Reddit
reddit.com › r/macos › any way to use a smb server for time machine?
r/MacOS on Reddit: Any Way to use a SMB Server for Time Machine?
July 9, 2021 -

I have a 27" iMac (2020) and want to back it up with Time Machine. Recently I set up a NAS using a Raspberry Pi 4 and a 6TB WD Elements External HDD. Now I want to use this NAS as a Backup Server with Time Machine.

If I remember correctly, you create a TimeMachine Sparsebundle, mount it and set it as destination using "tmutil" in the Terminal. But every time I have done this, after a Week it would say to me that it needs to create a new Backup to enhance reliability or something.

So, my question is what I am doing wrong and if there is any way to prevent the Backup from corrupting?

🌐
Son of Sun Tzu blog
blog.sonofsuntzu.org.uk › posts › how to configure a samba server to accept time machine backups
How to configure a Samba server to accept Time Machine backups | Son of Sun Tzu blog
July 20, 2025 - You can configure a Samba server, running from a Linux system ( Debian bookworm in my case ), so that a macOS system will put your Time Machine backups on its shares.
🌐
FreeBSD
forums.freebsd.org › server and networking › web and network services
Samba functions but unable to use it as a MacOS Time Machine destination | The FreeBSD Forums
April 17, 2021 - This user has been configured as a samba user (sambapasswd -a timemachine). The target /data/timemachine is a zfs dataset with compression=lz4 and quota=2TB, and otherwise default properties. The directory is user- and group-owned by timemachine. drwx------ 2 timemachine timemachine 3 Apr 17 10:54 /data/timemachine/ Permissions on the directory have been tested at 0700 and 0777 with no change in results. On my macbook, in Finder I'm able to see the Time Machine share being broadcast like expected.
🌐
Antoneliasson
antoneliasson.se › journal › time-machine-compatible-samba-on-debian-buster
Configuring Time Machine compatible Samba shares on Debian 10 Buster
May 3, 2025 - We are not done yet. For Time Machine to accept an SMB share as a valid target a few Apple specific protocol extensions need to be enabled. These are needed to support alternate data streams (e.g. Apple resource forks) and are implemented in the Samba VFS module fruit.