Encrypting entire partitions is cool, but you might, at times, just need to encrypt an individual directory. For that, we can use eCryptfs. We'll need to use our Ubuntu machines for this, because Red Hat and CentOS no longer include eCryptfs in version 7 of their products. (It was in Red Hat 6 and CentOS 6, but it's no longer even available for installation in version 7.)
Encrypting directories with eCryptfs
Home directory and disk encryption during Ubuntu installation
When you install Ubuntu Server, you have two chances to implement encryption. You'll first be given the chance to encrypt your home directory:
Later, on the Partition disks screen, you'll be given the chance to set up encrypted logical volumes...