This is a guide to install ubuntu 16.04 minimal on a ZFS root partition, where the disk is encrypted with LUKS. Just using regular BIOS booting, not EFI. Note, you will need to install using a Live-CD: I'd recommend using using Lubuntu because it's lightwieght. You could also install a stock copy of ubuntu on to a USB stick and use that.
To start, we are going to install and set up SSH access to the liveCD so that we can copy and paste things easier. I made a little script to install needed stuff and enable SSH. To run it easier, run the following command:
wget -O bootstrap https://img.sharo.se/YdmjT.txt; sudo bash bootstrap