Go, Go, Godot!
  • 0
Godot and Netlify

Quickly deploying Godot games on the web with Netlify

January 22, 2023

When I think of video games, I generally still think of an application that is downloaded and runs on the client. Technically, that’s still the case with web-based exports from Godot Engine, since the web browser has to download the files before being able to run them.

I thought maybe I could just run the index.html file locally, but that does not work, as the web-based games with Godot Engine rely on modern browser features that require specific opt-in settings from the web server. If you try to just run the “index.html” file directly, you’ll be greeted with the following type of message instead of the game:

Hosting with Netlify is super simple. Create a new manual deployment, create a zip from the exported files, and upload it. It’ll show the same error message until Netlify is configured to allow the required features. Simply add a netlify.toml configuration file with the following contents:

# netlify.toml
[[headers]]
  for = "/*"
  [headers.values]
    Access-Control-Allow-Origin = "*"
    Cross-Origin-Opener-Policy = "same-origin"
    Cross-Origin-Embedder-Policy = "require-corp"

That’s all it took for a Godot Engine web export to come to life.

developer experienceweb
Posted in DX, Godot.
Share
PreviousDynamically finding and loading resources from the Filesystem for Android and Web Exports
NextIs Godot is the Linux of Game Engines?

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Related Posts

  • February 29, 2024

    Inventory System v1.12 available

    Crafting is here! The latest inventory system version is now available with the following features: The bug fixes:

  • October 27, 2022

    Projectiles going through collision objects

    Ever had the problem where you’re firing a bullet or some kind of projectile at high speeds, and it just goes right through the collision object, instead of hitting it? Here’s a weapon that fires a bullet at random velocities, to demonstrate the issue: The bullets impact the character in various places, rather than at …

  • November 16, 2023

    Creating a UDP peer-to-peer connection

    Creating network connections with Godot is simple — as long as you have the other party’s IP address, and there’s no NAT gateway involved. Unfortunately, that’s exactly the problem in most cases. You don’t know the other party’s IP, and these days, just about everyone is behind a combination wifi router/gateway/firewall with NAT. Conceptually, NAT …

  • November 27, 2024

    Toggling Visibility of Nested CanvasLayers

    I had a setup with nested CanvasLayer nodes. Toggling the visibility of the root CanvasLayer doesn’t hide any nested CanvasLayer nodes. My solution was to listen to the visibility_changed signal, find any CanvasLayer child nodes, and apply the same visibility to them.

    © 2025 GoGoGodot.io. All rights reserved.