Step 72 of 82
← Home
βš™οΈ Phase: Advanced & Tools

Step 72 Compile Chrome in Linux

Why this step? Build Chromium on Linux for headless security scanning.

Compile Chrome in Linux

Guide on how to download the source code and build the Chromium browser from scratch on Linux (Debian/Ubuntu).

Note: Compiling Chrome takes a huge amount of RAM (16GB+) and Disk Space (100GB+).

Prerequisites

  • 64-bit Linux
  • 16GB+ RAM (Ideal: 32GB)
  • 100GB+ SSD Space (Building on HDD is extremely slow)
  • Git and Python 3

Step 1: Install Depot Tools

Google uses a custom set of scripts called depot_tools.

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH="$PATH:/path/to/depot_tools"

Step 2: Fetch the Code

Create a directory and fetch the source. This downloads ~30GB of data.

mkdir chromium && cd chromium
fetch --no-history chromium
cd src

Step 3: Install Dependencies

Chromium provides a script to install all needed build libs for Debian/Ubuntu.

./build/install-build-deps.sh

Step 4: Run GN (Generate Ninja)

Configure the build.

gn gen out/Default

To configure options (like release build vs debug):

gn args out/Default

Recommended args for release:

is_debug = false
symbol_level = 0

Step 5: Compile

Use autoninja (wrapper around Ninja) to build.

autoninja -C out/Default chrome

Wait Time:

  • High-end PC (32 cores): ~30 minutes
  • Standard PC (6 cores): ~4-6 hours
  • Laptop: Do not attempt.

Step 6: Run Chromium

Once finished, the binary is in out/Default.

./out/Default/chrome

Troubleshooting

"Linker OOM" (Out of Memory)

Link command kills process. Fix: Reduce parallel links in gn args:

concurrent_links = 2

"No such file" (boto)

Ensure depot_tools is in your PATH.