Run Playwright on Termux (Android) using system-installed Chromium — no browser downloads required.
Playwright’s official packages include browser binaries by default, but playwright-core does NOT.
This means:
- You must install a compatible Chromium yourself (via Termux)
- You must tell Playwright where that Chromium lives (
executablePath) - You must disable Playwright’s automatic browser downloads (
PLAYWRIGHT_BROWSERS_PATH=0)
This setup uses playwright-core to avoid browser downloads and keep your install lightweight, while running Playwright on Termux.
- Termux (Android)
- Node.js 18+
- Chromium installed from Termux’s X11 repo
.envfile withCHROMIUM_PATHandPLAYWRIGHT_BROWSERS_PATHset
pkg install x11-repo
pkg install chromium
git clone https://github.com/jobians/playwright-termux.git cd playwright-termux npm install # or pnpm install
PLAYWRIGHT_BROWSERS_PATH=0 CHROMIUM_PATH=/data/data/com.termux/files/usr/bin/chromium-browser
(Verify the path with which chromium-browser if needed)
npm start
const browser = await chromium.launch({ executablePath: process.env.CHROMIUM_PATH, headless: true, args: ['--no-sandbox', '--disable-gpu'] });
This tells playwright-core to use your installed Chromium instead of downloading one.
Full script in index.js.
PRs and issues welcome!
Happy scraping on Termux! 🐧🚀