Skip to content
Download all docs .md

Hosting Quick Start

Put a browser game online in about five minutes.

Before you start

You need:

  • A GameFuse account and a game. Note the game's ID.
  • A hosting plan for that game. Open your game in the dashboard, then Hosting, and pick a plan. Basic is $1 a month.
  • Your game's upload key. It is in the same Hosting tab (it is the same mpk_... key the Multiplayer tab shows).
  • Node.js on your computer, to run the gamefuse command.
  • A game that builds to a folder with an index.html at the top.

Hosting serves the files of a finished build. It does not run a server. See the Overview.

1. Install the command

npm i -g gamefuse

2. Build your game

Make the finished browser build. For a game made with Vite or webpack:

npm run build

This usually makes a dist folder. Unity, Godot and the others have their own export step. See Engine Guides.

3. Upload it

Put your upload key and game ID in a .env file in your project folder:

# .env  (keep it out of git: it holds a secret)
GAMEFUSE_UPLOAD_KEY=mpk_your_upload_key
GAMEFUSE_GAME_ID=123

Add .env to your .gitignore. Then run this in your project folder:

gamefuse hosting deploy dist

The command:

  1. Checks the folder: an index.html at the top, every file it points to is there, sizes inside your plan. See The Check.
  2. Opens the game in a hidden Chrome to make sure it loads without errors and draws something.
  3. Uploads it and makes it live.
  4. Prints the address:
Live at https://produce-conflict.gamefuse.co

You can also pass them each time instead: gamefuse hosting deploy dist --game 123 --key mpk_....

Keep the key out of your build

Vite and similar tools copy settings named VITE_... (or NEXT_PUBLIC_..., REACT_APP_...) into the game, where players can read them. Never give the upload key one of those names. GAMEFUSE_UPLOAD_KEY is safe. The check refuses an upload that contains a .env file.

4. Open it

gamefuse hosting open --game 123

Or open the address in any browser. Send it to your players.

5. Upload a new version

Build again and run the same deploy command. The new version replaces the old one. If something is wrong, go back to the previous upload:

gamefuse hosting rollback --game 123

Next