Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To publish a Unity game online, create a Web build, then upload and serve the complete generated build output from a web server or hosting service. In Unity 6, start at File > Build Profiles > Web. Build and Run can preview the result locally, but a hosted URL is needed to make the game available to other people.

How do I build a Unity game for the web?

This workflow uses Unity 6. Older Unity tutorials may show File > Build Settings and a separate Switch Platform control; those labels and steps apply to older editor interfaces, so do not mix them with Unity 6’s Build Profiles workflow. Unity’s current Web build setup is documented in its Unity 6 Web build settings.

  1. Prepare the release content. Confirm which scenes and assets belong in the release, remove test-only content, and decide which browsers and devices you intend to support.
  2. Select Web. In Unity 6, open File > Build Profiles, select Web, and review the available Web settings, including browser selection, texture compression, development build, and code optimization.
  3. Choose settings for your goal. Use a development build when debugging or profiling. For a public release, select code optimization according to whether you need faster iteration, runtime speed, or a smaller build.
  4. Build to a named output location. Keep track of the directory containing the generated Web build files; that output, not the Unity project source, is what you deploy.
  5. Preview locally. Use Unity’s Build and Run workflow to preview the Web player through a local server. Opening the generated HTML file directly is not a dependable substitute: browser security rules can block local-file loading. See Unity’s Web build and run guidance.

Choose code optimization for the release goal

Unity 6 offers code optimization choices covering shorter build time, runtime-speed optimizations, runtime speed with link-time optimization, and disk-size optimization. A faster build can help during iteration; runtime-oriented settings favor execution speed, while disk-size optimization targets a smaller download. These are tradeoffs, not guaranteed performance or load-time improvements. Compare the resulting build on the project and devices you actually plan to support.

How do I publish a Unity Web build?

A Web build is a set of generated files, not a live website by itself. Upload the complete build output to a web server or hosting service and preserve its directory structure. Unity’s Web publishing documentation describes deployment and links to configuration examples for Nginx, Apache, and IIS.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Choose a server or hosting service. Make sure it can serve the generated files and configure it for the build’s compression format.
  2. Upload the full output. Transfer the entire generated build, not just the HTML entry page; required supporting files must remain available at their expected paths.
  3. Set compression response headers. If using native browser decompression, the server must return a matching Content-Encoding header for compressed files. Unity puts it plainly: “To let the browser handle decompression natively, you need to configure your web server to serve the compressed files with the appropriate http headers.”
  4. Open the hosted URL and test it. Check the actual production address rather than relying only on a local preview.

Choose gzip, Brotli, or no compression

Unity’s Web Publishing Settings offer gzip, Brotli, and Disabled. The right choice depends on download size, build time, and what your server can configure.

Format Download size and build time Server and browser considerations
gzip Unity identifies gzip as a default option that builds faster than Brotli. Unity describes it as natively supported across browsers over HTTP and HTTPS. For native decompression, configure the response header to match the compressed build.
Brotli Generally produces smaller compressed files, but takes longer to compress. Chrome and Firefox support native Brotli over HTTPS. Configure the corresponding response header when using native decompression.
Disabled No compression is applied by the Web build compression setting. There is no compressed payload from this setting that needs a matching compression response header.

Unity also documents a JavaScript decompression fallback for cases where server-level decompression is not configured. See its compression and server configuration guidance. Avoid assuming that a build configured for one format will work correctly if the server sends different or missing headers.

Why does my Unity Web build fail to load?

Start by opening the hosted build in the browser’s developer tools and checking the console and network requests. The error often points to a mismatch between the generated files, server behavior, or target browser.

  • The page opens but the player does not: confirm that all generated files were uploaded and that the server preserves their directory paths.
  • Compressed files fail to decode: check the Web Publishing Settings compression format and the server’s Content-Encoding response header. If they do not agree, configure the server appropriately or use Unity’s documented JavaScript fallback.
  • A local file will not load: serve it through Build and Run or another local web server rather than treating a directly opened HTML file as a reliable preview.
  • The browser is unsupported: check whether it meets Unity’s Web requirements and test the actual project in the browsers you intend to support.
  • The game starts but behaves poorly: test startup, input, audio, network behavior, and memory use on representative devices. A successful build or browser-capability check does not establish that a particular game performs well.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Which browsers and devices should I target?

Unity 6 lists desktop Web requirements that include a WebGL 2.0-capable, HTML5 standards-compliant, 64-bit browser with WebAssembly capability. The requirements page lists current versions of Chrome, Firefox, Safari, and Chromium-based Edge for desktop operating systems. Consult Unity 6 system requirements for the version-specific details.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Mobile browsers are a separate target: Unity’s system requirements list mobile browser requirements, but desktop compatibility does not establish that a game will behave or perform the same way on a phone or tablet. Features, memory use, input, and device hardware affect the result, so test the project on the actual target devices. The published requirements describe browser capabilities; they do not certify performance for an individual game.

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.