Advertisement
Intermediate Time: 2–3 weeks IT & Networking

NAS Home Server with TrueNAS

Build a powerful NAS home server using TrueNAS Core with ZFS RAID, automated backups, Plex, and Nextcloud.

NASTrueNASRAIDZFSStorageSelf-Hosted
DifficultyIntermediate
Duration2–3 weeks
Components10 items
Steps4 steps

Introduction

Build a powerful NAS home server using TrueNAS Core with ZFS RAID, automated backups, Plex, and Nextcloud. This comprehensive guide covers everything from design through implementation, testing, and deployment.

Theory & Background

ZFS (Z File System) provides data integrity verification, RAID, compression, and snapshots. RAID-Z1 (similar to RAID-5): 4 drives, 1 parity. Raw capacity = (N-1) × disk_size = 3×4TB = 12TB usable. Create pool in TrueNAS: Storage → Pools → Add → RAID-Z1. Enable compression (LZ4): saves 20–40% space transparently. Enable checksums: ZFS verifies data integrity on every read, automatically heals using RAID parity if corruption detected. Monthly scrub: verify all data integrity.

Advertisement

Components & Requirements

10 components required for this project.

#ComponentPurposeQty
1Mini-ITX motherboard (Intel N100)Low-power server motherboardx1
216GB ECC RAMZFS benefits significantly from ECC RAMx1
34TB HDDs (WD Red / Seagate IronWolf)Data drives in RAID-Z1x4
4SSD 120GB (system drive)TrueNAS OS boot drivex1
5PCIe SATA cardAdditional SATA portsx1
610GbE NIC (Intel X550-T1)High-speed LANx1
7Fractal Node 804 CaseLarge HDD capacity casex1
8450W 80+ Gold PSUEfficient low-load operationx1
9UPS (APC 1000VA)Power failure protectionx1
10Smart PDU (Energenie)Remote power managementx1

Step-by-Step Implementation

Follow these 4 steps carefully.

1
ZFS Storage Pool Configuration

ZFS (Z File System) provides data integrity verification, RAID, compression, and snapshots. RAID-Z1 (similar to RAID-5): 4 drives, 1 parity. Raw capacity = (N-1) × disk_size = 3×4TB = 12TB usable. Create pool in TrueNAS: Storage → Pools → Add → RAID-Z1. Enable compression (LZ4): saves 20–40% space transparently. Enable checksums: ZFS verifies data integrity on every read, automatically heals using RAID parity if corruption detected. Monthly scrub: verify all data integrity.

2
SMB/NFS Share Configuration

SMB (Windows shares): Sharing → Windows Shares → Add. Set path, configure ACLs for user permissions. Enable SMB3 (performance + encryption). NFS (Linux): Sharing → Unix Shares. Configure exports with access control. iSCSI (block storage): for VMs needing block-level storage — create zvol, configure iSCSI target. Performance: SMB3 on 10GbE achieves 800–900 MB/s sequential read/write. NFS achieves 950+ MB/s. Enable jumbo frames (MTU 9000) on NIC and switch for maximum throughput.

3
Automated Backup Strategy (3-2-1 Rule)

3-2-1 backup: 3 copies of data, on 2 different media, 1 offsite. TrueNAS implements: ZFS snapshots (automatic, every 15 minutes, retained 30 days — local protection). ZFS replication to second NAS (weekly, pushed to remote location). Cloud backup (Backblaze B2 via TrueNAS Cloud Sync, $0.006/GB/month — 12TB = $72/month, compress before upload). ZFS snapshots are instantaneous and space-efficient (only changed blocks stored).

4
Jail Apps: Plex and Nextcloud

TrueNAS BSD jails are lightweight containers. Plex Media Server jail: add media dataset to jail, install Plex. Configure libraries. Enable hardware transcoding (requires Plex Pass). Plex streams to any device — iPhone, smart TV, Chromecast. Nextcloud jail: personal cloud storage (Google Drive alternative). Files synced to all devices via Nextcloud client. Enable E2E encryption for sensitive files. Additional jails: Bitwarden (password manager), Home Assistant (smart home), Gitea (private Git server).

Code & Implementation

Core code for nas_backup.sh:

nas_backup.sh Shell
#!/bin/bash # TrueNAS ZFS snapshot and replication script POOL="main" DEST="backup_pool" DATE=$(date +%Y%m%d-%H%M)  # Create recursive snapshot zfs snapshot -r $POOL@auto-$DATE echo "Created snapshot: $POOL@auto-$DATE"  # Replicate to backup pool zfs send -R $POOL@auto-$DATE | zfs receive -F $DEST/$POOL echo "Replicated to $DEST"  # Delete snapshots older than 30 days zfs list -t snapshot -o name | grep auto- | while read snap; do     SNAP_DATE=$(echo $snap | grep -o '[0-9]*-[0-9]*$' | cut -d- -f1)     if [ $(date +%Y%m%d) -gt $(date -d "$SNAP_DATE + 30 days" +%Y%m%d 2>/dev/null || echo 99991231) ]; then         zfs destroy $snap && echo "Deleted old snapshot: $snap"     fi done

Testing & Troubleshooting

Test NAS Home Server with TrueNAS by verifying each subsystem individually before full integration.

!
Troubleshooting Tips

Verify power voltages, check ground connections, use serial monitor for debug.

Real-World Applications

*Personal cloud storage (Google Drive replacement)
*Media server for family photos/videos
*Network attached storage for home lab
*Private Git server
*Smart home hub data storage
*Backup target for all home computers
*Development file sharing across devices
*Self-hosted productivity suite

Extensions & Next Steps

  • Add automatic cloud sync to multiple providers as offsite backup
  • Implement iSCSI target for Proxmox VM storage
  • Build a surveillance camera recording system
  • Add a DLNA server for smart TV streaming
  • Implement Time Machine backup target for Mac computers

Interactive Playground

Coming Soon

An interactive simulator will be available here — simulate circuits and run code in-browser without hardware.

Frequently Asked Questions

Do I really need ECC RAM for a NAS with ZFS?
ECC (Error-Correcting Code) RAM detects and corrects single-bit memory errors. ZFS relies on memory integrity — a bit flip in RAM could corrupt the checksum tree, causing ZFS to 'repair' good data with corrupted data. In practice: ZFS works without ECC, but ZFS's data integrity guarantees are weakened without it. For irreplaceable data (family photos, documents): use ECC. For media server where files can be re-ripped: non-ECC is generally acceptable. AMD Ryzen Pro and Intel Xeon server CPUs support ECC; consumer Ryzen/Core do not.
Advertisement