A professional guide for setting up a private NAS using Ubuntu Server, Samba, and Tailscale.
Build your own private cloud storage with secure remote access and cross-platform compatibility.
- π Simple Storage: Minimalist setup with a single root directory for all your files.
- π Secure Access: User-based authentication for Samba shares.
- π Remote Ready: Integrated with Tailscale for secure access from anywhere without port forwarding.
- π» Cross-Platform: Easy mounting on Linux (Arch/Ubuntu), Windows, and macOS.
- βοΈ Auto-Mount: Support for persistent connections via
/etc/fstab.
| Tool | |
|---|---|
| OS | Ubuntu Server (LTS recommended) |
| Sharing | Samba (SMB/CIFS) |
| Networking | Tailscale (WireGuard-based Mesh VPN) |
| Editor | Neovim / Vim / Nano |
Ensure you have a fresh Ubuntu Server install and Tailscale connected.
# Check available disk space
lsblk
df -h /# Install Samba
sudo apt update && sudo apt install samba -y
# Create NAS Root Directory
sudo mkdir -p /mnt/nas
sudo chown -R $USER:$USER /mnt/nas
sudo chmod -R 775 /mnt/nassudo nvim /etc/samba/smb.confAdd the following to the bottom of the file (replace <YOUR_USER> with your actual system username):
[NAS]
path = /mnt/nas
browseable = yes
writable = yes
valid users = <YOUR_USER>
create mask = 0775
directory mask = 0775# Set Samba password
sudo smbpasswd -a <YOUR_USER>
# Enable and Start Samba
sudo systemctl enable smbd
sudo systemctl restart smbdManual Mount (Linux/Arch)
# Install client tools
sudo pacman -S smbclient cifs-utils
# List shares
smbclient -L //TAILSCALE_IP -U <YOUR_USER>
# Mount
sudo mkdir -p /mnt/nas-name
sudo mount -t cifs //TAILSCALE_IP/NAS /mnt/nas-name -o username=<YOUR_USER>Auto-Mount on Boot
Add to /etc/fstab:
//TAILSCALE_IP/NAS /mnt/nas-name cifs username=<YOUR_USER>,password=YOUR_PASSWORD,_netdev 0 0
| Problem | Solution |
|---|---|
| Connection timeout | Check Tailscale status: tailscale status |
| Login failure | Reset Samba password: sudo smbpasswd <YOUR_USER> |
| Share not found | Restart Samba service: sudo systemctl restart smbd |
| Permission denied | Verify folder ownership: ls -la /mnt/nas |
MIT