A NOOB sets up TrueNAS
April 25, 2024
The choice to go with TrueNAS Scale as the bare metal system was made based on a bunch of reading online and in the end a bad experience with a failed disk with TrueNAS Scale virtualized on proxmox. I’m guessing that setup could have been made to work but I’ve been doing this as a hobby project when I have time, and I don’t have time to figure that out. Besides, TrueNAS Scale has more recently improved handling of virtualization and I’m willing to try it.
Setup of TrueNAS Scale on bare metal was significantly easier than proxmox. Put the USB drive in the slot, turn the system on and let it run. Then get into the web interface (which, if you missed it the URL is advertised onscreen on the installed machine) and complete the install. The system just works. It’s nice.
My goal is to setup some important and useful stuff
- Traefik, a reverse proxy, including automated SSL certificates through Let’s Encrypt
- Projectsend as secure online file share
- Vaultwarden password manager
- some kind of backup system (TrueNAS has a bunch of configuration options for this)
and some fun stuff
- IMMICH (photo server)
- jellyfin or Plex (TV and movie server)
- Calibre-web (book server)
- Navidrome (Subsonic compatible audio server)
- Minecraft (MineOS? or something)
additional thoughts might include
- Otterwiki (simple wiki including markdown syntax for documentation since a blog isn’t the best way to document my life…)
- Actual Budget (YNAB self-hosted clone for a meagre attempt to manage finances)
- Plankanban (for managing/planning tasks in a desperate attempt to be organized and get things done)
- Receipt-wrangler (OCR the damned receipts without having to pay more than it’s worth for an app, this is a really new app at time of writing and is strictly experimental… still struggling to get this working)
- oLLaMa (silly experiments in self-hosted generative “AI”)
No setup guide is strictly needed for TrueNAS. As with any system of this complexity it’s good to do as much homework up front as possible but you do end up picking it up as you need to.
Your mileage may vary but these are my notes, if you find them useful, I’m glad, if you don’t like what I’ve done, feel free to politely comment or ignore me.
Initial Setup:
During install I had to choose the disk to install the system to (in my case the installed SSD drive, specifically for this purpose). I also had to chose between running the system directly as root or having the system setup to run as admin instead. I chose the admin option. There are a couple of implications of doing this. One, root isn’t exposed the same way as if it was the main way to access the system. A tiny improvement in security, but I’ll take it. The other thing to note though, is that when you get into the shell (through “Settings”) you’ll have to sudo to do most things you’re there to do.
TrueNAS provides handling of storage (it’s initial purpose) for network access. The features here are simple and the webGUI makes it easy to use. There are many tutorials to setup any number of disks and software RAID configurations offered by TrueNAS. I have a very basic setup with 2 disks mirrored. This a certain amount of safety but backups are strongly recommended. Mirrored disks fail and rebuilding a large disk in an array that has failed “nicely” still takes significant time. TrueNAS recently improved handling a failed disk. It appears to be a simple matter of disabling the failed disk in the pool (take it offline) and swapping it out for a good disk (this disk will be completely erased to be incorporated into the existing pool).
Speaking of Apps, iX Systems (the main developer and support for TrueNAS) provide an upfront list of apps to be installed as containers . Note that TrueNAS runs Kubernetes for this. This is a management layer on top of the containers which complicates things… In this case I understand k3s is what’s used (something to do with running a cluster of one). Also, the apps offered for install in the GUI are offered through a Helm Charts catalogue. It’s all very slick and when it works it’s brilliantly easy. When it breaks though it’s a bit painful finding the right commands for the CLI to figure out exactly what is going wrong. Errors posted when an install doesn’t work are mostly useless.
So, since the Helm Charts are limited in the initial install to only “official” iX apps you will want to add the catalog from Truecharts.
go to Apps > Discover Apps (button) > Manage Catalogs (subtle link under number of catalogs on the right near the top) > Add Catalog
name: truecharts
repository: https://github.com/truecharts/catalog
preferred trains: enterprise, stable, operators
Branch: main
Save and give the system a few minutes to update the listing from the new catalog source.
After some fighting and struggling with the helm charts and trying to make stuff work in k3s and getting tired of not being free to do things as needed instead of through multiple layers of abstraction, I am now taking my marbles and making a VM from which I will run a bunch of docker containers.
To create the VM:
- add a dataset for the new VM (under Datasets on the left hand menu)
- add a dataset for ISO storage so you have an image from which to install the OS for the VM.
- create a new user for SMB sharing (admin and root aren’t allowed to do this) if you don’t have one already
- make an SMB share out of the ISO storage dataset
- upload an iso to the ISO storage (pick the OS you want to run for your VM, download the iso for it and upload it here through the samba share logging in as the new user you just added)
Add a virtual machine (under Virtualization on the left hand menu)
choices I made that weren’t made for me by defaults
- Guest Operating System: linux
- Name: and Password:
- Cores: 2
- Threads: 2
- Memory Size: 16 GiB
- Minimum Memory Size: 8 GiB
- Use existing disk image: (choose this radio button)
- zvol location: this will drop down a path to the dataset you created earlier, choose it here and now
- Size: 3 TiB
- Attach NIC: if you have more than one, make sure you pick the right one, a simple setup like mine only has one NIC
- Installation Media: again this drops down a list of datasets from which you can pick, specifically choose the ISO you want to install from here
I don’t have a GPU in my system so I confirmed my choices and watched the system install the VM.
- To do this you open a “<…> Display” (once the VM is created in Truenas and you click on the named VM you’ll see a bunch of options at the bottom, display is one of them).
NOTE: There is a problem here, the default timeout on the Truenas login is 5 min. I recommend lengthening the timeout for a home lab. The system will timeout while you’re watching (which then makes for some weird reactions until you realize the problem and relaunch a new display window).
- System Settings > Advanced > Access (this is a card on this page that you need to scroll a ways down to) > Configure (note it warns you you’re doing something advanced…) set your time out to something longer than 300 s.
Now… watch for the completion of the install but do NOT reboot without FIRST deleting the device (Devices button near where you found the Display button) which is attached with the install media/iso. If you don’t do this the system loops on the installer until you do remove it.
Now that you have a working install of something (in my case Linux)… the install is truly tabula rasa. You have to add users, install updates, and so on. In my case I used
su -
to become root (including the full PATH for the root user) and then
apt update && apt upgrade
and then install sudo so I don’t have to be root all the time
apt install sudo
and then add the initial user to the sudoers group
usermod -a -G sudo <username> (use the username created during install)
Now your user doesn’t have to su – or su root to have the power to do most things.
The next thing is to install docker, if you’re running debian as I am then you might consider following this guide to install docker on debian.
After that it’s up to you to figure what you’re doing next with Docker.
Now that I have this system working the next steps are working on backup and recovery. My goal is to understand using snapshots during the day and then setting up daily, weekly, monthly backups and doing some practice recoveries to ensure I know how to bring the system back.