Yesterday, I set up my first TrueNAS computer, and I’ve installed Immich and Jellyfin on it so far. During this I’ve noticed that the way you set up apps differs a bit from how you’d normally set up Docker containers manually. For more complex stuff like Nextcloud, I was thinking of just spinning up a VM.
However, I doubt my Ryzen 7 2700 can handle a VM per application, so I was wondering if it’s a reasonable idea to spin up one VM and treat that like a server with lots of Docker containers on it?
Also, would there be a way to exclusively expose that VM to the web, so I can keep my main TrueNAS stuff like Immich separate from, say, the Nextcloud instance?
Or is this whole idea just nonsensical, and I should simply stick to apps?
If you have previous experience with Docker I’d strongly suggest using just exactly one app: Portainer or Dockge (whichever you prefer) and then write your own docker compose file(s).
I’d run the containers directly on TrueNAS but a Ryzen 2700 would definitely be strong enough for a few small Linux VMs if you prefer that - I don’t see any advantage to that here though.
truenas apps use standard docker in the background, just with a custom truenas wrapper for the install wizard. If you want a more standard docker approach, you can either use the custom yaml function to deploy your own compose files directly on truenas, but if you want to have more managing options, i’d say install portainer or dockge and manage your stacks through them.
To expose e.g. nextcloud savely you’d have to either do it with a domain name and a reverse proxy or something like tailscale or cloudflare tunnels. This can be done per app
I’ve been looking into Dockge a bit now, considering how expensive Portainer is. Seems good enough, I think. I’ve got a question about paths, though: should I just continue creating directories as datasets inside my pool? For example, if I need jellyfin/config/, do I create the dataset at /mnt/tank/jellyfin/config/ via the GUI and then just point it there? Same as the GUI setup that the Apps tab provides?
I have to admit, I still don’t quite get what makes a dataset special compared to a directory. Or is it just a fancy name for a directory inside a pool?
Yes you can keep doing it like that. It has the advantage of being able to set different snapshot policies for different apps.
The other option would be to create one main datase, for example called apps, and then manually create folders inside that dataset for each app.
Disadvantage is that you can’t create different snapshot policies for each app and if you have to roll back a single app via snapshot, you’d have to roll back every app, not just one.
I see. How could I create a directory without creating a whole dataset? To me, it seemed like they are pretty much one and the same to TrueNAS, at least in the GUI, and if I go into a shell it tells me not to touch anything.
Also, I didn’t know TrueNAS supported snapshots out of the box. I’ll have to look into that, thanks!
Datasets are mini filesystems in themselfes. You can create folders inside a dataset, but not datasets inside a folder. Only Datasets can be created by the truenas gui.
If you want to go the folder route, you need at least one child-dataset where you can edit the acls, so do not use the root dataset.
Map that child dataset as an smb share and create your folder structure via windows explorer, finder or whatever linux explorer there is. Or connect to your truenas box via ssh, navigate to the child dataset and just use mkdir foldername
I see, interesting. So the “don’t touch anything” warning is more about installing packages and such? Well, I suppose I’ll just fiddle around with that, and if anything breaks, I can just wipe it and start over. It’s not like I’ve got any precious data on the NAS yet.
Any reason to use SSH instead of the terminal built into the GUI? Or is that just your personal preference?
When you create the datasets/folders, keep in mind that file operations (move, copy) will be much slower between datasets than “inside” them as those are seperate file systems.
I just copied a ~32GB file from one dataset on my 4-wide RAIDZ1 to another - took nearly four minutes.
Then I copied it within the dataset - three seconds.
This is especially interesting for use cases where one software downloads something and then another moves it somewhere else.