Open-source multiplayer framework for Node.js
Ship multiplayer
Games
faster
Matchmaking, state sync and client-side prediction built in, with SDKs for Unity, Godot, Defold and the web.
npm create colyseus-app@latest ./my-server Supports your favorite engine & platform
One stack
From first prototype to live game
Build your server with the framework, let your coding agent write it with you, and take it live on Colyseus Cloud when players show up.
Framework
Write the game, not the netcode
Rooms, matchmaking, delta state sync and client-side prediction in one open-source Node.js framework.
- MIT licensed
- TypeScript end to end
- 9 client SDKs
Colyseus Cloud
Deploy and scale without DevOps
One command takes your server to production in any of 32 locations, and every update ships with zero downtime.
- From $15/mo
- No CCU limits
- 99.9% uptime SLA
Colyseus for AI
One prompt, a real multiplayer game
An agent skill and a scaffold that never asks questions let Claude Code, Cursor or Codex build and test a Colyseus game on their own.
- 1 prompt
- 0 hand edits
- 64 min, prompt to commit
See it in action
Real-time state sync in minutes
Define your game state on the server. Colyseus syncs it to every client automatically, with no serialization code to write.
import { Room, Client } from "colyseus";import { GameState, Player } from "./GameState";
export class GameRoom extends Room { state = new GameState();
messages = { // listen for "move" messages from clients move(client: Client, data: any) { const player = this.state.players.get(client.sessionId); if (player) { player.x = data.x; player.y = data.y; } }, }
onJoin(client: Client) { const player = new Player(); this.state.players.set(client.sessionId, player); }
onLeave(client: Client) { this.state.players.delete(client.sessionId); }}import { Client, Callbacks } from "@colyseus/sdk";
const client = new Client("https://your-server.com");const room = await client.joinOrCreate("game_room");const callbacks = Callbacks.get(room);
callbacks.onAdd("players", (player, key) => { addSpriteForPlayer(player); callbacks.onChange(player, () => moveSprite(key, player.x, player.y));});
callbacks.onRemove("players", (player, key) => removeSpriteForPlayer(key));
room.send("move", { x: 10, y: 20 });npm install @colyseus/sdk import { Client } from "@colyseus/sdk";import { useRoom, useRoomState } from "@colyseus/react";
const client = new Client("https://your-server.com");
function Game() { const { room, isConnecting } = useRoom( () => client.joinOrCreate("game_room"), ); const state = useRoomState(room);
if (isConnecting) return <p>Connecting...</p>;
return ( <ul> {state?.players.map((player, key) => ( <li key={key}>Player at {player.x}, {player.y}</li> ))} </ul> );}npm install @colyseus/react using Colyseus;using Colyseus.Schema;
var client = new Client("https://your-server.com");var room = await client.JoinOrCreate<GameState>("game_room");var callbacks = Callbacks.Get(room);
callbacks.OnAdd(state => state.players, (sessionId, player) => { AddSpriteForPlayer(player); callbacks.OnChange(player, () => MoveSprite(sessionId, player.x, player.y));});
callbacks.OnRemove(state => state.players, (sessionId, player) => RemoveSpriteForPlayer(sessionId));
await room.Send("move", new { x = 10, y = 20 });var client: ColyseusClient = Colyseus.create_client()client.set_endpoint("wss://your-server.com")var room: ColyseusRoom = client.join_or_create("game_room")
room.joined.connect(func(): var callbacks = Colyseus.callbacks(room)
callbacks.on_add("players", func(player, key): add_sprite_for_player(player) callbacks.on_change(player, func(): move_sprite(key, player.x, player.y) ) )
callbacks.on_remove("players", func(player, key): remove_sprite_for_player(key) )
room.send("move", {"x": 10, "y": 20}))client = new ColyseusClient("https://your-server.com");room = client.join_or_create("game_room");callbacks = ColyseusCallbacks(room);
callbacks.on_add("players", function(player, key) { add_sprite_for_player(player); callbacks.on_change(player, function() { move_sprite(key, player.x, player.y); });});
callbacks.on_remove("players", function(player, key) { remove_sprite_for_player(key);});
room.send("move", { x: 10, y: 20 });local ColyseusSDK = require "colyseus.sdk"
local client = ColyseusSDK.Client("https://your-server.com")client:join_or_create("game_room", function(room) local callbacks = ColyseusSDK.callbacks(room)
callbacks:on_add("players", function(player, key) add_sprite_for_player(player) callbacks:on_change(player, function() move_sprite(key, player.x, player.y) end) end)
callbacks:on_remove("players", function(player, key) remove_sprite_for_player(key) end)
room:send("move", { x = 10, y = 20 })end)import io.colyseus.Client;import io.colyseus.schema.Callbacks;
var client = new Client("https://your-server.com");client.joinOrCreate("game_room", [], MyRoomState, function(err, room) { var callbacks = Callbacks.get(room);
callbacks.onAdd("players", (player, key) -> { addSpriteForPlayer(player); callbacks.onChange(player, () -> moveSprite(key, player.x, player.y)); });
callbacks.onRemove("players", (player, key) -> removeSpriteForPlayer(key));
room.send("move", {x: 10, y: 20});});haxelib install colyseus #include "colyseus.h"
colyseus_client_t* client = colyseus_client_new("https://your-server.com");colyseus_room_t* room = colyseus_join_or_create(client, "game_room");colyseus_callbacks_t* callbacks = colyseus_callbacks_get(room);
void on_player_add(colyseus_state_t* player, const char* key) { add_sprite_for_player(player); colyseus_on_change(callbacks, player, on_player_change, (void*)key);}
void on_player_change(colyseus_state_t* player, void* ctx) { float x = colyseus_get_float(player, "x"); float y = colyseus_get_float(player, "y"); move_sprite((const char*)ctx, x, y);}
colyseus_on_add(callbacks, "players", on_player_add, NULL);colyseus_on_remove(callbacks, "players", on_player_remove, NULL);colyseus_room_send(room, "move", data, data_len);const client = new Colyseus.Client("https://your-server.com");const room = await client.joinOrCreate("game_room");const callbacks = Colyseus.Callbacks.get(room);
callbacks.onAdd("players", (player, key) => { const sprite = runtime.objects.Player.createInstance("Game", player.x, player.y); callbacks.onChange(player, () => { sprite.x = player.x; sprite.y = player.y; });});
callbacks.onRemove("players", (player, key) => { // destroy sprite instance});
room.send("move", { x: 10, y: 20 });Why Colyseus
Everything you need for multiplayer
The parts every online game needs, already built and tested in production.
Authoritative state sync
Define your state once on the server. Colyseus sends each client only the fields that changed, as binary patches, and clients can't tamper with it.
Built-in matchmaking
Rooms spawn on demand and fill by the filters you set. Lobbies, ranked queues, private and password-protected rooms are included.
Prediction & lag compensation
NewYour player moves on the next frame and reconciles when the server answers. Hit tests rewind to what each shooter saw.
Scales with your game
From 10 to 10,000+ CCU. Spread rooms across processes and machines, with matchmaking working across all of them.
SDKs for every engine
Unity, Godot, Defold, GameMaker, Construct 3, Haxe, React and plain TypeScript. State sync works the same in all of them.
Free & open source
MIT licensed and free forever, commercial games included. You keep full control of your code and your infrastructure.
Showcase
Games shipped with Colyseus
Shooters, party games, MMOs and card games, running in browsers, on Steam and on mobile.
Watch the Colyseus reelNo vendor lock-in
Your server, your rules
Colyseus is a standard Node.js application. Deploy it wherever you like, with no proprietary runtime in the way.
Standard Node.js
No proprietary runtime. Your Colyseus server is a Node.js app, so every npm package and every tool you already use still works.
Host anywhere
AWS, Google Cloud, DigitalOcean, Fly.io, Railway or bare metal. If it runs Node.js, it runs Colyseus.
Or let us run it
Colyseus Cloud handles deployment, scaling and monitoring across 32 global locations, from $15/mo.
Compare
How Colyseus compares
vs Photon
- Open-source, own your servers
- No CCU pricing surprises
- Full server-side control
vs Mirror
- Works with any game engine
- Not tied to Unity
- Runs as a standalone server process
vs Nakama
- Simpler API, faster to learn
- TypeScript-native
- Purpose-built for room-based multiplayer
vs From Scratch
- Battle-tested in production
- Ship in days, not months
- Active community support
Success stories
Trusted by indies and studios worldwide
"...the operational cost associated with running a Colyseus server is substantially lower than alternatives we tried."
"I had previously never worked with Websockets, authoritative multiplayer servers, or Node.js. But that wasn’t a problem, as Colyseus provided me with an intuitive start. This strong foundation allowed us to grow to where we are today."
"We have been in love with Colyseus since the first moment we discovered it. It is amazing to have such an extraordinary product available for free and as open source."
FAQ
Colyseus questions
What is Colyseus?
Colyseus is an open-source multiplayer framework for Node.js. You write authoritative game servers in TypeScript or JavaScript, and it handles rooms, matchmaking, real-time state synchronization and client-side prediction, with client SDKs for the major game engines.
Is Colyseus free?
Yes. The framework is MIT licensed and free forever, commercial games included. Colyseus Cloud is an optional paid hosting service, starting at $15 per month.
Which game engines does Colyseus support?
Stable SDKs: TypeScript, React, Unity, Defold, Haxe, Construct 3. In alpha: Godot, GameMaker, C. The server is always Node.js, and state synchronization works the same way in every SDK.
Do I have to host on Colyseus Cloud?
No. A Colyseus server is a standard Node.js application, so it runs on any provider or on your own hardware. Colyseus Cloud is there when you'd rather not manage servers yourself.
Can AI coding agents build games with Colyseus?
Yes. Install the Colyseus agent skill with npx skills add colyseus/skill and agents like Claude Code, Cursor and Codex write against the current 0.18 API. The scaffold runs without interactive questions, and @colyseus/testing lets the agent check that two players really see each other.
Community
Join our growing community
Connect with thousands of multiplayer game developers.
Sponsors
Colyseus is free and open source, made possible by these amazing people.
Supporters get exclusive demos, full source & premium guides.
Become a sponsorStart your multiplayer game
Scaffold a server in seconds, connect your engine, and deploy when you're ready.
npm create colyseus-app@latest ./my-server