How to Install VeraCrypt on Ubuntu 24.04
VeraCrypt is a free and open-source encryption solution developed to protect confidential information by encrypting individual files, folders, and entire drives. To leverage its robust security capabilities, install VeraCrypt on Ubuntu 24.04. As the enhanced continuation of TrueCrypt, VeraCrypt resolves previous security flaws while offering compatibility with up-to-date operating systems. It incorporates powerful encryption techniques and features like real-time encryption, hidden containers, and plausible deniability, making it a reliable tool for both personal and organizational data security.
This guide will walk you through the steps to install VeraCrypt on Ubuntu 24.04. You’ll learn how to manage encrypted containers via both the command line and graphical interface.
Requirements
- You have a running Ubuntu 24.04 environment.
Installing VeraCrypt on Ubuntu 24.04
Since VeraCrypt is not part of Ubuntu 24.04’s default repositories, you’ll need to include the trusted Unit 193 PPA to access the latest VeraCrypt packages. Follow these instructions to add the PPA and complete the installation process on your Ubuntu 24.04 system.
Step 1: Refresh the APT Package Index
$ sudo apt update
Step 2: Add the VeraCrypt PPA
$ sudo add-apt-repository ppa:unit193/encryption -y
Step 3: Update APT to Include the New PPA
$ sudo apt update
Step 4: Install VeraCrypt
$ sudo apt install veracrypt -y
Step 5: Confirm Installation
$ veracrypt --version
Expected output:
VeraCrypt 1.26.14
Encrypting Volumes with VeraCrypt
VeraCrypt provides a secure way to protect data by encrypting storage volumes. You can either encrypt newly created containers or external storage devices. Follow the instructions below to perform volume encryption on Ubuntu 24.04 using VeraCrypt.
Encrypting Volumes via Command Line on Ubuntu 24.04
Begin by making a new working directory:
$ mkdir sample-dir
Navigate into the newly created folder:
$ cd sample-dir
Open a text file to generate random key data:
$ nano randomdata.txt
Insert the following or similar text (make sure it’s at least 320 characters):
The quick brown fox jumps over the lazy dog near a serene lake under a golden sunset. Birds chirp in harmony while leaves rustle softly in the gentle breeze. A small wooden boat sways with ripples, carrying colorful flowers. Nearby, a child sketches the view, capturing the vibrant hues of nature in perfect tranquility. Amid the bustling city streets, a quaint café hides in a quiet alley, its aroma of freshly baked bread wafting through the air.
After saving and closing the file, create an encrypted volume using the following command (replace the sample password accordingly):
$ 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
Explanation of the parameters:
- –text: Runs the command without a GUI interface.
- –create: Defines the file name of the encrypted container (e.g., vctest.vc).
- –size: Specifies container size (e.g., 200M = 200 megabytes).
- –password: Sets the password. It’s recommended to use 20+ characters.
- –volume-type: Creates a standard (normal) encrypted volume.
- –encryption: Uses AES as the encryption standard.
- –hash: Applies SHA-512 for key derivation.
- –filesystem: Formats the volume with the ext4 file system.
- –pim: Defines the Personal Iterations Multiplier, 0 being the default.
- –keyfiles: Skips keyfiles by using an empty string.
- –random-source: Uses the randomdata.txt for key generation.
This command results in a 200MB VeraCrypt volume named vctest.vc
with AES encryption and SHA-512 hashing. The volume is formatted with ext4 and uses the random data as entropy for secure key creation.
Expected output:
Done: 100.000% Speed: 79 MiB/s Left: 0 s
The VeraCrypt volume has been successfully created.
Mounting the VeraCrypt Volume
Use the following command to mount the encrypted file to the /mnt
directory:
$ sudo veracrypt --text --mount vctest.vc /mnt --password EnterYourPassword1! --pim 0 --keyfiles "" --protect-hidden no --slot 1 --verbose
Explanation of the options:
- –mount: Defines the mount directory (e.g., /mnt).
- –slot: Uses slot 1 for mounting; VeraCrypt can mount multiple volumes this way.
- –verbose: Displays detailed information during execution.
Expected output:
Volume /home/example_user/dir1/vctest.vc has been mounted.
Switch to the mount directory to work with the encrypted content:
$ cd /mnt
You may now read, write, and manage files within this secure mount.
Check all currently mounted encrypted volumes:
$ veracrypt --list
Expected output:
1: /home/linuxuser/vctest.vc /dev/mapper/veracrypt1 /mnt
Unmounting VeraCrypt Volumes
Return to your home directory:
$ cd
Unmount a volume by specifying its file name:
$ sudo veracrypt --dismount vctest.vc
Or dismount using its mount directory:
$ sudo veracrypt --dismount /mnt
You may also dismount via its assigned slot number:
$ sudo veracrypt --text --dismount --slot 1
To unmount all VeraCrypt volumes:
$ sudo veracrypt --dismount
Re-check all mounted volumes to confirm they’re no longer active:
$ veracrypt --list
Expected output:
Error: No volumes mounted.
Using the VeraCrypt GUI on Ubuntu 24.04
Ubuntu 24.04 desktop users can utilize VeraCrypt’s graphical interface for a simpler and more visual approach to volume encryption. This user-friendly method eliminates the need to work with command-line instructions. Follow the guide below to access VeraCrypt and create encrypted containers via its GUI.
Launching the VeraCrypt GUI
- Click on the Applications menu on your Ubuntu desktop.
- From the list, select and open VeraCrypt.
- Inside the VeraCrypt window, click Create Volume.
Creating a New Encrypted Volume
- Choose either Standard VeraCrypt Volume (for a regular encrypted container) or Hidden VeraCrypt Volume (for concealed encryption).
- Click Select File to define the storage location for your encrypted file.
- Browse to the desired folder, provide a name like
MyData
for your volume, then click Save. - Review the selected file path and press Next.
Encryption Settings and Volume Size
- Choose your preferred encryption method (e.g., AES) and hashing algorithm (e.g., SHA-512).
- Click Next to set the size for the encrypted volume.
- Enter your preferred size and continue by clicking Next.
Setting the Password and PIM
- Create a strong and secure password to protect the encrypted volume.
- If desired, enable PIM (Personal Iterations Multiplier) for extra cryptographic protection.
- Set a custom PIM value, or use
0
which equals 458 iterations for header key derivation.
Selecting Filesystem and Finalizing Volume Creation
- Pick the file system type for the volume (e.g., FAT, NTFS, or exFAT).
- Move your mouse randomly within the VeraCrypt window to aid cryptographic strength, then click Format.
- When the volume is created, click Close to exit the wizard.
Mounting the Encrypted Volume
- Click Select File in the VeraCrypt main interface and choose the encrypted volume you created.
- Click Mount, then enter your password when prompted.
- Once successful, the mounted volume will appear in the VeraCrypt window and will be ready for use.
Optional: Removing VeraCrypt from Ubuntu 24.04
If you decide to remove VeraCrypt from your system, follow these steps to uninstall it from Ubuntu 24.04:
Step 1: Uninstall the VeraCrypt Package
$ sudo apt autoremove veracrypt -y
Step 2: Remove the VeraCrypt PPA
$ sudo add-apt-repository --remove ppa:unit193/encryption -y
Step 3: Update the Package Index
$ sudo apt update
Conclusion
VeraCrypt is now successfully installed on your Ubuntu 24.04 system. You’ve learned how to create and manage encrypted volumes using both the command line and graphical interface. With this program, you can securely encrypt files, folders, and drives to protect sensitive data on your workstation. For additional setup options and usage details, refer to the official VeraCrypt documentation.