Setting Up SMB (Samba) File Shares on Your Home Network

Set up SMB shares the whole household can use from Windows, Linux and Mac — including smb.conf settings, UFW rules and fixes for macOS disconnects.

The Goal: Universal Access Without USB Drives

I wanted a dead-simple way to drop movies, documents, and backups from Windows, Linux, and Mac laptops straight onto my server without passing USB sticks around the house. Samba (SMB) is the standard protocol for sharing folders over a local network, and once configured cleanly it mounts like a native drive letter on Windows (Z:\) or a network disk in macOS Finder.

Note

SMB shares only work reliably if your underlying hard drives mount automatically on every boot. If you haven’t set up UUID mounting with nofail yet, do that first in our first 5 things after installing Linux guide.

Step 1: Install Samba and Create a Dedicated Share Password

Install the Samba package on Ubuntu or Debian:

Terminal window
sudo apt update && sudo apt install -y samba

Samba keeps its own password database separate from your Linux login password. Add your regular Linux user (for example guillermo, UID 1000) to Samba:

Terminal window
sudo smbpasswd -a $USER

Make sure the folder you want to share is owned by that same user (1000:1000) so there are no permission clashes with Docker containers:

Terminal window
sudo chown -R $USER:$USER /mnt/2TB_drive/media

Step 2: Configure /etc/samba/smb.conf (With macOS Fixes Built In)

Back up the default configuration file first, then edit /etc/samba/smb.conf:

Terminal window
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
sudo nano /etc/samba/smb.conf

Under [global], enforce modern SMB3 encryption/protocol support and add the vfs_fruit Apple compatibility flags that prevent macOS Finder disconnects and .DS_Store headaches:

[global]
workgroup = WORKGROUP
server string = Home Server
server min protocol = SMB3
smb encrypt = desired
# Fix macOS Finder stability and speed
vfs objects = catia fruit streams_xattr
fruit:metadata = stream
fruit:model = MacSamba
fruit:posix_rename = yes
fruit:veto_appledouble = no
fruit:nfs_aces = no
fruit:wipe_intentionally_left_blank_rfork = yes
fruit:delete_empty_adfiles = yes
# Prevent .DS_Store and Windows Thumbs.db clutter inside media folders
veto files = /._*/.DS_Store/Thumbs.db/desktop.ini/
delete veto files = yes

Now add your share block at the bottom of /etc/samba/smb.conf:

[Media]
comment = Home Server Media Drive
path = /mnt/2TB_drive/media
browseable = yes
read only = no
valid users = guillermo
force user = guillermo
create mask = 0664
directory mask = 0775

Test the syntax for typos and restart Samba:

Terminal window
testparm -s
sudo systemctl restart smbd nmbd

Step 3: Lock Port 445 to Your LAN & Tailscale Only

SMB listens on TCP port 445 (see our default port lookup). Never open port 445 to the internet; restrict it in UFW strictly to your home subnet and Tailscale:

Terminal window
sudo ufw allow from 192.168.1.0/24 to any port 445 proto tcp
sudo ufw allow in on tailscale0 to any port 445 proto tcp
sudo ufw reload

(Check your router’s exact LAN subnet in our subnet calculator if your home uses 192.168.0.0/24 or 10.0.0.0/24.)

Step 4: Connect From Windows, macOS, and Linux

  • Windows 11/10: Open File Explorer, press Ctrl+L, type \\192.168.1.50\Media, and enter your Samba username and password. Right-click the share → Map network drive to give it a permanent letter like Z:\. On 1 GbE Ethernet, big copies settle around 110 MB/s (estimate copy duration in our transfer time calculator).
  • macOS: In Finder, press Cmd + K, enter smb://192.168.1.50/Media, and authenticate as a Registered User.
  • Linux desktop: Open Files/Dolphin → Connect to Server → smb://192.168.1.50/Media, or mount permanently via /etc/fstab using cifs-utils (sudo apt install -y cifs-utils). Create a root-only credentials file /etc/samba-creds (chmod 600) with username=... and password=..., then add a line in /etc/fstab:
//192.168.1.50/Media /mnt/server-media cifs credentials=/etc/samba-creds,uid=1000,gid=1000,nofail,_netdev 0 0

Notice _netdev and nofail: they tell Linux to wait for the network before mounting, and never stall boot if the home server happens to be offline.

Optional: Separate Read-Only Share for Family Members

Want your household to browse photos or movies without accidentally deleting folders? Add a second read-only share block in smb.conf pointing to the same drive (read only = yes) for a dedicated read-only user (smbpasswd -a family), while keeping your own guillermo account on the read/write share.

Access your files anywhere without opening ports

Once UFW allows port 445 on tailscale0, you can map \100.x.y.z\Media (or smb://homeserver/Media via MagicDNS) from a coffee shop or hotel exactly like at home.

Troubleshooting Common Cross-Platform SMB Issues

  • macOS Finder freezes on large folders or keeps dropping the connection: verify testparm -s shows the fruit VFS lines under [global] (not only inside one share), and make sure smbd was restarted after editing smb.conf.
  • Windows says “Multiple connections to a server or shared resource by the same user are not allowed”: Windows blocks logging into the same server IP twice with different credentials. Open Command Prompt and run net use * /delete /y, open Windows Credential Manager → Windows Credentials, remove stale entries for 192.168.1.50, and reconnect once cleanly.
  • Files uploaded over SMB can’t be modified by Docker (or vice versa): make sure force user in smb.conf matches the PUID inside your Docker Compose file (typically UID 1000). If you still have older root-owned files, run sudo chown -R 1000:1000 /mnt/2TB_drive/media.
  • Windows 11 24H2 refuses to connect with “You can’t access this shared folder because your organization’s security policies block unauthenticated guest access”: never use guest (guest ok = yes) shares — always authenticate with a real smbpasswd -a account as shown in Step 1.

Frequently Asked Questions

How fast are SMB file transfers over a home network?

Over standard 1 GbE Ethernet, SMB transfers typically sustain 105–112 MB/s (around 400 GB per hour). Over 5 GHz Wi-Fi 6, real-world speeds usually drop to 40–85 MB/s depending on walls and distance.

Is it safe to enable SMB on my home server?

Yes inside your private LAN and over Tailscale, as long as you enforce SMB3 (server min protocol = SMB3) and restrict TCP port 445 in UFW strictly to your local subnet (192.168.1.0/24) and tailscale0 — never forward port 445 on your router.

Why does macOS Finder keep disconnecting or stalling on Samba shares?

By default Samba lacks Apple's SMB2/3 AAPL extensions. Adding vfs objects = catia fruit streams_xattr and fruit:metadata = stream under [global] in smb.conf makes Finder fast, stable, and prevents duplicate AppleDouble clutter.

Can Docker containers and SMB share the exact same folder?

Yes. Set force user = your_linux_user in smb.conf and align PUID/PGID in Docker to that same user's UID/GID (usually 1000:1000) so files dropped from Windows or Mac are immediately readable by Jellyfin or Nextcloud.

Portrait of Guillermo

Written by Guillermo

IT Student & Home Server Enthusiast

Building private clouds to break free from Big Tech. I document everything I learn about home servers and self-hosting on MyHomeServerGuide.

More about the author