If you want players to open your project instantly in a browser, you need to export your Godot game to HTML5 — the web target that compiles your game to WebAssembly and WebGL so it runs with no download and no install. This guide walks the export step by step in Godot 4, fixes the errors that trip up almost every first web build, and ends with a folder you can zip and publish.
Two settings decide whether it works at all
Before you touch the export dialog, get these right, because most "my game exports but shows a grey screen" problems come from here.
- Use the Compatibility renderer. Godot 4's Forward+ and Mobile renderers run on Vulkan, and Vulkan does not exist in the browser. The web only runs the Compatibility method, which is built on WebGL 2. Open
Project > Project Settings > Rendering > Rendererand set the rendering method toCompatibility. If your game leans on Forward+ effects, expect to review shaders and post-processing that may not carry over. - Install matching export templates. Go to
Editor > Manage Export Templates > Download and Install. The template version must match your editor version *exactly* —4.3.stabletemplates for a4.3.stableeditor. A version mismatch is the number-one cause of a build that loads to a blank canvas and never starts.
Export step by step
Once the project is on Compatibility and the templates are installed, the export itself is short:
- Open
Project > Export. - Click Add… and choose Web. Godot creates a Web preset.
- Name the main file
index.htmlso any static host serves it automatically as the entry point. - Review the preset options: VRAM texture compression (For Desktop / For Mobile), Thread Support, Extensions Support, and Progressive Web App (which generates a service worker so the game can be "installed").
- Click Export Project, pick an empty folder, and keep the filename
index.html. - Godot writes
index.htmlplus a.jsloader, a.wasmengine, your.pckdata pack, an audio worklet, and icons. Keep every file together — your game is the *whole folder*, not just the HTML.
The cross-origin isolation trap (SharedArrayBuffer)
This is the single most common reason a Godot web build works from the editor but breaks everywhere else. By default, Godot 4 web builds use threads, threads need SharedArrayBuffer, and browsers only enable SharedArrayBuffer when the page is cross-origin isolated. That means the server must send two HTTP headers:
Cross-Origin-Opener-Policy: same-originCross-Origin-Embedder-Policy: require-corp
Miss them and you get a blank canvas plus a console error: SharedArrayBuffer is not defined. You have two ways out:
- Serve with the headers. Godot's own "Run in Browser" button sets them automatically, which is exactly why the game runs from the editor but dies on a plain
python -m http.serverthat sends no such headers. - Turn threads off. In the Web preset, disable Thread Support to build a single-threaded version that runs anywhere with no special headers. You trade some performance for maximum compatibility — a fine deal for most 2D games.
Test locally the right way
Do not open index.html with a file:// path. Module loading and the .pck fetch both fail under file://; you must serve over HTTP.
- Fastest: in the Export dialog, use the Run in Browser button. Godot starts a local server with the correct isolation headers already set.
- Manual: run any static server from inside the export folder. If Thread Support is on, that server *must* add the COOP and COEP headers or the game won't boot.
- Always watch the console (F12). It names the exact problem: wrong template version, missing headers, or an unsupported texture format.
Common issues and quick fixes
- Grey/black screen, loader stuck → template version mismatch; re-download templates for your exact editor version.
SharedArrayBuffer is not defined→ add the COOP/COEP headers, or disable Thread Support.- Nothing renders / shader errors → the project is not on the Compatibility renderer.
- No sound until the first click → browser autoplay policy; audio resumes on the first user interaction. This is normal, not a bug.
- Huge download, slow start → shrink textures, prefer Ogg over uncompressed audio, and remember the
.pckholds every asset you shipped. - Saved data disappears →
user://maps to the browser's IndexedDB; clearing site data wipes it, so never store anything critical there only.
Publish it as a browser game
Once local testing is clean, zip the export folder with index.html at the *root* of the zip — that archive is your distributable WebGL build. On The Gaming Nest you upload that build and it streams straight into the player: no download, no plugin, playable on the first click. For the full upload-and-publish walkthrough see publishing a WebGL game, and if you also build in Unity, exporting a Unity WebGL build covers the equivalent pipeline there.
Export it, test it, zip it, and put it in front of players today — publish your Godot WebGL build on The Gaming Nest and let people play it in the browser instantly.