Skip to Content
Run locallyInstallationBuild from sources

Build from sources

Prerequisites

Lightpanda is written with Zig  0.17.0. You will have to install it with the right version in order to build the project.

You need also to install Rust  for building deps.

Lightpanda also depends on v8  (through zig-v8-fork , our Zig wrapper around v8), Libcurl , html5ever  and SQLite . The build fetches them; the full list is in build.zig.zon.

You have to install some libs:

For Debian/Ubuntu based Linux:

sudo apt install xz-utils ca-certificates \ pkg-config libglib2.0-dev \ clang make curl git

pkg-config and libglib2.0-dev are only needed to build V8 from source (see Build and run).

For Linux with Nix , you can use the devShell:

nix develop

For MacOS, you need Xcode  and the following pacakges from homebrew:

brew install cmake

Build and run

Lightpanda embeds the V8 JavaScript engine. The build either compiles V8 from source, which takes several minutes, or uses a precompiled copy . To use the precompiled copy, run this once:

make download-v8

It downloads the V8 version Lightpanda needs into .lp-cache/. make build and zig build then use it instead of compiling V8. To use a V8 library stored elsewhere, pass its path with -Dprebuilt_v8_path=. If no precompiled V8 exists for your platform, the download fails: skip it, and the build compiles V8 from source.

Then build the entire browser with make build or make build-dev for debug env.

To build in debug mode and start the browser in one step, use Zig directly:

zig build run

Embed v8 snapshot

Lightpanda uses a v8 snapshot. make build builds and embeds it. With a plain zig build, it is created on startup instead, unless you embed it by using the following commands:

Generate the snapshot.

zig build snapshot_creator -- src/snapshot.bin

Build using the snapshot binary.

zig build -Dsnapshot_path=../../snapshot.bin

Embedding it moves the snapshot creation from each startup to build time, so the browser starts faster.

Telemetry

By default, Lightpanda collects and sends usage telemetry. This can be disabled by setting an environment variable LIGHTPANDA_DISABLE_TELEMETRY=true. For more on telemetry, see Confidentiality and telemetry.