← Back to section · Tutorials & Labs

Lab Setup Checklist: Building a PQC Development Environment on Linux from Scratch

A tick-box checklist for setting up a PQC lab environment: verify the distribution and CPU instruction sets, install the toolchain and cryptography dependencies item by item, and finish with a set of version checks so environment drift never contaminates your results.

Published 22 November 2026 · 6 min read · PQ Frontier

Lab Setup Checklist: Building a PQC Development Environment on Linux from Scratch
AI-generated site artwork
Video explainer · Lab setup: build and troubleshoot

Post-quantum cryptography (PQC) experiments are far less forgiving of the environment than ordinary programming exercises. The same algorithm code can run several times slower on a machine that falls back to scalar code paths instead of AVX2-optimized ones, and a different OpenSSL major version changes whether oqs-provider loads at all and which TLS named groups are visible. If the environment itself is not pinned down, every number you measure later carries a question mark. This tutorial gives you a checklist you can tick off item by item to build a reproducible PQC development environment on a clean Linux machine (physical or virtual), ending with a set of verification commands.

Step 1: Verify the System and Hardware Foundation

Pick a long-term-support release that is still within its support window, such as Ubuntu 22.04 / 24.04 LTS or Debian 12. The reason is practical: projects like liboqs and oqs-provider cover mainstream LTS distributions in their documentation and continuous integration, and community experience concentrates on those platforms. Confirm the version with lsb_release -a or by reading /etc/os-release — do not rely on memory.

For the CPU, check the vector instruction sets. Run grep -o 'avx2\|avx512f\|bmi2' /proc/cpuinfo | sort -u to see what the machine exposes. liboqs probes CPU capabilities at build time and enables the optimized implementations that match; if the experiment runs inside a virtual machine, make sure the virtualization layer is not masking the host’s instruction sets — the flags visible inside the guest are what the experiment can actually use. Give the machine at least 4 GB of RAM (parallel compilation of large C projects appreciates more) and reserve about 10 GB of disk for sources, build trees and packet captures. Record these parameters, together with the distribution version, on the first page of your lab notebook.

Step 2: Install the Base Toolchain Item by Item

On Debian / Ubuntu systems, one command installs the build essentials:

sudo apt update
sudo apt install -y build-essential cmake ninja-build git \
  python3 python3-pip python3-venv libssl-dev pkg-config

Why each item is on the list: build-essential provides gcc, g++ and make, the prerequisite for compiling any C code; cmake and ninja-build are the standard pairing on liboqs’ official build path — without Ninja the build commands change shape and your lab notes stop matching the official documentation; git is not only for fetching sources, it is also what you will use for version bisection and commit pinning later; python3-venv guarantees that Python bindings and scripting experiments live in an isolated environment instead of polluting the system Python; and libssl-dev provides the OpenSSL headers and development libraries — note that the -dev package is a different thing from the runtime library, and with only the openssl command-line tool installed, compilation fails at link time with a missing openssl/evp.h. On Fedora / RHEL systems the equivalent is sudo dnf install -y gcc gcc-c++ make cmake ninja-build git python3-devel openssl-devel: different package names, same checklist logic.

Step 3: Confirm the Cryptography Dependency Versions

The single most important version in a PQC lab is OpenSSL. oqs-provider requires OpenSSL 3.x; if the system still ships 1.1.x, the TLS experiments that follow are impossible. Immediately after installing, run openssl version to check, and note the path it resolves to: which openssl tells you whether you are calling the system build or a leftover hand-compiled one. Multiple coexisting OpenSSL versions are a classic source of contamination on lab machines — you compile against one version and load another at runtime, and the symptoms are bizarre. The discipline in this tutorial: keep exactly one primary OpenSSL per lab machine; any hand-built version goes into its own prefix and is referenced by explicit paths, never overwriting system files.

On the Python side, use a virtual environment from day one: create it with python3 -m venv ~/venvs/pqc, activate it, and only then install packages. When you later install liboqs-python, cryptography and friends, the version combination affects only this environment, and starting over means deleting one directory instead of scrubbing the system Python.

Step 4: Run the Verification Commands and Save the Output

A finished setup is not a feeling; it is a verification run. Save the output of the following commands verbatim into an environment.txt in your lab directory:

cat /etc/os-release | head -3
gcc --version | head -1
cmake --version | head -1
ninja --version
python3 --version
openssl version
grep -o 'avx2' /proc/cpuinfo | head -1

Every command must produce output and the versions must match expectations: gcc and cmake should be no older than the distribution’s defaults (an ancient cmake is a frequent cause of liboqs build failures), and avx2 must be found for the vector code paths to be available. Add one smoke test: openssl list -providers should list the default provider, confirming the OpenSSL installation is complete. The value of this record shows up weeks later: when an experiment produces an unexpected result, the first step is to open this file and check whether some upgrade quietly changed the environment.

Items That Are Easily Missed

Beyond the main list, a few components look minor yet block experiments when missing; install them as well and record them in the verification file. First, capture and network tools: wireshark, tshark, tcpdump, iproute2 and iperf3 — all of them are needed later for handshake captures and link experiments, and installing them mid-experiment breaks the flow. Second, text and archive utilities: jq for processing JSON-formatted test output, and unzip, file and tree, which show up constantly when organizing experiment material. Third, editor and session tools: an editor you are fluent in seems unrelated to experiments, but debugging means jumping constantly between configuration files and logs, and clumsy tools directly slow down localization. Fourth, time synchronization: confirm the system’s NTP synchronization is enabled — TLS certificate validity checks and log timestamp alignment both depend on an accurate clock, and clock drift after a VM wakes from suspend is a hidden source of failure in certificate experiments. Add these four and the environment is genuinely complete.

One more habit: after installing each new group of components, re-run the verification commands and update the record file, instead of back-filling the record when an experiment breaks. The environment checklist is a living document, and its value is proportional to how often it is updated.

Wrapping Up

The order of this checklist is also the order of troubleshooting: foundation first (system and CPU), then the toolchain, then the cryptography dependencies, and finally freeze the state into text with the verification commands. The tutorials that follow — building liboqs from source, freezing an environment into a Docker image, setting up a local test CA — all build on this environment. If a later step fails to build, walk this checklist again before reading build logs; most problems have their answer here.

Tags: LinuxEnvironment SetupToolchainChecklist