This guide explains how to build Helium from source and test your changes locally. Building Helium involves downloading the Chromium source code, applying Helium patches, and compiling the browser.
- Prerequisites
- System Requirements
- Quick Start
- Detailed Build Instructions
- Platform-Specific Instructions
- Development Build vs Release Build
- Testing Your Changes
- Troubleshooting
- Python 3.8+: Required for Helium utility scripts
- Git: For version control and managing Chromium source
- Sufficient disk space: At least 100GB free (Chromium source is large)
- RAM: At least 16GB RAM (32GB recommended for faster builds)
- Time: Initial build can take 2-6 hours depending on your hardware
macOS
- macOS 11 (Big Sur) or later
- Xcode Command Line Tools:
xcode-select --install - Homebrew (recommended): https://brew.sh
Install required tools:
# Using Homebrew
brew install python3 git ninja
# Optional but recommended
brew install ccache # Speeds up rebuildsLinux
- Ubuntu 20.04+ or equivalent distribution
- GCC 11+ or Clang 15+
Install required packages (Ubuntu/Debian):
sudo apt update
sudo apt install -y \
python3 python3-pip git curl \
build-essential ninja-build \
libglib2.0-dev libnss3-dev \
libatk1.0-dev libatk-bridge2.0-dev \
libcups2-dev libdrm-dev libxkbcommon-dev \
libgtk-3-dev
# Optional but recommended
sudo apt install ccacheFor other distributions, refer to Chromium Linux build requirements.
Windows
- Windows 10 or later
- Visual Studio 2022 with C++ workload
- Windows 10 SDK
Install required tools:
- Install Visual Studio 2022 Community
- Include "Desktop development with C++" workload
- Include Windows 10 SDK
- Install Python 3
- Install Git for Windows
Note: Windows builds are more complex. Consider using WSL2 with Linux instructions for easier setup.
| Component | Minimum | Recommended |
|---|---|---|
| CPU | 4 cores | 8+ cores |
| RAM | 16 GB | 32 GB |
| Disk Space | 100 GB | 150 GB+ |
| OS | macOS 11, Ubuntu 20.04, Windows 10 | Latest versions |
For experienced developers who want to get started quickly:
# 1. Clone Helium repository
git clone https://github.com/imputnet/helium.git
cd helium
# 2. Set up build directory
export CHROMIUM_SRC="$HOME/chromium/src"
mkdir -p "$(dirname "$CHROMIUM_SRC")"
# 3. Download Chromium source and dependencies
python3 utils/downloads.py -i downloads.ini -c chromium_version.txt \
-o "$(dirname "$CHROMIUM_SRC")"
# 4. Download depot_tools (Chromium's build tools)
cd "$(dirname "$CHROMIUM_SRC")"
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH="$PWD/depot_tools:$PATH"
# 5. Sync dependencies
cd "$CHROMIUM_SRC"
gclient sync --no-history
# 6. Apply Helium patches, domain substitution, and resources
cd /path/to/helium
python3 utils/domain_substitution.py apply -r domain_regex.list \
-f domain_substitution.list -c /tmp/domsubcache "$CHROMIUM_SRC"
python3 utils/patches.py apply "$CHROMIUM_SRC" patches/series
python3 utils/generate_resources.py
python3 utils/replace_resources.py "$CHROMIUM_SRC"
# 7. Configure build
cd "$CHROMIUM_SRC"
gn gen out/Default --args="$(cat /path/to/helium/flags.gn)"
# 8. Build Helium
autoninja -C out/Default chrome
# 9. Run Helium
./out/Default/chrome # or chrome.exe on Windowsgit clone https://github.com/imputnet/helium.git
cd heliumThis repository contains patches, configuration, and utilities needed to build Helium.
Create a directory for the Chromium source:
# Choose a location with plenty of space
export CHROMIUM_SRC="$HOME/chromium/src"
mkdir -p "$(dirname "$CHROMIUM_SRC")"Note: The Chromium source tree will be very large (50GB+).
Helium uses the utils/downloads.py script to download the correct Chromium version:
python3 utils/downloads.py \
-i downloads.ini \
-c chromium_version.txt \
-o "$(dirname "$CHROMIUM_SRC")"What this does:
- Reads
chromium_version.txtto get the target Chromium version - Downloads the official Chromium source tarball
- Verifies checksums
- Extracts to the specified output directory
This will take some time depending on your internet connection (~2GB download).
Chromium uses Google's depot_tools for building:
cd "$(dirname "$CHROMIUM_SRC")"
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH="$PWD/depot_tools:$PATH"Add depot_tools to your PATH permanently:
# For bash
echo 'export PATH="$HOME/chromium/depot_tools:$PATH"' >> ~/.bashrc
source ~/.bashrc
# For zsh
echo 'export PATH="$HOME/chromium/depot_tools:$PATH"' >> ~/.zshrc
source ~/.zshrcChromium has many third-party dependencies. Use gclient to sync them:
cd "$CHROMIUM_SRC"
gclient sync --no-historyOptions explained:
--no-history: Shallow clone, saves time and space- This step downloads additional dependencies (another ~10GB)
This will take 30-60 minutes depending on your connection.
Remove test files and binaries not needed for building:
cd /path/to/helium
python3 utils/prune_binaries.py "$CHROMIUM_SRC" pruning.listThis saves several GB of disk space and reduces build time.
Replace Google domains and tracking URLs in the source:
python3 utils/domain_substitution.py apply \
-r domain_regex.list \
-f domain_substitution.list \
-c /tmp/domsubcache \
"$CHROMIUM_SRC"Parameters:
-r: Regex file with domain patterns-f: List of files to process-c: Cache directory (speeds up repeated runs)
Apply all Helium and ungoogled-chromium patches:
python3 utils/patches.py apply "$CHROMIUM_SRC" patches/seriesIf a patch fails to apply, you'll see an error message. This usually happens when:
- Chromium version doesn't match
- Source files were modified
- Patches are out of order
Generate Helium-branded resources:
# Generate resized icons
python3 utils/generate_resources.py
# Replace Chromium resources with Helium branding
python3 utils/replace_resources.py "$CHROMIUM_SRC"This replaces Chromium icons, logos, and branding with Helium's.
Configure the build using Helium's build flags:
cd "$CHROMIUM_SRC"
gn gen out/Default --args="import(\"//path/to/helium/flags.gn\")"Or manually specify flags:
gn gen out/Default --args='
is_debug=false
is_official_build=true
chrome_pgo_phase=0
enable_widevine=true
safe_browsing_mode=0
use_unofficial_version_number=false
google_api_key=""
google_default_client_id=""
google_default_client_secret=""
'Build types:
out/Default: Default configurationout/Debug: Debug build (slower, easier to debug)out/Release: Optimized release build
Build the browser using Ninja:
autoninja -C out/Default chromeOptions:
-C out/Default: Specify build directorychrome: Target to build (the browser)autoninja: Wrapper that optimizes Ninja for your system
Build time:
- First build: 2-6 hours (depending on CPU)
- Incremental rebuilds: 5-30 minutes (only recompiles changed files)
Tips for faster builds:
- Use
ccache: Caches compilation results - Use more CPU cores:
autoninjadoes this automatically - Use a faster SSD
- Close other applications to free up RAM
After building, run your locally built Helium:
cd "$CHROMIUM_SRC"
./out/Default/chromeOn macOS:
./out/Default/Chromium.app/Contents/MacOS/ChromiumOn Windows:
out\Default\chrome.exeAdditional setup:
-
After first build, create an Xcode project (optional, for IDE):
gn gen out/Default --ide=xcode open out/Default/all.xcodeproj
-
Code signing (for distribution):
# Set up signing identity in GN args gn gen out/Default --args=' is_official_build=true mac_signing_identity="Developer ID Application: Your Name" '
-
Create app bundle:
autoninja -C out/Default chrome # App is at out/Default/Helium.app
Creating AppImage:
For distribution, you may want to create an AppImage. Refer to the helium-linux repository for packaging scripts.
Desktop entry:
# Install locally (optional)
sudo cp out/Default/chrome /opt/helium/helium
sudo cp resources/branding/product_logo.png /opt/helium/Visual Studio integration:
gn gen out\Default --ide=vs
start out\Default\all.slnRunning with debugging:
out\Default\chrome.exe --enable-logging --v=1Good for development and testing:
gn gen out/Debug --args='
is_debug=true
symbol_level=2
enable_nacl=false
'Characteristics:
- Includes debug symbols
- No optimizations
- Easier to debug with GDB/LLDB
- Much larger binary size
- Slower runtime performance
For testing production performance:
gn gen out/Release --args='
is_debug=false
is_official_build=true
symbol_level=0
'Characteristics:
- Fully optimized
- Smaller binary size
- Faster performance
- Harder to debug
After creating a new patch:
-
Clean build directory:
rm -rf out/Default
-
Revert Chromium source:
cd "$CHROMIUM_SRC" git reset --hard HEAD git clean -fd
-
Reapply patches with your changes:
cd /path/to/helium python3 utils/patches.py apply "$CHROMIUM_SRC" patches/series
-
Rebuild:
cd "$CHROMIUM_SRC" gn gen out/Default --args="import(\"//path/to/helium/flags.gn\")" autoninja -C out/Default chrome
-
Test your feature:
./out/Default/chrome
Chromium has extensive test suites:
# Run unit tests
autoninja -C out/Default unit_tests
./out/Default/unit_tests
# Run browser tests
autoninja -C out/Default browser_tests
./out/Default/browser_tests --gtest_filter="YourTest*"Solution:
- Ensure Chromium version matches
chromium_version.txt - Check if patches are in correct order in
patches/series - Validate patches:
python3 devutils/validate_patches.py
Solutions:
- Close other applications
- Use fewer parallel jobs:
ninja -C out/Default -j4 chrome - Add swap space (Linux)
- Use a debug build which requires less RAM
Solution:
export PATH="$HOME/chromium/depot_tools:$PATH"Add to your shell rc file to make permanent.
Solution: Check your GN args syntax:
gn args out/Default --list
gn args out/DefaultSolutions:
- Use ccache:
export CCACHE_DIR=/path/to/cache - Use component build:
is_component_build=true(faster linking) - Only build what you need:
autoninja -C out/Default chrome(notall)
Solution:
- Check internet connection
- Try download again (script supports resume)
- Manually download from: https://commondatastorage.googleapis.com/chromium-browser-official/
macOS:
# Remove quarantine attribute
xattr -cr out/Default/Chromium.appLinux:
# Check library dependencies
ldd out/Default/chromeAfter successfully building Helium:
- Read the development guide: See index.md for how to create patches
- Make your first change: Try modifying a patch and rebuilding
- Join the community: Contribute to Helium's development
If you encounter issues not covered here:
- Check GitHub Issues
- Review Chromium and ungoogled-chromium documentation
- Ask in the community discussions
Happy building! 🚀