This article contains affiliate links. If you purchase through our links, we may earn a commission at no extra cost to you. We only recommend products we’ve thoroughly researched and verified.

Samba makes a mini PC accessible as a network drive from any device on your home network. Once configured, Windows sees it as a mapped drive, macOS accesses it from Finder’s network sidebar, and Linux mounts it via SMB — all without any special client software. This guide sets up a Samba server on Ubuntu 24.04 with user authentication, multiple shares, and macOS Time Machine support.
What you need:
- A mini PC running Ubuntu Server 24.04 LTS
- External USB HDD or the mini PC’s NVMe drive for storage
Step 1: Attach and Mount Storage
External USB HDD
Plug in the external drive and find its device path:
lsblk
# Find the new disk — often /dev/sda or /dev/sdb
# SIZE column confirms which is which
# Check current filesystem
sudo blkid /dev/sda
Create a mount point and mount the drive:
sudo mkdir -p /mnt/nas
# If the drive already has a filesystem (ext4, NTFS, etc.):
sudo mount /dev/sda1 /mnt/nas
# If this is a new drive — format to ext4 first:
sudo mkfs.ext4 /dev/sda1
sudo mount /dev/sda1 /mnt/nas
Make the mount permanent by adding to /etc/fstab:
# Get the UUID of the drive
sudo blkid /dev/sda1
# Example output: /dev/sda1: UUID="a1b2c3d4-e5f6-7890-abcd-ef1234567890" TYPE="ext4"
sudo nano /etc/fstab
# Add this line:
UUID=a1b2c3d4-e5f6-7890-abcd-ef1234567890 /mnt/nas ext4 defaults,nofail 0 2
The nofail option prevents boot failure if the drive is disconnected.
Test the fstab entry:
sudo mount -a # Mounts everything in fstab
df -h /mnt/nas # Verify the mount is active
Step 2: Create Share Directories
# Media share — for Plex/Jellyfin and general media
sudo mkdir -p /mnt/nas/{media,documents,backup,timemachine}
# Set permissions — readable by everyone, writable by the owner
sudo chmod 2775 /mnt/nas/media
sudo chmod 2770 /mnt/nas/documents
sudo chmod 2770 /mnt/nas/backup
sudo chmod 2770 /mnt/nas/timemachine
Step 3: Create Samba Users
Samba uses its own user database — your Linux user exists separately. Create a dedicated Samba user:
# Create a Linux system user for Samba (no login shell)
sudo useradd -M -s /sbin/nologin sambauser
# Set the Samba password for this user
sudo smbpasswd -a sambauser
# Enter and confirm password when prompted
# Enable the account
sudo smbpasswd -e sambauser
Set ownership of restricted directories to this user:
sudo chown -R sambauser:sambauser /mnt/nas/documents /mnt/nas/backup /mnt/nas/timemachine
Step 4: Install and Configure Samba
sudo apt update
sudo apt install -y samba samba-vfs-modules
# Verify Samba version
smbd --version
Back up the default config and create a clean one:
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.backup
sudo nano /etc/samba/smb.conf
[global]
workgroup = WORKGROUP
server string = Mini PC NAS
server role = standalone server
log file = /var/log/samba/log.%m
max log size = 50
logging = file
panic action = /usr/share/samba/panic-action %d
# Security
security = user
passdb backend = tdbsam
map to guest = Bad Password
# Performance
socket options = TCP_NODELAY IPTOS_LOWDELAY
use sendfile = yes
# macOS compatibility
fruit:model = MacPro7,1
fruit:advertise_fullsync = true
# ─── Public Media Share ───────────────────────────────────────────────────────
# Anyone on the local network can read; sambauser can write
[Media]
comment = Media Library
path = /mnt/nas/media
browseable = yes
read only = no
guest ok = yes
write list = sambauser
create mask = 0664
directory mask = 0775
force user = sambauser
force group = sambauser
# ─── Private Documents Share ─────────────────────────────────────────────────
# Authentication required — sambauser only
[Documents]
comment = Private Documents
path = /mnt/nas/documents
browseable = yes
read only = no
valid users = sambauser
create mask = 0660
directory mask = 0770
# ─── Backup Share ────────────────────────────────────────────────────────────
# Authentication required — for remote backups
[Backup]
comment = Backup Storage
path = /mnt/nas/backup
browseable = no # Hidden from network browse — access by direct path
read only = no
valid users = sambauser
create mask = 0660
directory mask = 0770
# ─── Time Machine Share (macOS) ──────────────────────────────────────────────
[TimeMachine]
comment = Time Machine Backup
path = /mnt/nas/timemachine
browseable = yes
read only = no
valid users = sambauser
create mask = 0660
directory mask = 0770
# macOS Time Machine magic
vfs objects = catia fruit streams_xattr
fruit:time machine = yes
fruit:time machine max size = 500G
Validate the configuration:
testparm
# Should output "Loaded services file OK." with no errors
Step 5: Start Samba Services
sudo systemctl enable smbd nmbd
sudo systemctl start smbd nmbd
# Verify both are running
sudo systemctl status smbd nmbd
Allow Samba through UFW if the firewall is enabled:
sudo ufw allow samba
sudo ufw status # Verify
Step 6: Access Your Samba Shares
From Windows
Open File Explorer → type in the address bar: \\192.168.1.100
Windows shows all browseable shares. Double-click a share. For password-protected shares, enter sambauser and the Samba password when prompted.
Map as a drive letter for persistent access:
- Right-click This PC → Map Network Drive
- Choose a drive letter
- Folder:
\\192.168.1.100\Documents - Check “Reconnect at sign-in”
- Enter credentials when prompted
From macOS
In Finder → Go → Connect to Server ⌘K:
smb://192.168.1.100
Select the share and mount. For authentication required shares, enter sambauser credentials.
Set up Time Machine:
- System Settings → Time Machine
- Add Backup Disk → select your mini PC → select TimeMachine share
- Authenticate with sambauser credentials
- Time Machine begins its first backup
From Linux
# Mount via command line
sudo apt install -y cifs-utils
sudo mkdir -p /mnt/nas-remote
sudo mount -t cifs //192.168.1.100/Media /mnt/nas-remote \
-o username=sambauser,password=yourpassword,uid=1000,gid=1000
# Or add to /etc/fstab for permanent mount:
//192.168.1.100/Documents /mnt/nas-docs cifs credentials=/home/user/.smb-creds,uid=1000,gid=1000,nofail 0 0
# Create credentials file:
echo "username=sambauser" > ~/.smb-creds
echo "password=yourpassword" >> ~/.smb-creds
chmod 600 ~/.smb-creds
Performance Tuning
For large file transfers 4K media, backups, add these to [global]:
# Buffer sizes — increase for large file transfers
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=131072 SO_SNDBUF=131072
read raw = yes
write raw = yes
max xmit = 65535
dead time = 15
# Async I/O
aio read size = 16384
aio write size = 16384
With a 2.5GbE network, expect 200-280 MB/s sustained throughput from an NVMe drive. USB HDD speed is capped by the drive 100-150 MB/s typical.
Monitoring Samba Connections
Check who is connected:
sudo smbstatus
# Shows connected users, shares, and open files
View logs:
sudo tail -f /var/log/samba/log.smbd
Troubleshooting
Windows Can’t Find the Mini PC
Ensure nmbd is running handles NetBIOS name resolution. If Windows still can’t find it by name, access by IP directly: \\192.168.1.100.
“Access Denied” on Password-Protected Shares
Check that the user exists in Samba’s database: sudo pdbedit -L — your sambauser should appear. If not, re-run sudo smbpasswd -a sambauser.
Time Machine Won’t Show Share as Destination
Verify the fruit VFS module is installed: dpkg -l samba-vfs-modules. Ensure vfs objects = catia fruit streams_xattr is in the Time Machine share definition. Restart Samba: sudo systemctl restart smbd.
Slow Transfer Speeds
Check that you’re on a wired 2.5GbE connection rather than Wi-Fi. Wi-Fi throughput varies significantly. Also verify the USB drive if using external HDD is USB 3.0 — USB 2.0 caps at ~30-40 MB/s.
Who Should Skip This Comparison
Frequently Asked Questions
Can I use a mini PC as a NAS with Samba?
Yes. Samba turns a mini PC into a full network-attached storage device accessible from Windows, macOS, and Linux over SMB protocol. With an external USB HDD or additional NVMe drive, a mini PC running Samba provides the same file sharing functionality as a Synology NAS at a lower cost — and runs other services simultaneously.
Is a mini PC better than a Synology NAS for Samba file sharing?
A mini PC is more flexible but requires more setup. Synology’s DiskStation Manager is polished and purpose-built for NAS use. A mini PC running Samba on Ubuntu requires command-line configuration but runs more services alongside it — Docker, Home Assistant, Jellyfin — on the same hardware. For users already running a mini PC home server, adding Samba costs nothing beyond disk storage.
Does Samba on Ubuntu work with macOS Time Machine?
Yes. Configure the Samba share with the ‘fruit’ and ‘streams_xattr’ VFS modules, and add ‘time machine = yes’ to the share definition. macOS recognizes it as a Time Machine destination in System Settings → Time Machine → Add Backup Disk.
What storage should I use for a Samba NAS on a mini PC?
For a media library: an external USB HDD or USB-attached drive enclosure. For personal documents and backups: the mini PC’s NVMe drive has enough space if you budget it. For a proper multi-disk array: use TrueNAS Scale on a mini PC with multiple NVMe slots, or attach a USB drive enclosure. Samba works with any Linux filesystem — ext4 for HDD storage, ZFS via TrueNAS for data integrity.
