SysTutorials

Installing EncFS on CentOS 6

· updated April 12, 2026

EncFS provides an encrypted filesystem in user space — files are encrypted on the fly and stored in an existing directory. It’s lighter than LUKS and doesn’t require root access or dedicated partitions. Here’s how to set it up on CentOS 6.

Install EncFS

EncFS is available from the EPEL repository:

# Enable EPEL
sudo yum install epel-release

# Install EncFS
sudo yum install encfs

EncFS requires FUSE (Filesystem in Userspace), which should be installed as a dependency.

Create an Encrypted Directory

# Create the encrypted storage and mount point
mkdir ~/.encrypted
mkdir ~/encrypted

# Initialize the encrypted filesystem
encfs ~/.encrypted ~/encrypted

On first run, EncFS asks configuration questions:

After setup, ~/encrypted is your decrypted view. Any files placed here are automatically encrypted and stored in ~/.encrypted.

Mount and Unmount

# Mount the encrypted directory
encfs ~/.encrypted ~/encrypted

# Unmount when done
fusermount -u ~/encrypted

To mount automatically at login, add to your session startup scripts. You can also create a helper script:

#!/bin/bash
# ~/mount_encrypted.sh
encfs --extpass="cat ~/.encfs_password" ~/.encrypted ~/encrypted

Note: Storing the password in a file reduces security. Only use this if you understand the tradeoff.

Configuration Options

EncFS stores its configuration in ~/.encrypted/.encfs6.xml. Key settings:

Performance Considerations

EncFS runs in userspace, so it’s slower than kernel-level encryption (LUKS). Expect:

For large files (video, archives), the overhead is minimal. For directories with thousands of small files, consider LUKS instead.

Backup Considerations

To back up encrypted data:

# Back up the raw encrypted directory (don't need to mount)
tar -czf encrypted_backup.tar.gz ~/.encrypted/

# Or use rsync to a remote location
rsync -av ~/.encrypted/ user@backup-server:~/encrypted_backup/

The backup contains encrypted filenames and content — no plaintext is exposed. The .encfs6.xml configuration file must also be backed up separately, as you need both the password and the config to decrypt.

EncFS vs Other Encryption Tools

EncFS vs LUKS:

EncFS vs CryFS:

EncFS vs gocryptfs:

For new projects in 2026, gocryptfs or CryFS are generally recommended over EncFS due to active maintenance and stronger security defaults.

← All posts