FreeNAS is a deprecated version now. The successor (which is basically the same thing) is TrueNAS. They also have a version based purely on Linux called TrueNAS Scale. Both Community and Enterprise versions are available. The Community version is entirely free. It supports VMs through KVM and containerization, as well as all the network sharing options out there.
Another option is Proxmox. It's Debian based and is more focused on virtualization than storage, but it has whatever you would really need for storage (including full ZFS support). You might find yourself in the command line for some things with Proxmox over TrueNAS, but if you were willing to go full Ubuntu I imagine that wouldn't be an issue.
That being said, if you want to just go the manual route, then I suggest Debian. It's leaner and considered more stable than Ubuntu, and doesn't have some of the cruft that Ubuntu has (like Snaps), which may be a positive or a negative depending on what your needs are.
Edit: just to add, since you're going to run Jellyfin and Nextcloud on these systems, my recommendation is Proxmox as it has great tooling for managing VMs, like automatic backups. I personally run both Nextcloud and Jellyfin in their own VMs. I like the workflow of backing up the entire VM and being able to restore it to the exact state when it was saved. Containers require a bit more knowledge to run them to be truly stateless, and then you have to worry about backing up your stateful data (like configuration files, etc) separately.