Learn

Can you make a multiplayer web game without a server?

Updated 2026-11-23

Short answer: not without any server. Browsers can't open connections to each other on their own: even peer-to-peer WebRTC needs a server to introduce players and, for some networks, a relay to carry the traffic. What you can do is make a multiplayer web game without writing or running a server. A hosted relay such as Joinable runs the rooms for you: you add an async script tag and a few hooks, and your game ships as static files like any other web page.

Why a browser game always needs some server

A web page can make outgoing connections only. It can't listen for incoming ones, and most players sit behind home routers and mobile networks that wouldn't let a stranger in anyway. So two browsers that want to talk need something both can reach:

The question isn't "server or no server". It's whose server, and how much of the game it knows about.

The options

You writeYou runWhat's still a server
Peer-to-peer WebRTC (with PeerJS or similar)Signalling, rooms, netcode, reconnects, lobby UIA signalling server, and a TURN relay for players who can't connect directlySignalling and TURN
A backend-as-a-service (a realtime database, pub/sub)Netcode on top of shared documents or channels; lobby UINothing, but you pay per read, write or connectionThe provider's database
A server framework (Colyseus, Nakama)Server room code and client codeTheir server, or their cloudYour game server
A hosted game SDK (PlayroomKit, Photon, Joinable)Client code: hooks or state callsNothingThe provider's relay

Peer-to-peer WebRTC

WebRTC lets two browsers exchange data directly, which sounds like "no server". In practice:

More on the protocols: WebSockets vs WebRTC.

A backend-as-a-service

Realtime databases are a quick way to share a small state between players: a board game's board, a lobby list. They're built around documents and channels rather than game ticks, and their pricing usually counts reads, writes or connections, so check what 20 updates a second per player would cost before you build a fast game on one. You still write the netcode, the lobby and the session logic yourself.

A hosted relay or game SDK

Here the provider runs the rooms. You write only client code. They differ in how much of the session they own: some give you shared state and leave the screens to you; Joinable runs the whole session around play: the invite, quick match, waiting room, shared 3-2-1, live standings, one results screen, rematch and reconnects. Your game supplies four hooks: start a round from a shared seed, report your player, draw the others, and say when you've finished.

What "no server" honestly means with Joinable

There is a server. It's ours, not yours:

<script async src="https://relay.getjoinable.com/sdk.js" data-connect="invite"></script>
(window.JoinableQ = window.JoinableQ || []).push((Joinable) => {
  Joinable.game({
    profile: 'score',
    start({ seed }) { newRound(seed); },
    go() { running = true; },
    local() { return { score }; },
    stop() { showMenu(); },
  });
});
window.Joinable?.finish({ score });

What you give up

Being honest about a hosted relay that doesn't run your code:

What it costs

Building and testing are free: no key is needed on localhost. When the game goes live on its real domain you pay per player-hour, not per concurrent player. Details: what multiplayer costs and pricing.

To try it, paste the prompt into your coding agent, or follow how to make a web game multiplayer.

FAQ

Can two browsers connect directly without a server?

Not on their own. WebRTC can carry data directly between browsers, but they need a signalling server to set up the connection, and players on strict networks need a TURN relay for all their traffic.

What is the easiest way to add multiplayer without running a server?

A hosted SDK that runs the rooms for you. With Joinable it's an async script tag and a few hooks in your game; invites, quick match, the waiting room, countdown, results and rematch come with it.

Is a hosted relay peer-to-peer?

No. Every player connects to the relay over a WebSocket, and the relay passes messages on. That costs a hop compared with a direct link, but it works on every network and needs no TURN fallback.

Can I host a multiplayer web game on GitHub Pages or itch.io?

Yes, with a hosted relay. The game is static files on any host; the relay runs elsewhere. With Joinable, add your site's address to your game's key before going live.

Copy the prompt for your coding agent or sign up free