Maintained guide (checked 2026-09-01): This page installs the Linux build of Google Chrome inside an Ubuntu- or Debian-based WSL distribution. Microsoft now documents this exact package in its WSLg guide. The commands below keep GUI, headless automation, architecture, and security cases separate instead of treating every WSL installation as the same environment.
Table of Contents
First decide which Chrome you need
| Goal | Best starting point |
|---|---|
| Browse normally from Windows | Use the Windows Chrome installation; a second Linux browser may add no value. |
| Test a Linux Chrome binary or Linux fonts/libraries | Install Chrome inside WSL with this guide. |
| Run Playwright, Selenium, Puppeteer, or another automation tool | Prefer the browser version that the tool installs and supports; install system Chrome only when the project explicitly requires it. |
| Run a visible Linux window | Use WSL 2 with WSLg. Microsoft says WSL GUI applications are not supported on WSL 1. |
| Fetch or render pages without a window | Use Chrome Headless; WSLg is not required for the basic --headless test. |
1. Check WSL from PowerShell
Run these commands in Windows PowerShell, not inside Linux:
wsl --version
wsl --status
wsl --list --verbose
For a visible Chrome window, the distribution should report version 2. Microsoft currently lists Windows 10 build 19044 or newer, or Windows 11, as the WSLg prerequisite. Update WSL and restart its virtual machine if needed:
wsl --update
wsl --shutdown
wsl --shutdown stops every running WSL distribution, so save work in them first.
2. Check the Linux distribution and CPU architecture
Inside WSL, run:
cat /etc/os-release
dpkg --print-architecture
The package used below is an amd64 Debian package. Continue only when the architecture output is amd64 and the distribution uses Debian packages, such as Ubuntu or Debian. Do not force this package onto arm64, Fedora, openSUSE, or another incompatible system; use a browser package supported by that distribution or use Windows Chrome instead.
3. Download and install the official package
Microsoft’s WSLg guide uses Google’s stable-package URL. Work in the temporary directory so the download does not clutter the project:
cd /tmp
sudo apt update
sudo apt install --yes wget
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install --fix-broken ./google-chrome-stable_current_amd64.deb
Using apt with the local ./package.deb path lets the package manager resolve dependencies in the same operation. The older dpkg -i followed by apt install -f method can work, but it temporarily leaves an incomplete dependency state and is no longer necessary here.
4. Verify the installed package
command -v google-chrome
google-chrome --version
apt-cache policy google-chrome-stable
These three checks answer different questions: whether the shell can find the launcher, which browser version runs, and which package/repository version APT sees.
5. Run Chrome visibly with WSLg
On a current WSL 2 installation with WSLg:
google-chrome
If no window appears, do not immediately install a third-party X server. Recheck wsl --list --verbose, run wsl --update, then wsl --shutdown from PowerShell and start the distribution again. Microsoft’s WSLg troubleshooting guide should be the next reference for cannot open display errors.
6. Verify Headless Chrome
Chrome’s current headless command reference uses:
google-chrome --headless --dump-dom https://example.com
You can also make a screenshot or PDF:
google-chrome --headless --screenshot --window-size=1280,720 https://example.com
google-chrome --headless --print-to-pdf https://example.com
--dump-dom is more than curl: Chrome parses the page and runs scripts before serializing the DOM. Modern headless Chrome does not normally need the old --disable-gpu workaround.
Safe automation notes
- Run Chrome as the normal WSL user. Do not add
--no-sandboxas a generic fix; it removes an important security boundary. - Use a dedicated temporary profile for experiments instead of your daily browser profile:
“`bash
chrome_wsl_profile=”$(mktemp -d)”
google-chrome –headless –user-data-dir=”$chrome_wsl_profile” –dump-dom https://example.com
“`
- Never expose a remote-debugging port to
0.0.0.0or an untrusted network. A debugging endpoint can control the browser and read data available to its profile. - A page working in Windows Chrome does not prove it will work in WSL: proxy, DNS, certificate, font, GPU, filesystem, and architecture differences can matter.
Troubleshooting by symptom
Unable to locate package or dependency errors
Confirm that the downloaded filename exists and that the local path includes ./:
ls -lh /tmp/google-chrome-stable_current_amd64.deb
sudo apt update
sudo apt install --fix-broken /tmp/google-chrome-stable_current_amd64.deb
If dpkg --print-architecture is not amd64, stop; dependency repair cannot turn an incompatible binary into a native package.
cannot open display
Check that the distribution is WSL 2 and inspect the WSLg variables:
printf 'DISPLAY=%s\nWAYLAND_DISPLAY=%s\n' "$DISPLAY" "$WAYLAND_DISPLAY"
An empty or broken display environment affects visible mode, not necessarily headless mode. Diagnose WSLg before editing shell startup files or hard-coding display addresses.
Chrome exits during automation
Capture its own log first:
google-chrome --headless --enable-logging=stderr --v=1 --dump-dom https://example.com
Also test network resolution independently:
curl -I https://example.com
Do not treat --no-sandbox as the diagnostic. Record the exit text, Chrome version, WSL version, distribution, architecture, and automation-library version before changing flags.
Update or remove Chrome
sudo apt update
sudo apt install --only-upgrade google-chrome-stable
To remove the Linux package while leaving Windows Chrome untouched:
sudo apt remove google-chrome-stable
Review the command’s package list before confirming removal.
Official references
- Microsoft Learn: run Linux GUI apps with WSL, including Google Chrome installation
- Microsoft Learn: basic WSL commands
- Chrome for Developers: Headless command-line reference
Package URLs, Windows builds, Chrome flags, and WSL requirements can change. The commands and claims above were rechecked on 2026-09-01; verify the official pages again when reproducing the setup later.
