$linuxjunkies
>

Install and Configure Firefox on Linux

Install Firefox on Linux via distro packages, Flatpak, or Mozilla's tarball, then set up profiles, Firefox Sync, and GPU hardware acceleration.

BeginnerUbuntuDebianFedoraArch8 min readUpdated June 7, 2026

Before you start

  • A working Linux desktop environment (X11 or Wayland)
  • sudo or root access for system-wide installation
  • Internet connection to download packages or the tarball
  • VA-API compatible GPU drivers installed for hardware acceleration steps

Firefox is available on Linux through at least three distinct installation paths, each with different trade-offs around update speed, sandboxing, and system integration. This guide walks through all three, then covers profile management, Firefox Sync, and enabling hardware-accelerated video — the settings most users miss after a fresh install.

Installation Methods

Distro Package Manager

The fastest way to get Firefox running. The package is maintained by your distro, updates arrive through your normal upgrade cycle, and it integrates with system themes and libraries. The downside: some distros (notably Ubuntu 22.04+) ship Firefox as a Snap by default, which has slower startup and sandboxing quirks.

Debian/Ubuntu (native .deb, not Snap): Ubuntu's default apt install firefox pulls the Snap. To get a proper .deb, add Mozilla's APT repository instead.

sudo install -d -m 0755 /etc/apt/keyrings
wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- \
  | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" \
  | sudo tee /etc/apt/sources.list.d/mozilla.list > /dev/null
sudo apt update && sudo apt install firefox

If the Snap version is already installed, remove it first: sudo snap remove firefox.

Fedora / RHEL / Rocky:

sudo dnf install firefox

Arch Linux:

sudo pacman -S firefox

Flatpak

The Flatpak build comes directly from Mozilla, updates independently of your distro, and runs in a strong sandbox. It is the right choice if your distro ships an old Firefox version or you want tighter containment. Wayland support works well here — the Flatpak sets MOZ_ENABLE_WAYLAND=1 automatically.

# Ensure Flatpak and Flathub are set up first
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak install flathub org.mozilla.firefox
flatpak run org.mozilla.firefox

To launch it like any other app, Flatpak installs a .desktop file automatically — it will appear in your application launcher immediately.

Mozilla Official Tarball

Use this when you need a specific release, want the Extended Support Release (ESR), or need Firefox on a distro without good package support. You own the update cycle entirely, so set a calendar reminder or use the built-in updater.

# Download from https://www.mozilla.org/firefox/all/ — replace URL for ESR or specific locale
wget -O firefox-latest.tar.bz2 \
  "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=en-US"
sudo tar -xjf firefox-latest.tar.bz2 -C /opt/
sudo ln -s /opt/firefox/firefox /usr/local/bin/firefox-mozilla

Create a .desktop launcher so it appears in your app menu:

cat > ~/.local/share/applications/firefox-mozilla.desktop << 'EOF'
[Desktop Entry]
Name=Firefox (Mozilla)
Exec=/opt/firefox/firefox %u
Icon=/opt/firefox/browser/chrome/icons/default/default128.png
Type=Application
Categories=Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;
EOF

Profile Management

Firefox stores all your settings, extensions, and history in a profile — a directory under ~/.mozilla/firefox/ (native/tarball) or ~/.var/app/org.mozilla.firefox/.mozilla/firefox/ (Flatpak). You can run multiple profiles, which is useful for separating work from personal browsing or for testing.

# Open the Profile Manager
firefox --ProfileManager

From the Profile Manager you can create, rename, or delete profiles. To launch a specific profile non-interactively:

firefox -P "WorkProfile" --no-remote

--no-remote forces a new process instead of reusing an existing Firefox window, which is essential when running two profiles simultaneously.

Back up a profile by simply copying its directory while Firefox is closed:

cp -a ~/.mozilla/firefox/xxxxxxxx.default-release ~/firefox-profile-backup/

Firefox Sync

Firefox Sync encrypts your bookmarks, history, passwords, open tabs, and extensions on Mozilla's servers using a key derived from your password — Mozilla cannot read your data. You need a free Mozilla account.

  1. Open Settings → Sync → Sign in to Sync.
  2. Create or log into your Mozilla account.
  3. Choose what to sync: bookmarks, history, passwords, open tabs, add-ons, and settings are all independent toggles.
  4. On a second device, sign in with the same account. Firefox will prompt you to confirm with a code displayed on the first device.

