Introduction to VeraCrypt
VeraCrypt is the successor of TrueCrypt and offers a robust method for creating encrypted volumes on Linux. Its open-source code has been audited and continues to receive security updates. In this article we will see how to install it, create encrypted containers and use them both from the graphical interface and from the terminal.
Installation on popular distributions
On Ubuntu and derivatives you can add the official repository or download the .deb package from the download page. On Fedora and CentOS the package is available in the RPM Fusion repositories. Below are the basic steps:
- Update the package index:
sudo apt update - Install the package:
sudo apt install veracrypt - On Fedora:
sudo dnf install veracrypt
If you prefer not to add repositories, download the generic installer from veracrypt.fr, give it execution permission and run it.
Creating an encrypted volume
Once installed, open VeraCrypt from the applications menu or run veracrypt in the terminal. The wizard will guide you through the following steps:
- Click Create Volume and choose Create an encrypted file container.
- Select the location and name of the file that will act as a virtual disk.
- Choose the encryption algorithm (AES is recommended) and the hash mode (SHA‑512).
- Define the size of the volume according to your needs.
- Set a strong password; you can use a key file or biometric authentication if your hardware supports it.
- Format the volume with the filesystem you prefer (ext4, FAT32, NTFS).
- Finish the process and wait for the container to be generated.
The result is a file that, when mounted, behaves like a normal partition.
Mounting and dismounting volumes
To use your encrypted volume, select a free drive letter in the VeraCrypt interface, click Select File and browse to the container you created. Then press Mount and enter the password. The volume will appear in your file manager like any other disk. When you are done, return to the main window, select the mounted drive and press Dismount. You can also perform these actions from the command line:
- Mount:
veracrypt --text --mount /path/to/container.hc /mnt/myVolume - Dismount:
veracrypt --dismount /mnt/myVolume
Remember to create the mount point (mkdir -p /mnt/myVolume) before mounting.
Advanced usage from the terminal
This post is also available in ESPAÑOL.