# Dependencies for Compiling Amnezia VPN Client: Complete Conan and CMake Guide

> Learn to compile Amnezia VPN client by resolving C++ dependencies with Conan and linking Qt 6 modules using CMake. Get the complete guide.

- Repository: [Amnezia VPN/amnezia-client](https://github.com/amnezia-vpn/amnezia-client)
- Tags: how-to-guide
- Published: 2026-07-28

---

**Compiling the Amnezia VPN client requires resolving C/C++ libraries through Conan and linking Qt 6 modules through CMake, with platform-specific packages defined in the repository's build configuration.**

The Amnezia VPN client source code (available at `amnezia-vpn/amnezia-client`) uses a two-stage dependency resolution system. Before compilation, third-party binaries and libraries are fetched via Conan, while the user interface and core logic depend on the Qt 6 framework. Understanding the exact dependencies listed in [`dev/conanfile.py`](https://github.com/amnezia-vpn/amnezia-client/blob/main/dev/conanfile.py) and [`client/CMakeLists.txt`](https://github.com/amnezia-vpn/amnezia-client/blob/main/client/CMakeLists.txt) is essential for a successful build on any supported platform.

## Conan-Managed Third-Party Libraries

The file [`dev/conanfile.py`](https://github.com/amnezia-vpn/amnezia-client/blob/main/dev/conanfile.py) declares all external C and C++ packages required before CMake configuration begins. These packages vary by target platform, but the core cryptographic and networking libraries remain consistent across all builds.

### Core Libraries for All Platforms

Every desktop and mobile target requires the following Conan packages:

- `libssh/0.11.3@amnezia` — SSH client for tunneling and remote control.
- `openssl/3.6.2` — TLS/SSL cryptography stack.
- `zlib/1.3.2` — Compression utilities.

These requirements appear in the Conan recipe alongside platform-conditional blocks.

### Windows-Specific Dependencies

For Windows builds, [`dev/conanfile.py`](https://github.com/amnezia-vpn/amnezia-client/blob/main/dev/conanfile.py) pulls additional native binaries and drivers between lines 22 and 32:

| Package | Purpose |
|---------|---------|
| `awg-windows/3.0.2` | Amnezia-Gateway native Windows binary. |
| `tap-windows6/9.27.0` | TAP driver for virtual network interface creation. |
| `win-split-tunnel/1.2.5.0` | Split-tunnel driver support on Windows. |
| `wintun/0.14.1` | Modern Wintun adapter for TUN interface access. |

### macOS and iOS Dependencies

Apple builds, including Network Extension targets, require framework-compatible packages declared at lines 34 through 38 of [`dev/conanfile.py`](https://github.com/amnezia-vpn/amnezia-client/blob/main/dev/conanfile.py):

- `awg-apple/3.0.1` — Apple-specific gateway binary.
- `hev-socks5-tunnel/2.15.0` (delivered as a framework) — SOCKS5 tunnel implementation.
- `openvpnadapter/1.0.0` — Adapter layer for OpenVPN on Apple platforms.

### Linux and Android Dependencies

Linux desktop and Android clients consume platform-optimized gateway implementations:

- **Linux / macOS desktop fallback**: `awg-go/3.0.1` provides the cross-platform gateway implementation for non-Windows desktop builds.
- **Android specific**: `amnezia-libxray/1.0.2` (XRay static library), `awg-android/3.0.1` (gateway binary), and `openvpn-pt-android/1.0.0` (OpenVPN portable transport).

Lines 39 through 42 of [`dev/conanfile.py`](https://github.com/amnezia-vpn/amnezia-client/blob/main/dev/conanfile.py) define the Android-specific requirements.

### Shared Protocol and Routing Libraries

Regardless of OS, every client and service build links against these common Conan packages:

- `amnezia-xray-bindings/1.3.0` — XRay core bindings for WireGuard and V2Ray protocols.
- `tun2socks/2.6.0` — User-space routing of IP packets to a SOCKS proxy.
- `openvpn/2.7.0` — OpenVPN client core.
- `v2ray-rules-dat/202603162227` — Pre-compiled rule set for V2Ray routing.

## Qt 6 Framework Requirements

The Amnezia VPN client UI is built with Qt 6. The [`client/CMakeLists.txt`](https://github.com/amnezia-vpn/amnezia-client/blob/main/client/CMakeLists.txt) file enumerates the required modules in a `PACKAGES` list and invokes `find_package(Qt6 REQUIRED COMPONENTS ${PACKAGES})`.

The mandatory Qt 6 modules are:

- **Core, Gui, Network, Xml** — Foundational Qt functionality and TCP/UDP networking.
- **RemoteObjects** — Inter-process communication between the UI and background service.
- **Quick, QuickControls2, Svg** — QML-based interface rendering and vector icon support.
- **Core5Compat, Concurrent, LinguistTools** — Qt 5 compatibility shims, multi-threading helpers, and translation tooling.

Additionally, the CMake logic at lines 11 through 42 of [`client/CMakeLists.txt`](https://github.com/amnezia-vpn/amnezia-client/blob/main/client/CMakeLists.txt) appends **Widgets** to the package list on Windows, macOS desktop, and Linux desktop for native widget support.

## Required Build Tools

Three primary tools must be present on the host system before invoking the build:

1. **CMake >= 3.25** — Declared in the top-level [`dev/CMakeLists.txt`](https://github.com/amnezia-vpn/amnezia-client/blob/main/dev/CMakeLists.txt) as the minimum required version.
2. **Conan** — Python-based package manager that resolves and downloads all third-party binaries.
3. **Git** — Required by the build system to embed the current commit hash into the compiled executable.

The root [`CMakeLists.txt`](https://github.com/amnezia-vpn/amnezia-client/blob/main/CMakeLists.txt) enforces the CMake version and initializes the Conan provider bridge.

## Step-by-Step Build Commands

With dependencies installed, compilation follows a standard Conan-then-CMake workflow.

### Install Conan Dependencies

From the repository root on the `dev` branch, run:

```bash
conan install . \
    -of build \
    -s os=Linux -s compiler=gcc -s compiler.version=13 \
    -s build_type=Release \
    -s arch=x86_64 \
    --settings=build_type=Release \
    --output-folder=build

```

Adjust the `-s os=…` and `-s arch=…` profile settings to match your target platform.

### Configure and Compile with CMake

Generate the build system using the Conan toolchain file, then compile the client target:

```bash
mkdir -p build && cd build

cmake .. \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_TOOLCHAIN_FILE=../build/conan_toolchain.cmake \
    -G "Ninja"

cmake --build . --target AmneziaVPN

```

The `conan_toolchain.cmake` file is generated automatically during the Conan install step and injects all library and include paths into the CMake configuration.

### Running the Compiled Client

After a successful build, launch the executable from the build directory:

```bash

# Linux / macOS

./AmneziaVPN

# Windows

.\AmneziaVPN.exe

```

## Key Build Configuration Files

Understanding the dependency tree is easier when referencing the exact files that declare them:

- **[`dev/conanfile.py`](https://github.com/amnezia-vpn/amnezia-client/blob/main/dev/conanfile.py)** — Defines all third-party Conan packages and platform-specific conditional requirements.
- **[`dev/CMakeLists.txt`](https://github.com/amnezia-vpn/amnezia-client/blob/main/dev/CMakeLists.txt)** — Top-level CMake configuration specifying CMake 3.25 minimum, project metadata, and Conan provider integration.
- **[`dev/client/CMakeLists.txt`](https://github.com/amnezia-vpn/amnezia-client/blob/main/dev/client/CMakeLists.txt)** — Specifies Qt 6 modules, compile definitions, and the client source list.
- **`dev/cmake/conan_provider.cmake`** — Bridges Conan with CMake by generating the toolchain file used during configuration.

## Summary

Compiling the Amnezia VPN client requires satisfying both Conan-managed binaries and Qt 6 framework modules before CMake configuration:

- The [`dev/conanfile.py`](https://github.com/amnezia-vpn/amnezia-client/blob/main/dev/conanfile.py) recipe declares **platform-specific gateway binaries** (Windows, Apple, Android, Linux), **cryptographic libraries** (`openssl/3.6.2`, `libssh/0.11.3@amnezia`), and **shared protocol cores** (`amnezia-xray-bindings/1.3.0`, `openvpn/2.7.0`).
- The [`client/CMakeLists.txt`](https://github.com/amnezia-vpn/amnezia-client/blob/main/client/CMakeLists.txt) requires **Qt 6 modules** including `Core`, `Network`, `Quick`, `RemoteObjects`, and platform-conditional `Widgets`.
- **CMake >= 3.25**, **Conan**, and **Git** are mandatory build-time tools.
- The standard workflow runs `conan install` first, followed by `cmake` configuration with the generated `conan_toolchain.cmake`, and finally `cmake --build . --target AmneziaVPN`.

## Frequently Asked Questions

### What package manager does the Amnezia VPN client use for C++ dependencies?

The project uses **Conan**, a Python-based C/C++ package manager. The full list of required libraries is declared in [`dev/conanfile.py`](https://github.com/amnezia-vpn/amnezia-client/blob/main/dev/conanfile.py), which Conan resolves before CMake configures the build.

### Which Qt modules are required to build the Amnezia VPN client?

According to [`client/CMakeLists.txt`](https://github.com/amnezia-vpn/amnezia-client/blob/main/client/CMakeLists.txt), the client requires `Core`, `Gui`, `Network`, `Xml`, `RemoteObjects`, `Quick`, `Svg`, `QuickControls2`, `Core5Compat`, `Concurrent`, and `LinguistTools`. Desktop builds additionally require the `Widgets` module for native UI elements.

### Do compilation dependencies differ between Windows and Linux?

Yes. While both platforms share core libraries like `openssl/3.6.2` and `libssh/0.11.3@amnezia`, Windows builds additionally require `awg-windows/3.0.2`, `tap-windows6/9.27.0`, `wintun/0.14.1`, and `win-split-tunnel/1.2.5.0` as declared in [`dev/conanfile.py`](https://github.com/amnezia-vpn/amnezia-client/blob/main/dev/conanfile.py). Linux desktop builds use `awg-go/3.0.1` instead.

### What is the minimum CMake version needed to compile Amnezia VPN?

The root [`dev/CMakeLists.txt`](https://github.com/amnezia-vpn/amnezia-client/blob/main/dev/CMakeLists.txt) requires **CMake 3.25 or newer**. This minimum version ensures compatibility with the modern CMake features and Conan provider integration used by the project.