If you prefer self-hosting, Mozilla publishes syncstorage-rs, a Rust implementation of the Sync server you can run yourself. Point Firefox at it via about:configidentity.sync.tokenserver.uri.

Hardware Acceleration

Out of the box, Firefox may not use your GPU for video decoding, which wastes CPU cycles and causes choppy playback. The situation varies by driver stack.

Check Current Status

Navigate to about:support and look at the Graphics section. You want to see WebRender as the compositing backend, not the software fallback.

Enable VA-API Video Decoding

VA-API is the standard Linux hardware video decode interface. It requires working drivers (Mesa for AMD/Intel, or the NVIDIA proprietary driver with nvidia-vaapi-driver).

# Verify VA-API is working at the system level first
vainfo

If vainfo reports supported profiles, enable it in Firefox:

  1. Go to about:config.
  2. Set media.ffmpeg.vaapi.enabled to true.
  3. Set media.hardware-video-decoding.force-enabled to true (only needed on some systems).

Wayland Native Rendering

Running Firefox under XWayland works but loses some compositing efficiency. Force native Wayland:

# For the native/tarball install, set the environment variable
export MOZ_ENABLE_WAYLAND=1
firefox

To make it permanent for your user session, add the export to ~/.config/environment.d/firefox.conf:

mkdir -p ~/.config/environment.d
echo 'MOZ_ENABLE_WAYLAND=1' >> ~/.config/environment.d/firefox.conf

This file is read by systemd --user and applies to all graphical applications launched from your session. Log out and back in for it to take effect. The Flatpak version handles this automatically.

Verifying Your Install

firefox --version
# Output will look like: Mozilla Firefox 126.0

Check hardware acceleration is active: open about:support, scroll to Graphics → Decision Log and confirm HARDWARE_VIDEO_DECODING: available by default. Play a 1080p YouTube video and watch CPU usage — with VA-API working, decode load drops noticeably compared to software rendering.

Troubleshooting

Firefox won't start / crashes on launch

A corrupt profile is the most common cause. Start Firefox in safe mode to bypass extensions and custom settings:

firefox --safe-mode

If it starts cleanly, disable extensions one by one via about:addons to find the culprit. If it still fails, create a fresh profile with --ProfileManager.

Flatpak Firefox can't access files outside home directory

The Flatpak sandbox restricts filesystem access by default. Grant access to a specific path:

flatpak override --user --filesystem=/run/media org.mozilla.firefox

Hardware acceleration shows as disabled

Check that your VA-API drivers are actually installed. On Debian/Ubuntu with Intel graphics:

sudo apt install intel-media-va-driver vainfo

On AMD (Mesa covers this, but ensure Mesa is current):

sudo apt install mesa-va-drivers vainfo   # Debian/Ubuntu
sudo dnf install mesa-va-drivers libva-utils  # Fedora

After installing drivers, restart Firefox entirely — about:config changes alone won't apply if the VA-API device wasn't present when Firefox started.

tested on:Ubuntu 24.04Fedora 40Arch 2024.05Debian 12

Frequently asked questions

Why does Ubuntu install Firefox as a Snap and how do I avoid it?
Ubuntu 22.04 and later redirect 'apt install firefox' to the Snap package for easier Mozilla-managed updates. To get a native .deb, add Mozilla's official APT repository and install from there, removing the Snap version first.
What is the difference between the Flatpak and distro package builds?
The Flatpak comes directly from Mozilla, runs in a tighter sandbox, and updates independently of your distro. The distro package integrates more deeply with system libraries and themes but may lag a version or two behind Mozilla's releases.
Is Firefox Sync data private? Can Mozilla read my passwords?
No. Firefox Sync uses end-to-end encryption with a key derived from your account password using PBKDF2. Mozilla's servers store only ciphertext. If you want full control, you can also self-host the sync server.
How do I know if hardware acceleration is actually working?
Go to about:support and check the Graphics section. Look for WebRender as the compositor and 'HARDWARE_VIDEO_DECODING: available' in the Decision Log. You can also watch CPU usage drop during HD video playback when VA-API is active.
Can I run two different Firefox profiles at the same time?
Yes. Launch each profile with 'firefox -P "ProfileName" --no-remote'. The --no-remote flag forces a separate process, preventing the second launch from opening a tab in the already-running instance.

Related guides