Hosting your game
Games on this site are played on servers run by their creators. You make the game here, then run the Brickyard server template on your own computer, VPS or home server. Players find your server on the game page and join from their browser.
How it fits together
- Build and publish. Edit your game in Studio (or upload a
.bky) and press Publish. - Copy the config. On Create, open your game's Servers panel. Every game already has its own host key, so the config is ready to paste.
- Run the server. It downloads your published game and checks in every 30 seconds, adding itself to the game's page. You never add servers by hand.
- Players join. When they press Play, this site gives them a one-time ticket. Your server confirms the ticket with the site, so it knows each player's username without ever seeing passwords.
When you publish a new version, running servers pick it up within a couple of minutes and tell connected players to rejoin.
1. Get the template
Download the server template and unzip it anywhere. It needs Node.js 18 or newer.
Download server template (.zip)
cd brickyard-host npm install cp config.example.json config.json
2. Fill in config.json
Copy the ready-made config from your game's Servers panel and save it as config.json.
{
"HUB_URL": "",
"HOST_KEY": "bkyh_…",
"PUBLIC_URL": "https://play.example.com",
"PORT": 7777,
"MAX_PLAYERS": 20
}
PUBLIC_URLis the address players' browsers use to reach your server. It must be https:// because this site is served securely (see below).GAME_FILE(optional) points to a local.bkyto run instead of the published version. The server reloads it when the file changes.ALLOW_GUESTS(optional, defaultfalse) lets people join without an account.- Every setting can also be an environment variable with the same name.
3. Start it
npm start
You should see Registered with hub. Your server appears on the game page as Server #1 (the next one is #2, and so on). Stop it with Ctrl+C and it disappears straight away; if it crashes, it drops off within 90 seconds. Run as many as you like with the same key: each one is listed separately.
Server numbers are the only thing players see, so the name you give a server is just for your own logs.
4. Make it reachable over HTTPS
Browsers block insecure connections from secure pages, so players need to reach your server at an https:// address. Any of these work:
- Cloudflare Tunnel (no port forwarding):
cloudflared tunnel --url http://localhost:7777, then use the tunnel URL asPUBLIC_URL. - Caddy on a server with a domain:
caddy reverse-proxy --from play.example.com --to localhost:7777. - nginx with a certificate, proxying
/and the/wsWebSocket to port 7777.
The template also includes a Dockerfile if you prefer containers.
What the server does
- Serves the game file at
/game.bkyand live status at/info. - Relays player positions, animations and chat over a WebSocket at
/ws(15 updates a second). - Forwards
net.send()messages from scripts to everyone else in the server.
Scripts run on each player's device. Use net.send / net.on in your scripts to keep shared things (like a door or a scoreboard) in sync between players.
Keys and safety
- Treat a host key like a password. Anyone with it can list a server for your game.
- Reset key in the Servers panel makes a new one and drops every server using the old key.