Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ladybirdBrowser/ladybird/llms.txt

Use this file to discover all available pages before exploring further.

Building Ladybird from source is the only way to run it during the current pre-alpha stage of development. The process follows a consistent pattern across all supported platforms: install system prerequisites, optionally configure a UI frontend, then run a single Python script that handles CMake configuration and compilation. This page covers every supported Unix-like system in detail, along with tips for choosing a UI, running debug builds, and attaching a debugger.

Prerequisites Overview

Before building, ensure the following are available on your system:
RequirementMinimum versionNotes
CMake3.30Must be on $PATH; install from Kitware apt on Ubuntu
C++ compilerclang-21 or gcc-14CI uses these versions; see find_compiler.py for minimums
NinjaAny recentBuild system driver
Qt66.xDefault UI on Linux; optional on macOS
nasmAny recentAssembler required by several library dependencies
Rust (via rustup)Stablerustup.rs
The CI pipeline uses clang-21 and gcc-14. If those exact versions are unavailable on your system, check Meta/Utils/find_compiler.py for the minimum compatible version your build system will accept.

Install System Dependencies

Base packages

sudo apt install autoconf autoconf-archive automake build-essential ccache cmake curl \
  fonts-liberation2 git glslang-tools libdrm-dev libgl1-mesa-dev libncurses-dev \
  libtool nasm ninja-build pkg-config python3-venv qt6-base-dev qt6-tools-dev-tools \
  qt6-wayland tar unzip zip

CMake 3.30 or newer (Ubuntu only)

The system CMake is often too old. Install from Kitware’s apt repository:
# Add Kitware GPG signing key
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null \
  | gpg --dearmor - \
  | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null

# Authorize the Kitware apt source
echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] \
  https://apt.kitware.com/ubuntu/ $(lsb_release -sc) main" \
  | sudo tee /etc/apt/sources.list.d/kitware.list

# Update and install
sudo apt update -y && sudo apt install cmake -y
The Kitware apt repository is Ubuntu-only. Debian users should obtain CMake from the CMake download page.

C++23-capable compiler

Audio support (optional)

sudo apt install libpulse-dev

Build Ladybird

1

Clone the repository

git clone https://github.com/LadybirdBrowser/ladybird.git
cd ladybird
2

Run the build and launch

The ladybird.py script is the simplest and recommended way to build and run Ladybird. It handles CMake configuration, dependency management (via vcpkg), compilation, and launch in one command:
./Meta/ladybird.py run
This builds a Release build. Debug symbols are available in both Release and Debug builds.
3

(macOS with Homebrew Clang) Set compiler environment variables

If you installed llvm@21 from Homebrew and want to use it instead of Xcode’s toolchain:
CC=$(brew --prefix llvm)/bin/clang \
CXX=$(brew --prefix llvm)/bin/clang++ \
./Meta/ladybird.py run

Build Variants

Debug Build

To build with debug-optimized settings (uses -Og, includes full debug symbols):
BUILD_PRESET=Debug ./Meta/ladybird.py run

Run a Specific Executable

To run the JS REPL, the WebAssembly REPL, or another bundled tool instead of the browser:
./Meta/ladybird.py run js
./Meta/ladybird.py run wasm

Start in GDB

./Meta/ladybird.py gdb ladybird

Choosing a UI Frontend

Ladybird supports multiple UI frontends. The default is chosen automatically based on platform:
FrontendPlatformNotes
AppKitmacOSDefault on macOS; native Objective-C UI
QtLinux, Windows (WSL2), othersDefault on non-macOS
GTK 4LinuxExperimental alternative
Android UIAndroidNative Android UI
To override the frontend, pass --gui to ladybird.py or set LADYBIRD_GUI_FRAMEWORK:
./Meta/ladybird.py run --gui=Qt

Extra Packages for GTK 4

Building with LADYBIRD_GUI_FRAMEWORK=Gtk requires additional packages because some vcpkg dependencies (e.g. gettext) must be rebuilt from source:
sudo apt install bison libxkbcommon-dev

Running Manually (Without ladybird.py)

The ladybird.py script ultimately invokes Ninja targets. You can run them directly from the build directory:
./Build/release/bin/Ladybird

Debugging

CLion

1

Build with debug symbols

Build using the Debug preset (either BUILD_PRESET=Debug ./Meta/ladybird.py run or select the Debug Build Type in CLion’s CMake profile).
2

Launch Ladybird normally

Run ./Meta/ladybird.py run ladybird from a terminal.
3

Attach CLion to the process

In CLion, choose Run → Attach to Process. If debugging layout or rendering issues, filter for WebContent and attach to that process. Breakpoints, stepping, and variable inspection will now work.

Xcode / Instruments on macOS

1

Build the project

./Meta/ladybird.py build
2

Apply debug entitlements

Allow Instruments to attach by codesigning with the debug entitlements plist:
ninja -C Build/release apply-debug-entitlements
# or manually:
codesign -s - -v -f --entitlements Meta/debug.plist Build/release/bin/Ladybird.app
3

Open Instruments

Launch Instruments.app and point it at the Ladybird app bundle. All profiling and tracing tools are now available.
Building the project with Xcode directly is not supported. The Xcode project generated by CMake does not properly execute custom targets and does not handle all target names in the project. Use Instruments for profiling and CLion for interactive debugging.

Troubleshooting

This error is a red herring produced by vcpkg, not Ninja itself. A dependency (often skia) failed to build. The real error appears earlier in the terminal output and in the log file identified in the CMake output, typically at Build/release/vcpkg-manifest-install.log.
error: building skia:x64-linux failed with: BUILD_FAILED
...
CMake Error: CMake was unable to find a build program corresponding to "Ninja".
Check the log file for the actual root cause, fix the underlying dependency issue (often a missing system library), then retry.
Verify your version with cmake --version. You need 3.30 or newer. On Ubuntu, install from Kitware’s apt repository (see the Debian/Ubuntu tab above). On other systems, download a binary from the CMake website.
Check with gcc --version. If the binary is named differently (e.g. gcc-13), specify it explicitly when invoking CMake:
cmake ../.. -GNinja -DCMAKE_C_COMPILER=gcc-13 -DCMAKE_CXX_COMPILER=g++-13
Add the following to /etc/ssl/openssl.cnf:
[openssl_init]
ssl_conf = ssl_sect

[ssl_sect]
system_default = system_default_sect

[system_default_sect]
MinProtocol = TLSv1.2
CipherString = DEFAULT@SECLEVEL=1
Options = UnsafeLegacyRenegotiation
When running --headless=text or --headless=layout-tree on a system using the llvmpipe software rasterizer (common on virtual machines), Ladybird may occasionally crash on exit with double free or corruption (!prev). Run with --force-cpu-painting to work around this.
If the build passes on CI, it should work locally. Try rebuilding the toolchain. If that does not help, try a clean repository. For persistent issues, ask in the #build-problems channel on the Ladybird Discord.

Build docs developers (and LLMs) love