VeraCrypt

Documentation >> Technical Details >> Building VeraCrypt From Source >> Linux Build Guide

This guide describes how to set up a Linux System to build VeraCrypt from source and how to perform compilation.
The procedure for a Ubuntu 22.04 LTS system is described here as an example, the procedure for other Linux systems is analogous.


The following components are required for compiling VeraCrypt:
  1. GNU Make
  2. GNU C/C++ Compiler
  3. YASM 1.3.0
  4. pkg-config
  5. wxWidgets 3.2 shared library and header files installed or wxWidgets 3.0 library source code
  6. FUSE library and header files

Below are the detailed procedure steps:

They can also be performed by running the below list of commands in a terminal or by copying them to a script:

sudo apt update
sudo apt install -y build-essential yasm pkg-config libgtk-3-dev
wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.0/wxWidgets-3.2.0.tar.bz2
tar -xf wxWidgets-3.2.0.tar.bz2
cd wxWidgets-3.2.0
mkdir gtk-build
cd gtk-build
../configure
make
sudo make install
sudo ldconfig
cd ../..
rm -r wxWidgets-3.2.0
rm wxWidgets-3.2.0.tar.bz2
sudo apt install -y libfuse-dev git
git clone https://github.com/veracrypt/VeraCrypt.git cd ~/VeraCrypt/src
make

Installation of GNU Make

  1. Open a terminal
  2. Execute the following commands:
    sudo apt update
    sudo apt install build-essential

Installation of GNU C/C++ Compiler

If the build-essential were already installed in the step before, this step can be skipped.

  1. Open a terminal
  2. Execute the following commands:
    sudo apt update
    sudo apt install build-essential

Installation of YASM

  1. Open a terminal
  2. Execute the following commands:
    sudo apt update
    sudo apt install yasm

Installation of pkg-config

  1. Open a terminal
  2. Execute the following commands:
    sudo apt update
    sudo apt install pkg-config

Installation of wxWidgets 3.2

  1. Open a terminal
  2. Execute the following commands:
    sudo apt install libgtk-3-dev
    wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.0/wxWidgets-3.2.0.tar.bz2
    tar -xf wxWidgets-3.2.0.tar.bz2
    cd wxWidgets-3.2.0
    mkdir gtk-build
    cd gtk-build
    ../configure
    make
    sudo make install
    sudo ldconfig
    cd ../..
    rm -r wxWidgets-3.2.0

Installation of libfuse

  1. Open a terminal
  2. Execute the following commands:
    sudo apt update
    sudo apt install libfuse-dev

Download VeraCrypt

  1. Open a terminal
  2. Execute the following commands:
    sudo apt update
    sudo apt install git
    git clone https://github.com/veracrypt/VeraCrypt.git

Compile VeraCrypt

Remarks:

  • If you have not installed wxWidgets like described here, you may have to modify the make statement to reference to the right file:
    make WXSTATIC=1
  • By default, a universal executable supporting both graphical and text user interface (through the switch --text) is built.
    On Linux, a console-only executable, which requires no GUI library, can be built using the 'NOGUI' parameter:
    make NOGUI=1 WXSTATIC=1 WX_ROOT=/usr/src/wxWidgets wxbuild
    make NOGUI=1 WXSTATIC=1
Steps:
  1. Open a terminal
  2. Execute the following commands:
    cd ~/VeraCrypt/src
    make
  3. If successful, the VeraCrypt executable should be located in the directory 'Main'.