How to Install Firefox in WSL: Quick Setup Guide
In this article
Yes, you can run the full Linux version of Firefox inside WSL (Windows Subsystem for Linux) with a single apt install command, provided you have WSL 2 and WSLg on Windows 11 or a recent Windows 10 build, which lets Linux GUI apps open in their own windows on your Windows desktop. If you are on an older setup, you can still install it and launch it with an X server running on Windows. This guide covers the straightforward path first, then the fallback.
What You'll Need
- A Windows 10 or 11 PC with WSL 2 installed and a Linux distro (Ubuntu is used in the examples, but the steps are similar for Debian and others).
- WSLg support for GUI apps. This is built into WSL on Windows 11 and on supported Windows 10 builds; run
wsl --versionin PowerShell to check that WSLg is listed. - Sudo access in your Linux user account (the default WSL user usually has this).
- Enough free disk space for the browser, roughly 500 MB or more.
Step-by-Step
- Open your WSL terminal. Click Start, type the name of your distro (for example "Ubuntu"), and press Enter. Alternatively, open PowerShell or Windows Terminal and run
wsl. - Update your package lists. Run
sudo apt updateand enter your password if asked. This refreshes the list of available software so you get a current version of Firefox. - Upgrade existing packages (recommended). Run
sudo apt upgradeand confirm with Y when prompted. This is not strictly required, but it avoids dependency conflicts during the install. - Install Firefox. Run
sudo apt install firefoxand confirm with Y. On Ubuntu, this may pull in the Firefox snap package rather than a traditional deb, depending on your Ubuntu version; the terminal will show which. Either way, the command finishes with Firefox installed. - Launch it. Type
firefoxin the WSL terminal and press Enter. On a WSLg-enabled system, a normal Firefox window opens on your Windows desktop after a few seconds of first-run startup. - Pin it for convenience (optional). While Firefox is running, right-click its icon in the Windows taskbar and choose to pin it, so you can launch it without opening the terminal first. You can also create a Windows shortcut that runs
wsl firefox. - Verify it works. Browse to any site, then check that your Linux home directory is reachable: in Firefox's address bar type
file:///home/followed by your username to confirm you can open local Linux files.
Common Mistakes
Skipping sudo apt update is the most common cause of "unable to locate package firefox" errors, especially on a freshly installed distro. Another frequent mistake is running the install without sudo, which fails with a permissions error. People also sometimes expect Firefox to appear in the Windows Start menu automatically; it does not, unless you pin it or create a shortcut yourself. Finally, launching Firefox with firefox.exe or other Windows-style commands from inside WSL will not start the Linux version; just type firefox.
Tips
- Keep Firefox updated through the normal Linux update routine:
sudo apt update && sudo apt upgradekeeps the browser current along with the rest of the system. - If Firefox feels slow to start the first time, that is normal; the first launch builds caches. Later launches are faster.
- Files you download land in your Linux home folder by default. You can reach it from Windows Explorer by typing
\\wsl$in the address bar, then your distro name. - Running Firefox in WSL is genuinely useful for testing sites in a Linux browser environment without a virtual machine, and for using Linux-only web tooling.
- If you prefer a different distro, the same apt commands work on Debian; Fedora-based distros use
sudo dnf install firefoxinstead.
Troubleshooting
"Unable to locate package firefox": run sudo apt update first. If it still fails, check that you are actually in a Linux shell and not PowerShell.
Firefox launches but no window appears: this usually means GUI support is missing. Run wsl --version in PowerShell and look for WSLg in the output. If it is missing, run wsl --update from PowerShell, then restart your distro. On systems where WSLg is unavailable, you would need a third-party X server on Windows and to set the DISPLAY variable, but check WSLg first since it handles this automatically.
Blank or garbled window: close Firefox, run wsl --shutdown in PowerShell, reopen your distro, and try again. A full WSL restart resolves most rendering glitches.
Slow performance: make sure you are on WSL 2, not WSL 1. In PowerShell, run wsl -l -v; if the version column shows 1, convert with wsl --set-version Ubuntu 2 (replace Ubuntu with your distro name). This can take several minutes.
Firefox snaps back closed or crashes on launch: run it from the terminal with firefox so any error message is visible, and check that your user profile folder under ~/.mozilla was not corrupted; renaming that folder (which resets your bookmarks and settings, so back it up first) gives Firefox a clean start.
Frequently Asked Questions
Does this install the Windows version of Firefox?
No. The apt install puts the Linux build of Firefox inside your WSL distro. Your Windows Firefox, if you have one, is a completely separate installation with its own profile and bookmarks.
Can I use this Firefox as my everyday browser?
It works, but it is slower than native Windows Firefox because the graphics pass through the WSL layer. It is best for development, testing, and Linux-specific workflows rather than daily browsing.
Will my bookmarks and passwords sync?
Yes, if you sign in to a Firefox account inside the WSL copy, sync works the same as anywhere else and brings over your bookmarks, history and passwords.
Do I need an X server like VcXsrv?
Not on WSLg-enabled systems, which includes Windows 11 and supported Windows 10 builds with an up-to-date WSL. An X server is only the fallback for older setups without WSLg.
How do I uninstall it later?
Run sudo apt remove firefox in your WSL terminal. Add --purge if you also want to remove leftover configuration files.
Does this work on WSL 1?
Installation works, but GUI apps need WSL 2 with WSLg (or an X server). If you are on WSL 1, convert to WSL 2 with wsl --set-version as described in the troubleshooting section.