Skip to content

Instantly share code, notes, and snippets.

@mewset
Created January 5, 2026 19:59
Show Gist options
  • Select an option

  • Save mewset/44d4b5f21d3d00587a50190aa85cb692 to your computer and use it in GitHub Desktop.

Select an option

Save mewset/44d4b5f21d3d00587a50190aa85cb692 to your computer and use it in GitHub Desktop.
Playwright on Arch Linux - use system Chromium instead of bundled

Playwright on Arch Linux - just use system Chromium

So you're on Arch and Playwright is being a pain? Yeah, same. Here's what happens:

$ npm init playwright@latest
BEWARE: your OS is not officially supported by Playwright; installing dependencies for ubuntu24.04-x64 as a fallback.
Installing dependencies...
sh: line 1: apt-get: command not found
Failed to install browsers
Error: Installation process exited with code: 127

Playwright tries to use apt-get. On Arch. Good luck with that.

Even if you skip the auto-install and try manually:

$ npx playwright install chromium
BEWARE: your OS is not officially supported by Playwright; downloading fallback build for ubuntu24.04-x64.

And then when you try to run tests:

$ npx playwright test --ui
Error:
╔═══════════════════════════════════════════════════╗
║ No chromium-based browser found on the system.    ║
║ Please run the following command to download one: ║
║                                                   ║
║     npx playwright install chromium               ║
║                                                   ║
║ <3 Playwright Team                                ║
╚═══════════════════════════════════════════════════╝

You might try installing all the deps manually:

$ sudo pacman -S nss atk cups libxcomposite libxrandr libxdamage \
    libxkbcommon libxfixes libxext libxshmfence mesa alsa-lib \
    pango cairo gtk3 libdrm libxcb libx11 libxss libxtst
# ... all already installed, obviously

Still doesn't work. The bundled Chromium just doesn't play nice with Arch. Library mismatches, missing symbols, the usual Arch-vs-Ubuntu fun.

The fix

Stop fighting it. Just use the Chromium you already have:

sudo pacman -S chromium

(You should already have Chromium installed...right?....right?)

Then tell Playwright to use it in playwright.config.ts:

{
  name: "chromium",
  use: {
    ...devices["Desktop Chrome"],
    launchOptions: {
      executablePath: "/usr/bin/chromium",
    },
  },
},

That's it. Tests run, life is good.

If you need it to work on CI too

CI boxes are usually Ubuntu, so the bundled browser works fine there. Quick conditional:

import { existsSync } from "fs";

const chromiumPath = existsSync("/usr/bin/chromium")
  ? "/usr/bin/chromium"
  : undefined;

// then in your project config:
launchOptions: chromiumPath ? { executablePath: chromiumPath } : {},

Firefox works the same way

sudo pacman -S firefox
launchOptions: {
  executablePath: "/usr/bin/firefox",
},

WebKit though? No standalone browser on Arch. Just test that one in CI.


Tested on Arch (kernel 6.17), Playwright 1.52+, Chromium 138+.

@afifvdin
Copy link
Copy Markdown

will try this. hope my headache is gone

@MykolaVaskevych
Copy link
Copy Markdown

Thanks, but it would be a good idea to make the installation instructions for Playwright itself more straightforward.
AUR vs npm or just npx -- not clear which way to stick to due to errors, I assume no install and use npx, right?

@cinardoruk
Copy link
Copy Markdown

thanks a ton 👌

@CarloWood
Copy link
Copy Markdown

No idea what this all means... This project doesn't have a playwright.config.ts
It has a playwright.config.mjs, but the snippet given here doesn't make clear what to do with that.
The contents of playwright.config.mjs are:

import { defineConfig } from "@playwright/test";

export default defineConfig({
  testDir: "test/e2e",
  timeout: 15000,
  use: {
    browserName: "chromium",
    headless: true,
  },
});

So how do I change that to make it use my local firefox browser?

@jonashackt
Copy link
Copy Markdown

The local .ts file solution didn't really work for me, what worked was https://stackoverflow.com/questions/79908644/how-to-use-playwright-mcp-server-with-claude-code-on-arch-based-linux-manjaro But thanks for the hint with the system chromium, that was the right path!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment