# 4. Publishing a Web Build
Part of [[Web and WebGL Builds]]. Prev: [[3. Memory Compression and Exceptions]]. Next: [[5. Worked Example itch HTML5 Slice]].
Produce the player with the **Web** Build Profile ([[1. Build Profiles]], [[2. Command Line Builds and a Build Script]]). Output is a **folder** (an `index.html`, loader/framework JS, a `.wasm`, a `.data` file, and compressed siblings if you chose Gzip/Brotli). That folder is the artifact — not the Unity project.
## 4.1 Run it locally first
Serve the folder with a local HTTP server (any you already use). Opening `index.html` as a `file://` URL often fails for WASM and loaders. Confirm in Chrome or Firefox that the first scene starts, input works, and the official diagnostics overlay (if enabled) shows a heap you expected.
If the page never starts and you used Brotli or Gzip, turn on **Decompression Fallback** and rebuild before you blame the game code.
## 4.2 Hosting headers, when you control the server
Official Unity deploy/optimization docs discuss serving compressed files with the correct `Content-Encoding`. Follow the **current** 6000.5 "Deploy a Web application" / optimization pages when you own the server. This series does not invent header tables from memory. If you do **not** own the headers — itch is the usual classroom case — use **Decompression Fallback**.
## 4.3 itch.io HTML5 (official butler + page settings)
[[2. itch.io Pages and butler]] already covered `butler push`, channels, `--userversion`, and `--hidden`. Official butler [pushing](https://itch.io/docs/butler/pushing.html) page (still the source):
- Push the **Web output folder** to a channel whose name you choose (a name containing `html` or a dedicated `html5` / `web` channel — then **fix tags** on the Edit game page if needed).
- Official: tagging a channel as **HTML5 / Playable in browser** is done from the **Edit game** page after the first build is pushed.
- Official: the project kind must be set to **HTML**, not the default **Downloadable**.
Then Save the page. Draft or `--hidden` first, as in the publishing series. Download / incognito-play your own embed. **Do not put butler credentials in the repo.**
A desktop `windows` channel and an HTML5 channel are **two pushes**, two tags, not a clobber.
## 4.4 CI
Same rule as the publishing series: a green Web Build Profile, then butler with a secret, never from a failed job ([[3. GameCI and GitHub Actions]]). Version strings still agree ([[4. Versioning Branches and Checks]]).
## 4.5 Exercise
Build Release Web to `dist/web-0.1.0/`, serve it locally, and write the URL you will use on itch (user/game). Do not skip the local serve step.
## Sources
- https://itch.io/docs/butler/pushing.html
- https://docs.unity3d.com/6000.5/Documentation/Manual/class-PlayerSettingsWebGL.html
- [[2. itch.io Pages and butler]]