Open Firefox in Linux: Commands and Desktop Methods
To open Firefox on Linux, click its icon in the application menu or run the command firefox in a terminal. Both work on virtually every mainstream distribution, because the launcher and the terminal command ultimately start the same executable. If the command returns "command not found," the browser is either not installed or installed under a different name, such as firefox-esr on Debian or a Flatpak or Snap package.
That short answer covers the common case, but Linux gives you many ways to launch the same program, and the differences matter when you are on a minimal system, a remote server, or a distribution that ships Firefox through a sandboxed package format. The sections below explain what actually happens when you launch Firefox, how to choose the right method for your setup, and what to do when nothing opens.
What Happens When You Launch Firefox
Firefox is a graphical application built on the Gecko engine. On Linux it talks to the display server through the X11 or Wayland protocol, so it needs a running graphical session to draw a window. If you run firefox from a terminal inside a desktop session, the command finds the binary, starts the process, and the window appears. The terminal may print warnings about missing libraries or sandbox features, but those messages are usually informational.
Firefox also uses a profile directory to store bookmarks, history, passwords, extensions, and settings. By default this lives under ~/.mozilla/firefox/ for a standard install. Sandboxed packages such as Flatpak and Snap keep their profiles in different locations, which is why a browser installed through one method does not see the bookmarks of a browser installed through another. Knowing which package you have explains most "my settings disappeared" situations.
The binary itself is typically a small launcher script rather than the full program. Distributions wrap the real executable so they can set environment variables, choose a library path, or hand off to a sandbox helper. That wrapper is why the same firefox command can behave differently across distributions.
Ways to Start Firefox From the Desktop
Desktop environments provide several launch points, and all of them read from the same set of .desktop files installed in /usr/share/applications/ or ~/.local/share/applications/.
- Application menu: Open the menu (often a grid or list icon in the panel or dock), find the Internet or Web category, and click the Firefox entry.
- Search launcher: Press the Super key, type "firefox," and press Enter on the highlighted result. GNOME, KDE Plasma, Xfce, and most other environments support this.
- Panel or dock pin: Right-click a running Firefox icon and choose Pin or Add to Favorites so it stays available.
- File manager: Double-click an HTML file if Firefox is set as the default handler, or right-click and choose Open With.
- Keyboard shortcut: Some environments let you assign a custom shortcut to the command
firefoxin their keyboard settings.
If the menu entry is missing but the terminal command works, the .desktop file is probably absent or not marked executable. Reinstalling the package usually restores it.
Opening Firefox From the Terminal
The terminal is the most reliable method because it shows errors directly. The basic command is simply:
- Open a terminal emulator such as GNOME Terminal, Konsole, or xterm.
- Type
firefoxand press Enter. - If the window opens, the binary is on your PATH and working.
- If you see an error, read it: "command not found" means not installed or not on PATH; a display error means no graphical session; a library error means a broken dependency.
Useful variations include firefox --new-window to force a fresh window, firefox --private-window for a private browsing session, and firefox URL to open a specific page. You can also pass a file path to open a local HTML document. Running the command with an ampersand (firefox &) returns the terminal prompt immediately, and prefixing it with nohup keeps the browser alive after the terminal closes.
To find out which binary and package you are actually running, use which firefox and readlink -f $(which firefox). On systems with Flatpak, the command may be flatpak run org.mozilla.firefox; on Snap systems it may be snap run firefox. Both usually also install a firefox wrapper that calls the sandboxed version.
Choosing an Installation Method
Firefox reaches Linux users through several channels, and the choice affects updates, sandboxing, and where your profile lives.
- Distribution package: Installed with apt, dnf, pacman, zypper, or similar. Updates arrive with system updates. Simple and well integrated, though some distributions now ship an ESR (Extended Support Release) build instead of the rapid-release version.
- Flatpak: Available from Flathub as
org.mozilla.firefox. Runs in a sandbox, updates independently of the system, and stores its profile under~/.var/app/org.mozilla.firefox/. - Snap: The default on Ubuntu. Also sandboxed, with its profile under
~/snap/firefox/. - Mozilla tarball: A downloaded archive you extract and run manually. Gives you the latest release without a package manager, but you handle updates yourself.
A common misconception is that these are different browsers. They are the same Firefox codebase; the packaging differs. The practical consequence is that switching methods can make your existing profile invisible, so export bookmarks or copy the profile folder before changing how Firefox is installed.
Common Problems and Fixes
When Firefox will not open, the cause is usually one of a few recognizable issues.
- "command not found": Confirm installation with your package manager, or check whether the package is named
firefox-esr. On Debian, the ESR package provides thefirefox-esrcommand. - "cannot open display": You are in a terminal without a graphical session, such as over SSH. Firefox needs a display; use SSH X11 forwarding or run it on the local machine.
- Firefox is already running but not responding: A stale lock in the profile directory can block startup. Close all instances, then remove the
lockand.parentlockfiles in the profile folder only after confirming no Firefox process remains. - Missing shared libraries: The error names the library. Reinstalling the package or installing the listed dependency resolves it.
- Sandbox errors under Flatpak or Snap: These often relate to permissions. Check the package's permission settings in your software center rather than disabling the sandbox.
- Wayland or X11 quirks: If the window misbehaves, try setting the environment variable
MOZ_ENABLE_WAYLAND=0to force X11, or the reverse, depending on your session.
Logs help: launching from a terminal shows the actual error instead of a silent failure, which is the single most useful diagnostic step.
Firefox Compared With Other Linux Browsers
Firefox is the default browser on many distributions and the most prominent fully open-source browser with an independent engine. Chromium-based browsers such as Chrome, Chromium, Brave, and Edge share the Blink engine, so they behave similarly to each other. Firefox's Gecko engine gives it a distinct rendering and extension ecosystem. On Linux, Firefox is generally available in every distribution's repositories, which is not true of every competitor. Users who prefer a lighter footprint sometimes choose text-based or minimal browsers, but those lack the extension support and sync features Firefox offers.
Frequently Asked Questions
Why does typing firefox do nothing?
If the command returns silently but no window appears, check that you are in a graphical session and that the process is not already running in the background. Running firefox again usually opens a new window in the existing process; if it does not, launch from a terminal to see the error output.
Is Firefox preinstalled on Linux?
On many desktop distributions, yes. Ubuntu, Linux Mint, Fedora, and others typically include it or offer it during installation. Minimal installs and some distributions ship only a browser-agnostic setup, so you may need to install it yourself.
How do I open a private window from the terminal?
Run firefox --private-window. You can add a URL after the flag to open that page privately, for example firefox --private-window example.com.
Where does Firefox store my profile on Linux?
For a standard install it is under ~/.mozilla/firefox/. Flatpak uses ~/.var/app/org.mozilla.firefox/ and Snap uses ~/snap/firefox/. Backing up that folder preserves bookmarks, passwords, and settings.
Can I open Firefox without a desktop environment?
Not in the usual sense, because it needs a display server. You can run it on a machine with a graphical session and connect remotely using X11 forwarding, or use a lightweight window manager, but a pure text console cannot display Firefox windows.
Why did my bookmarks disappear after reinstalling?
You likely switched installation methods, so Firefox is reading a different profile directory. Point the new install at the old profile or import a bookmark backup from the previous profile folder.