MoneySnakeFind the margin.

BUILD PROJECT · FILE SERVER

How to Build a Personal File Server

Create a simple, private Samba share on a used computer without making guest access or a single disk your backup plan.

What you’ll build A local Samba shareDifficulty Intermediate

Choose a simple storage layout

Keep the operating system and shared data easy to identify. A single mounted data volume is a reasonable beginner layout; label the mount point and record which physical disk it uses. You do not need RAID, hot-swap bays or a specialised NAS operating system for a useful home share.

Leave room for temporary files and updates, and monitor free space. A full filesystem can make Samba look broken even when the service is healthy.

Plan the server

A file server centralises files on your home network. Choose storage with enough room for growth and keep a second copy elsewhere. A healthy base computer, power supply and network connection matter more than a server label. You do not need RAID for this beginner share, and RAID is not a backup.

Mount storage deliberately

Assume Ubuntu or Debian and replace device names only after checking them. The following commands inspect disks; do not run a format command until you have identified the correct device:

lsblk -f
sudo smartctl -a /dev/sdX
sudo mkdir -p /srv/files

Install smartmontools if needed. Mount a filesystem by UUID in /etc/fstab so a device name change does not silently point at the wrong disk. Test with sudo mount -a and confirm the expected mountpoint.

Install and configure Samba

sudo apt update
sudo apt install samba
sudo groupadd --system fileshare
sudo usermod -aG fileshare your-user
sudo chown -R root:fileshare /srv/files
sudo chmod -R 2770 /srv/files
sudo smbpasswd -a your-user

Create a named user with a strong password. Add one share to /etc/samba/smb.conf:

[files]
   path = /srv/files
   browseable = yes
   read only = no
   valid users = @fileshare
   force group = fileshare
   create mask = 0660
   directory mask = 2770

Review the file, validate it, then restart:

testparm
sudo systemctl restart smbd

Do not enable anonymous writable shares. Keep the share account separate from system administration where practical.

Firewall and clients

Allow SMB only from your home subnet using the host firewall. Connect from Windows with \\server-name\files, from macOS with Finder’s “Connect to Server” using smb://server-name/files, or from Linux with its file manager. Test read and write access with a non-critical file, then test a denied user.

Backups, health and recovery

Monitor free space and SMART health where supported, but remember that SMART is evidence, not a guarantee. Copy important data to another device or location and test restoring it. Keep a written record of the mount UUID, share path and user permissions. If the disk will not mount, stop writing, inspect journalctl and restore from the second copy rather than experimenting on the only data.

Common mistakes and next steps

Typical failures are a wrong mountpoint, parent-directory permissions, a firewall rule, cached client credentials or a changed hostname. Check one layer at a time. Continue with the backup-server guide or use the file share as storage for Plex.

Check each client

testparm
sudo systemctl status smbd
ls -ld /srv/files

From Windows use File Explorer and \\server-name\files; from macOS use Finder’s “Connect to Server” with smb://server-name/files; from Linux use the file manager or smbclient -L //server-name -U your-user. Create and remove one harmless test file, then confirm an account without access is denied.

Mount recovery

Edit /etc/fstab carefully: copy the existing line first, use the UUID shown by lsblk -f, and run sudo mount -a before rebooting. If the mount is missing, stop Samba from serving the empty parent directory so users do not mistake an empty share for lost data. Inspect journalctl -b and restore from the second copy if the disk is failing.

What next?

Protect the share with the backup-server guide, or use it as storage for Plex. Build a file-server host when you are ready to check a machine.

Build a file-server host Plan backups