If you use ext4 or other filesystem that supports fscrypt, you can use fscrypt to encrypt specific directories.
There's also gocryptfs for a fuse-based userspace implementation.
ZFS has built-in encryption: https://klarasystems.com/articles/openzfs-native-encryption/