Samba is an open-source implementation of the SMB/CIFS protocol suite and allows Linux systems
to share files and directories over the network in a standardized way.
Originally designed for interoperability with Windows systems, Samba has long since become a
reliable and efficient file server solution for Linux-to-Linux environments as well.

In homelabs and small server setups, Samba is often used to provide centralized storage,
simple access control, and predictable network file sharing without introducing additional
protocols or services.

This article documents a Samba configuration I actively use in my own homelab.
It runs on Debian GNU/Linux 13 and serves Linux clients over a 1 Gbit network.

The goal is not maximum compatibility, but clarity, performance, and predictability.
No legacy SMB1, no obscure tuning parameters — just a clean, modern Samba setup.


Environment Overview

  • Server OS: Debian GNU/Linux 13
  • Clients: Linux only
  • Network: 1 Gbit Ethernet
  • Storage: RAID5
  • Protocol: SMB3

Preparing the Filesystem (Persistent Mount via /etc/fstab)

Before configuring Samba, the underlying filesystem must be mounted reliably.
In this setup, the shared data resides on a RAID5 volume formatted with ext4.

The filesystem is mounted persistently using /etc/fstab and referenced by its UUID
to avoid issues with changing device names across reboots.

/etc/fstab Entry

UUID=a64b3c6f-25fa-4ef2-93f6-7714b459c015 /mnt/raid5 ext4 defaults 0 2

Creating the Mount Point and Verifying the Setup

sudo mkdir -p /mnt/raid5
sudo mount -a
df -h /mnt/raid5

All Samba shares reference paths inside this mount point.
Ensuring that it is mounted correctly at boot time is critical for a stable file server.


Installing Samba on Debian 13

sudo apt update
sudo apt install samba samba-common-bin

Verify the installation:

smbd -V

User Management (Linux + Samba)

Samba integrates best when it reuses existing Unix users.
This setup does not rely on guest fallbacks or parallel authentication models.

Create a Linux user

sudo adduser raphael

Assign filesystem ownership

sudo chown -R raphael:raphael /mnt/raid5/data

Add the user to Samba

sudo smbpasswd -a raphael

Global Samba Configuration

Below is the exact /etc/samba/smb.conf I use in production.

[global]
server min protocol = SMB2_10
server max protocol = SMB3

workgroup = smb
security = user
map to guest = never
share modes = yes

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

aio read size = 1
aio write size = 1
use sendfile = yes

server multi channel support = yes
server role = standalone server

Why these settings are used

  • SMB2.1+ and SMB3 only – improved security and performance
  • Asynchronous I/O for better throughput on large files
  • sendfile() to reduce CPU overhead
  • Low log level to avoid unnecessary disk I/O

Note: SMB multichannel is enabled here, but with a single 1 Gbit NIC it provides no measurable benefit.
It is harmless, but optional.


Main Authenticated Share

[shared]
path = /mnt/raid5/data/
read only = no
valid users = raphael
force user = raphael

strict locking = no
oplocks = yes
kernel oplocks = yes

This share is used for general storage, backups, and media files.
Filesystem permissions are enforced at Unix level, not corrected by Samba.


Secondary Share with Restricted Access (angelika)

This share uses the same security and performance model as the main data share.
Guest access has been removed entirely.

[angelika]
path = /mnt/raid5/data/angelika/
read only = no
valid users = raphael
force user = raphael

strict locking = no
oplocks = yes
kernel oplocks = yes

Both shares now behave consistently and predictably.


Validate and Restart Samba

sudo testparm
sudo systemctl restart smbd

Performance Expectations

  • ~105–115 MB/s sequential throughput on a 1 Gbit LAN
  • Low CPU usage
  • Stable transfers for large files

In practice, the limiting factor is almost always disk I/O or RAID layout — not Samba itself.


Conclusion

This configuration is not theoretical — it is the exact setup I use daily.

By relying on modern protocols, sane defaults, and Unix permissions,
Samba remains a fast and reliable file server for Linux homelabs.

Infrastructure should be boring.
This setup achieves exactly that.


Disclaimer

The configuration and recommendations described in this article are based on
personal experimentation and practical use in a private homelab environment.

They are provided for informational purposes only and come without any guarantee of correctness,
completeness, or suitability for a specific purpose
.

While the setup works reliably in my environment, system configurations may vary.
Applying these settings is done entirely at your own risk.

Always test changes in a controlled environment before deploying them on production systems.

By raphael

Leave a Reply