Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →The “Missing X server or $DISPLAY” error means Chromium tried to open a visible browser window but could not reach a usable X display. If you do not need to see a window, launch Puppeteer in headless mode. If the task requires a visible browser, provide access to a running desktop display or run the process with a virtual display such as Xvfb. Setting DISPLAY to a value does not start a display server.
What the error means
Puppeteer launches Chromium, and Chromium needs a display when it is asked to run with a visible window on Linux. The error is a startup failure: the browser process cannot find or access an X server for that window. It does not, by itself, mean that a page has failed to load or that Puppeteer needs a different website URL.
A reported Linux case worked with headless: true and failed after the launch configuration was changed to headless: false. That contrast is a useful diagnostic: first check whether your script is requesting a visible browser and whether the environment has a display that the Chromium process can actually use.
Choose the fix that matches your task
| Approach | Use it when | What it requires | Important limitation |
|---|---|---|---|
| Headless launch | Your automation does not need a visible desktop window. | Configure the Puppeteer version installed in your project for headless operation. | It does not meet a test requirement that specifically depends on a visible desktop window. |
| Existing X display | You need Chromium to appear in a real desktop session. | A live display server and permission for Chromium to access it. | Setting a DISPLAY variable alone does not establish that a server is running or reachable. |
| Virtual display, such as Xvfb | You need a headful-style run but have no physical display attached, as often happens in automated environments. | An installed virtual X server and an environment-appropriate way to run the browser through it. | The exact command and setup depend on the operating system, container image and test harness. |
For ordinary server-side screenshots, PDF generation or page automation, choose headless mode unless the test itself needs a visible browser. When a window is a requirement, solve display availability rather than changing unrelated browser security flags.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware match#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
Fix it by using headless mode
If there is no reason to show a window, remove the display dependency by launching the browser headlessly. Check the API and behavior supported by the Puppeteer version installed in your project: defaults and supported modes can vary, so set the option explicitly instead of relying on an assumed default.
const puppeteer = require('puppeteer');
async function main() {
const browser = await puppeteer.launch({ headless: true });
try {
const page = await browser.newPage();
await page.goto('https://example.com');
await page.screenshot({ path: 'page.png' });
} finally {
await browser.close();
}
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
Save this as a JavaScript file in the project where Puppeteer is installed, replace the example URL with the page you need, then run it with Node.js. The explicit headless: true setting is the key change; the screenshot code is only an example of an automation task that does not require a visible desktop.
If the test is meant to validate window rendering, desktop interaction, or another behavior that requires a visible session, do not silently switch it to headless and treat that as an equivalent test. Use a real display or a virtual one instead.
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
Fix it when a visible browser is required
Connect to an existing desktop display
On a machine with a running X session, run the Node process in an environment that can reach that session and has permission to use it. The display setting tells a client where to look; it is not a service manager and cannot create a display. If the display exists but Chromium still cannot connect, investigate the process environment and display access permissions rather than repeatedly changing the value.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →In a container, the host desktop is not automatically available inside the container. A Puppeteer Docker report describes setting DISPLAY=:0.0 without resolving the error. A working setup needs an actual connection to a live display server and the required access, or it needs a virtual display running in the container. The right host-display wiring depends on the host, container runtime and security configuration; there is no single Docker setting established here as a universal fix.
Run through a virtual display
Xvfb provides a virtual X display, allowing display-dependent browser tests to run without a physical monitor or an attached real display. Chromium’s own debugging guidance describes its testing/xvfb.py helper as a way to run tests “without a real display attached.” That helper belongs to Chromium’s test harness; it is not a general-purpose Puppeteer command.
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
Install and use the Xvfb wrapper provided for your target operating system or container image. Some environments expose a wrapper such as xvfb-run; if yours does, use its local documentation to determine the right options and invoke your Node process through it. For example, the shape of such a command may be xvfb-run -a node script.js, but this only applies when that wrapper is installed and configured. Do not copy Chromium’s internal test helper as though Puppeteer required it.
For repeatable automation, put display setup in the same runtime or job that starts Chromium, and check that the Xvfb process remains available for the whole browser run. Merely installing a package is not the same as starting a virtual display.
Free tools Windows power users keep installed
One-click scans. No signup required.
How to diagnose “Missing X server or $DISPLAY” in Docker
- Confirm the launch mode. Inspect the Puppeteer launch options and any wrapper or test configuration that might request a visible Chromium window. If a visible window is not part of the requirement, explicitly choose headless mode.
- Decide whether the container needs the host desktop. If the browser must be visible on the host, the container must be connected to a running host display and granted the access it needs. A
DISPLAYstring inside the container is not that connection. - Prefer a virtual display for isolated automated runs. If you do not need to show Chromium on a developer’s desktop but your test requires a display, install and start an appropriate virtual display in the container environment.
- Check the actual runtime. Confirm that the expected display server or wrapper is installed and running in the same environment as the Node process. A wrapper available on the host may not be available inside the container.
- Keep the fix aligned with the error. Do not add
--no-sandboxas a display fix. It does not provide an X server and changes Chromium’s security posture.
If you still see the error, reduce the case to a minimal launch and record whether it is headless, whether a display server is running in that runtime, and whether that process can access it. Those details distinguish a launch-mode mistake from missing container display wiring.
Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
Common causes and fixes
| Symptom | Likely cause | Next step |
|---|---|---|
Headless execution succeeds, but setting headless: false produces the error. |
The visible launch needs an X display that is not available to Chromium. | Use headless mode if a window is unnecessary; otherwise provide a real or virtual display. |
The error continues after setting DISPLAY=:0.0 in Docker. |
The variable points to a display name, but the container may not be connected to a live server or permitted to access it. | Establish and verify the actual display connection, or use a virtual display in the container. |
| You need a display-dependent test on a server with no desktop. | There is no real display attached for Chromium to open. | Run the test in an environment with Xvfb or another suitable virtual display. |
You are considering --no-sandbox as a workaround. |
A display-availability error is being confused with a browser sandbox issue. | Fix the display path or use headless mode; do not change sandboxing to manufacture a display. |
| A copied Xvfb command or Chromium helper is unavailable. | The command may be specific to another operating system, image or Chromium test harness. | Use the wrapper supplied by your runtime and follow that wrapper’s documentation. |
Performance, reliability and security considerations
Headless versus a display-backed run
Headless mode removes the need to provision a display when a visible window is irrelevant. A display-backed run adds an environment dependency: the X server must be running, reachable and usable by the browser for the duration of the test. The evidence for this error establishes those setup differences, not a universal speed advantage or benchmark for one mode over another.
Keep display failures separate from other failures
This message points to display availability at browser startup. It is not proof that a target page, network request or selector is broken. Diagnose launch and display setup first; investigate page-level behavior only after Chromium starts successfully.
Do not weaken sandboxing to address X11
Disabling Chromium’s sandbox does not start X, attach a container to a host display, or grant display access. Because it changes the browser’s security posture, it should not be used as a generic response to this error.
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Or skip the browser setup
If your actual goal is to get a website screenshot rather than test a visible Puppeteer window, ScreenshotNeo offers a screenshot API and MCP server. A single GET request returns an image or PDF; the example below saves a WebP screenshot.
See the ScreenshotNeo API documentation for request options and response details.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
- Cookie and consent banners are accepted before capture, and more than 60 known consent platforms, newsletter popups and chat widgets are removed; each step can be turned off.
- Bot checks, blank pages and failed loads are never billed. Responses identify the page verdict and billing status with
X-Page-VerdictandX-Billedheaders. - An MCP server gives AI agents tools for screenshots, page information and PDF capture.
- The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots.
Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month without a card.
Frequently Asked Questions
Does this error mean Puppeteer is broken?
No. It indicates that Chromium could not reach a display for a visible-window launch. Check the launch mode and display availability before troubleshooting page code.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsCan I use Puppeteer headful in a CI job without a monitor?
Yes, if the job provides a virtual display such as Xvfb. The precise wrapper and setup depend on the CI image and operating system.
Is setting DISPLAY the same as starting Xvfb?
No. DISPLAY identifies where a client should look; Xvfb is a virtual X server that must be installed and running.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




