DEV Community

Cover image for Installing VeraCrypt on Ubuntu 24.04
Sanskriti Harmukh for Vultr

Posted on with Aashish Chaurasiya Originally published at docs.vultr.com

Installing VeraCrypt on Ubuntu 24.04

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
Enter fullscreen mode Exit fullscreen mode

Encrypt Volumes via CLI

1. Generate some entropy for the encryption keys:

$ mkdir sample-dir
$ cd sample-dir
$ nano randomdata.txt
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode
  • --sizeM/K/G suffixes
  • --password — use 20+ characters for real volumes
  • --volume-type normal — vs. hidden for 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
Enter fullscreen mode Exit fullscreen mode

Read/write files normally inside /mnt while mounted.

Dismount It

$ cd
$ sudo veracrypt --dismount vctest.vc
Enter fullscreen mode Exit fullscreen mode

Or by mount point, slot, or all at once:

$ sudo veracrypt --dismount /mnt
$ sudo veracrypt --text --dismount --slot 1
$ sudo veracrypt --dismount
$ veracrypt --list
Enter fullscreen mode Exit fullscreen mode

Encrypt Volumes via GUI

On a desktop workstation:

  1. Open VeraCryptCreate Volume.
  2. Pick Standard VeraCrypt Volume or Hidden VeraCrypt Volume.
  3. Select File → choose a location/name (e.g. MyData) → Save → confirm path → Next.
  4. Pick encryption (AES) and hash (SHA-512) algorithms → Next.
  5. Set volume size → Next.
  6. Set a strong password; optionally enable PIM (default 0 = 458 header-key iterations).
  7. Pick a filesystem (FAT/NTFS/exFAT), move the mouse randomly to seed key generation, Format.
  8. Close the wizard.
  9. 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
Enter fullscreen mode Exit fullscreen mode

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.

Top comments (0)