VeraCrypt is an open-source disk encryption tool — files, directories, and full drives — built as TrueCrypt's successor with modern algorithm support, on-the-fly encryption, hidden volumes, and plausible deniability. This guide installs it on Ubuntu 24.04 and walks through creating, mounting, and dismounting an encrypted volume both via CLI and the GUI.
Prerequisites: an Ubuntu 24.04 instance.
Install VeraCrypt
Not in the default repos — add the maintained PPA:
$ sudo apt update
$ sudo add-apt-repository ppa:unit193/encryption -y
$ sudo apt update
$ sudo apt install veracrypt -y
$ veracrypt --version
Encrypt Volumes via CLI
1. Generate some entropy for the encryption keys:
$ mkdir sample-dir
$ cd sample-dir
$ nano randomdata.txt
Paste in 320+ characters of arbitrary text, save.
2. Create a 200MB encrypted volume:
$ sudo veracrypt --text --create vctest.vc --size 200M --password EnterYourPassword1! --volume-type normal --encryption AES --hash sha-512 --filesystem ext4 --pim 0 --keyfiles "" --random-source randomdata.txt
-
--size—M/K/Gsuffixes -
--password— use 20+ characters for real volumes -
--volume-type normal— vs.hiddenfor plausible deniability -
--encryption AES/--hash sha-512— cipher and KDF -
--filesystem ext4— cross-platform options: FAT/NTFS/exFAT -
--pim— Personal Iterations Multiplier,0= default iteration count -
--random-source— feeds the file from step 1 into key generation
Mount It
$ sudo veracrypt --text --mount vctest.vc /mnt --password EnterYourPassword1! --pim 0 --keyfiles "" --protect-hidden no --slot 1 --verbose
$ cd /mnt
$ veracrypt --list
Read/write files normally inside /mnt while mounted.
Dismount It
$ cd
$ sudo veracrypt --dismount vctest.vc
Or by mount point, slot, or all at once:
$ sudo veracrypt --dismount /mnt
$ sudo veracrypt --text --dismount --slot 1
$ sudo veracrypt --dismount
$ veracrypt --list
Encrypt Volumes via GUI
On a desktop workstation:
- Open VeraCrypt → Create Volume.
- Pick Standard VeraCrypt Volume or Hidden VeraCrypt Volume.
-
Select File → choose a location/name (e.g.
MyData) → Save → confirm path → Next. - Pick encryption (
AES) and hash (SHA-512) algorithms → Next. - Set volume size → Next.
- Set a strong password; optionally enable PIM (default
0= 458 header-key iterations). - Pick a filesystem (
FAT/NTFS/exFAT), move the mouse randomly to seed key generation, Format. - Close the wizard.
- Back in the main window, Select File → pick the volume → Mount → enter the password.
Uninstall (Optional)
$ sudo apt autoremove veracrypt -y
$ sudo add-apt-repository --remove ppa:unit193/encryption -y
$ sudo apt update
Next Steps
VeraCrypt is installed with a working encrypted volume you can mount/dismount on demand. From here:
- Script mount/dismount for volumes you access routinely, keeping the password out of shell history
- Use hidden volumes for plausible-deniability scenarios
- Store the volume file itself on encrypted or access-controlled storage as a second layer
For the full guide, visit the original article on Vultr Docs.
This article was originally published by DEV Community and written by Sanskriti Harmukh.
Read original article on DEV Community