Shared Storage for Your Homelab: Samba and NFS File Shares Done Right

How to set up network file shares in a Proxmox homelab using Samba (for Windows/macOS) and NFS (for Linux). A beginner guide to a central file server your media, photos, and backups can all read from.

On this page
  1. Step 1 — Create the file-server container
  2. Step 2 — Samba, for Windows, Mac, phones, and TVs
  3. Step 3 — NFS, for your other Linux containers
  4. You now have a foundation, not just a share

Every homelab hits the same wall around service number three: you’ve got a media server that needs a movie library, a photo backup that needs somewhere to put photos, and a laptop full of files you’d like to reach from the couch. Right now each of those lives on its own little island of storage, and copying between them is a chore.

The fix is a central file server — one place where files live, that everything else reads from. This guide builds one as a lightweight container in Proxmox, sharing files two ways: Samba for your Windows, Mac, phone, and TV, and NFS for other Linux containers and VMs on your network.

One file server, everything else reads from itFile Server (LXC)Samba + NFS/tank/media /tank/photosWindows / MacSamba (SMB)TV / PhoneSamba (SMB)Plex / JellyfinNFS*arr stackNFSbuildahomelab.dev
Where the data lives matters more than the container

Keep your actual files on a storage pool that is separate from the container’s own root disk — a dedicated drive or a ZFS pool bind-mounted into the container. That way the files outlive the container: you can rebuild, upgrade, or replace the file server without ever touching the data. See the Proxmox storage guide for setting up that pool first.


Step 1 — Create the file-server container

First: make these values your own

Swap the example values in this guide for your own before copying anything: youradmin (the username you actually want on the share), SERVER-IP (your file server’s LAN address), 192.168.1.0/24 (your LAN subnet), /tank/... (wherever your storage pool is mounted), and UID/GID 1000 (whatever ID owns your data — check with id). If a value looks specific to one machine, it’s a placeholder to change — not a literal to copy.

Create a small Debian or Ubuntu LXC in Proxmox (2 CPU, 1GB RAM is plenty — a file server barely works up a sweat). If you want to serve files from a Proxmox ZFS dataset or a second drive, add it as a bind mount to the container so the container sees your storage pool as a normal folder like /tank.

Unprivileged containers and file ownership

If you use an unprivileged LXC (recommended), the container’s user IDs are shifted relative to the host. The simplest approach for a beginner file server is to pick one shared UID/GID — for example 1000 — and make sure your bind-mounted data is owned by that ID on the host. Every service that touches the share then runs as the same 1000, and permissions “just work.” Keeping one consistent UID across the media apps is exactly what the Arr stack guide relies on.


Step 2 — Samba, for Windows, Mac, phones, and TVs

Samba speaks SMB — the protocol every desktop OS already knows. Install it inside the container:

Install Samba

sudo apt update
sudo apt install -y samba

Create a folder to share and a user to access it. Samba keeps its own password separate from the Linux login password, so you set it explicitly with smbpasswd:

Create a share folder and a Samba user

# Point this at your bind-mounted storage
sudo mkdir -p /tank/media
sudo chown -R 1000:1000 /tank/media

# Create a Linux user (no login shell needed) then a Samba password for it
sudo useradd -M -s /usr/sbin/nologin youradmin
sudo smbpasswd -a youradmin

Now define the share. Open /etc/samba/smb.conf and add a block at the bottom:

/etc/samba/smb.conf (add at the end)

[media]
 path = /tank/media
 browseable = yes
 read only = no
 valid users = youradmin
 create mask = 0664
 directory mask = 0775

Restart Samba and, if you run the Proxmox firewall or ufw, allow SMB (port 445):

Apply and open the firewall

sudo systemctl restart smbd
# If you use ufw inside the container:
sudo ufw allow samba

That’s it. From Windows, open File Explorer and type \\SERVER-IP\media. On macOS, use Finder’s Go → Connect to Server and enter smb://SERVER-IP/media. Sign in as youradmin with the Samba password you set.

Never expose Samba to the internet

SMB is a LAN protocol. Do not port-forward 445 through your router — it is a favourite target for ransomware. To reach your files away from home, put them behind Tailscale instead and access the share over the private tunnel.


Step 3 — NFS, for your other Linux containers

For container-to-container access — say, letting Plex and the Arr stack read the same library — NFS is faster and avoids the login prompts SMB uses. Install the server:

Install the NFS server

sudo apt install -y nfs-kernel-server

Declare what to export and to whom in /etc/exports. Restrict it to your LAN subnet so only local machines can mount it:

/etc/exports

/tank/media   192.168.1.0/24(rw,sync,no_subtree_check,all_squash,anonuid=1000,anongid=1000)

The all_squash with anonuid=1000 maps every client to UID 1000 — the same shared owner from Step 1 — so files created over NFS have consistent ownership. Apply it:

Publish the export

sudo exportfs -ra
sudo systemctl enable --now nfs-kernel-server

On a client container, mount it like any other folder:

Mount the share on another Linux box

sudo apt install -y nfs-common
sudo mkdir -p /mnt/media
sudo mount -t nfs SERVER-IP:/tank/media /mnt/media

# To make it permanent, add to /etc/fstab:
# SERVER-IP:/tank/media  /mnt/media  nfs  defaults,_netdev  0  0

You now have a foundation, not just a share

This one container is the storage backbone of almost everything else you’ll build. Your media server reads its library from here. Your photo backups land here. The Arr automation stack files downloads here — and because every app sees the same paths on the same share, it can move files with instant hardlinks instead of slow, space-doubling copies.

Set up storage once, correctly, and every service you add afterward gets easier. That’s the whole idea behind building a homelab in order.


Related posts:

Sources: Samba, Samba wiki, Microsoft SMB file-server overview.

Comments

Comments are powered by GitHub Discussions — sign in with a GitHub account to join the conversation.