How to export your Godot game for the web
Open Project > Export, add a Web preset, and leave Thread Support and Progressive Web App unchecked, both defaults since Godot 4.3. Threaded exports need SharedArrayBuffer, which requires cross-origin isolation headers most hosts including naughty.games do not send, and Progressive Web App installs a service worker, which naughty.games blocks on hosted builds. Export Project generates index.html, a .pck, a .wasm and a .js file; serve them over http to test, then zip them with index.html at the top and upload.
Last checked
What you need
- Godot 4.7, the current stable release, with the Web export template installed (Editor > Manage Export Templates).
- A GDScript project. Godot 4's web export currently does not support C# projects at all, so a C# game needs Godot 3 or a native export instead.
- No special setup for age gating: your build plays inside an iframe on naughty.games, behind the site's own age gate.
Godot 4 can only target WebGL 2.0 on the web, through its Compatibility rendering method; Forward+ and Mobile are not available in a browser. Most current desktop and Android browsers support WebGL 2.0 fine, but Safari has had more issues with it than Chromium-based browsers or Firefox, so it is worth testing your build in more than one browser before you publish, not just the one you develop in.
Export for the web
- Open Project > Export, click Add... and choose Web to create an export preset.
- Leave Thread Support unchecked. This has been the default since Godot 4.3, and it is also the setting the Godot docs call out as the most compatible with hosts like itch.io, Poki and CrazyGames.
- Leave Progressive Web App > Enable unchecked too. See the box below for why.
- Set the export path to a new folder and name the output file
index.html, since that is the name a plain web server loads by default. - Click Export Project. Godot writes
index.html, a.pckfile (your game's data), a.wasmfile (the engine itself), a.jsstart-up file, and a.pngboot splash image into that folder.
Why single-threaded, and why no Progressive Web App
A threaded Godot web export uses SharedArrayBuffer, which only works on a page that is cross-origin isolated. That requires the server to send both a Cross-Origin-Opener-Policy: same-origin header and a Cross-Origin-Embedder-Policy: require-corp header on every response. naughty.games does not send both of those together, and neither do most general-purpose hosts, so a threaded build simply will not start there. Godot's own docs describe single-threaded export, the default since 4.3, as the fix for exactly this problem, with the added benefit of working better on macOS and iOS too.
Godot's Progressive Web App option offers a workaround for hosts that cannot set those headers: it installs a service worker that simulates cross-origin isolation and also caches the game for offline play. naughty.games does not allow hosted builds to register service workers at all, so this workaround will not work here and should stay off.
Test it locally
Opening index.html directly from your file system will not work. The browser blocks the requests Godot's loader makes for the .wasm and .pck files when the page is loaded over file://, so the game gets stuck loading or never appears.
Serve the export folder over HTTP instead. From inside the folder, run:
python -m http.server 8000
Then open http://localhost:8000 and play through the build before uploading it anywhere.
Zip it for upload
- Zip the contents of the export folder, not the folder itself, so
index.htmlends up at the top level of the zip. - Stay under 250 MB unpacked and 2,000 files. A Godot web export is usually just the five files listed above, so this rarely becomes an issue unless your game streams a lot of video.
- Do not manually gzip or brotli the
.pckor.wasmfile before uploading. naughty.games serves whichever exact filename you upload, and Godot's generatedindex.htmland.jsrequest the plain file names (for examplegame.pck), so a renamedgame.pck.gzsimply will not be found. Upload the files exactly as Godot exported them.
Common problems
- Blank page or stuck on loading. You opened the export over
file://. Serve it from a local server, or upload it and preview it on naughty.games directly. - The game refuses to start and the browser console mentions SharedArrayBuffer. Thread Support was left on during export. Re-export with it off.
- Progress does not save between visits. Godot's
user://file system persists through the browser's IndexedDB. Check the player is not in a private/incognito window and is not blocking third-party storage for the naughty.games iframe. - A C# project will not export to Web. Godot 4's web export only supports GDScript; a C# project needs a different export target.
- No sound until the player clicks or taps. Browsers block autoplaying audio until a user gesture. This is expected, not a bug in your game.
- The game seems to freeze when a player switches tabs. Godot pauses
_process()and_physics_process()while a browser tab is inactive. This is a browser limitation, not something to fix in your project.
Publish it
Once the export runs cleanly from a local server, zip it with index.html at the top level (up to 250 MB unpacked and 2,000 files) and upload it to naughty.games, or send us an https URL if you would rather embed it. Review is usually about 2 working days, listing is free and non-exclusive, and any Patreon, Ko-fi, Steam or itch links inside the game earn you 100% of what they bring in. Head to /submit when you are ready.
Questions
- Which Godot version does this guide use?
- Godot 4.7, the current stable release. Single-threaded web export has been the default and recommended path since Godot 4.3.
- Can I use multithreading in my web export?
- Not usefully on naughty.games. Threaded exports need Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy headers, and naughty.games, like most hosts, does not send both, so a threaded build will refuse to start.
- Should I turn on Progressive Web App for offline play?
- No. It installs a service worker, and naughty.games blocks service workers on hosted builds, so leave it unchecked.
- Can I pre-compress my .pck or .wasm files before uploading?
- No, leave them as Godot exported them. naughty.games serves whatever filename you upload, and your index.html requests the plain file names, so a renamed game.pck.gz would not be found.
- Does Godot 4 support exporting C# projects to the web?
- No. Godot 4 web export currently only supports GDScript projects; C# is not supported on the web platform.
Sources
Free hosting, real players on phone and desktop, and a stats console.