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

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:

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.

User