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.
Build a powerful NAS home server using TrueNAS Core with ZFS RAID, automated backups, Plex, and Nextcloud.
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.
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.
10 components required for this project.
| # | Component | Purpose | Qty |
|---|---|---|---|
| 1 | Mini-ITX motherboard (Intel N100) | Low-power server motherboard | x1 |
| 2 | 16GB ECC RAM | ZFS benefits significantly from ECC RAM | x1 |
| 3 | 4TB HDDs (WD Red / Seagate IronWolf) | Data drives in RAID-Z1 | x4 |
| 4 | SSD 120GB (system drive) | TrueNAS OS boot drive | x1 |
| 5 | PCIe SATA card | Additional SATA ports | x1 |
| 6 | 10GbE NIC (Intel X550-T1) | High-speed LAN | x1 |
| 7 | Fractal Node 804 Case | Large HDD capacity case | x1 |
| 8 | 450W 80+ Gold PSU | Efficient low-load operation | x1 |
| 9 | UPS (APC 1000VA) | Power failure protection | x1 |
| 10 | Smart PDU (Energenie) | Remote power management | x1 |
Follow these 4 steps carefully.
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.
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-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).
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).
Core code for nas_backup.sh:
#!/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
Test NAS Home Server with TrueNAS by verifying each subsystem individually before full integration.
Verify power voltages, check ground connections, use serial monitor for debug.
An interactive simulator will be available here — simulate circuits and run code in-browser without hardware.