Phaser
Fast HTML5 game framework for browser games you host yourself
Phaser is a fast, free, and open-source HTML5 game framework for building 2D games that run in a web browser. Games made with Phaser are self-hostable as static sites and playable on desktop and mobile.
Key features
- HTML5 2D game framework
- Self-hostable static games
- Desktop and mobile support
- Large ecosystem
Pros & cons
Strengths
- Huge community
- Easy to deploy games
Trade-offs
- Framework, build your own game
- 2D only
Phaser replaces
Last reviewed Aug 26, 2026 · 993 words
You do not self-host Phaser. You self-host the folder it produces. Phaser is a JavaScript framework for 2D browser games, and the finished game is an index.html, one bundled script, and an assets/ directory that any static file server can publish for 128 MB of RAM and roughly zero CPU. That makes it the cheapest interactive thing you can run on a homelab, and it also means the catalogue's "Medium" difficulty is about writing the game, not deploying it. Deployment is a copy command.
Static files are the whole deployment
A Phaser game has no server-side component unless you add one. Physics, rendering, input, audio, and scene management all run in the player's browser. The framework picks WebGL when the browser has it and falls back to Canvas when it does not, and both paths ship in the same bundle. Your hosting job is therefore identical to hosting a blog: serve files, set cache headers, terminate TLS.
The project is MIT licensed, first released in 2013, and sits at about 40,000 GitHub stars, which in practice means every problem you hit has a forum thread. It is the largest ecosystem in the game engines category for browser-first work, and the one most tutorials target.
Build it, then copy the dist folder
Do not serve your source tree. Use one of the official starter templates, which pair Phaser with Vite and give you a dev server plus a production build:
npm install phaser
npm run build # in a Vite-based template, emits ./dist
rsync -av --delete dist/ user@homelab:/srv/www/mygame/
The build step matters for three reasons. It minifies and hashes your bundle so browsers cache it correctly, it strips the development-only code paths, and it inlines the asset manifest so relative paths resolve the same way on your server as they did on localhost:5173. The Phaser library itself is around 1 MB minified and a few hundred KB compressed, so make sure whatever serves it has gzip or brotli on. Static Web Server is a single 5 MB binary that does this out of the box; Caddy does it plus automatic HTTPS in 3 lines of config.
The 4 things that break a self-hosted Phaser game
Every "it works in dev and not on my server" report I have seen comes down to one of these.
MIME types and CORS. Texture atlases, bitmap fonts, and audio sprites are loaded with fetch or XHR, and the browser enforces same-origin rules on them. Keep assets on the same host and path as the game, and check that your server sends .json, .atlas, and .ogg files with sensible content types. A misconfigured server that returns text/html for a missing asset produces a blank canvas with no error.
Cache headers. Hashed bundle filenames can be cached for a year; index.html must not be, or players keep loading the old build for a week after you fix a bug. Tell your server to set Cache-Control: no-cache on the HTML and long max-age on everything under assets/.
Audio autoplay. Browsers refuse to play sound until the user has interacted with the page. Phaser resumes the audio context for you, but only if the first sound plays after a click or tap. Games that start music on scene load are silent on mobile, and it is not a hosting bug.
Scaling. A game that looks right at your desktop resolution is a postage stamp on a phone. Configure the Scale Manager with mode: Phaser.Scale.FIT and autoCenter: Phaser.Scale.CENTER_BOTH and test on an actual device before you share the link.
It is a framework, and it is 2D, and that is the trade
The two cons in the catalogue deserve a straight reading. Phaser gives you no visual editor: you write scenes, sprites, and game loops in JavaScript or TypeScript. The tools it is listed against, Construct and GameMaker, both offer drag-and-drop event sheets or their own scripting language inside a desktop app, and both cost money for full export. If you are a programmer, Phaser's code-first approach is faster and version-controls better. If you are a designer who does not want to write code, Construct's free tier gets a playable browser game on screen sooner.
2D only means what it says. Sprites, tilemaps, particles, arcade and Matter physics, cameras, tweens: all excellent. A 3D scene, even a simple one, needs a different engine, and pretending otherwise with a 2.5D projection will cost you more time than learning the other tool.
Multiplayer ends the static story
The moment two players need to see the same state you have a server again. Phaser has no networking layer; people bolt on WebSockets, socket.io, or a room server such as Colyseus, and at that point you are hosting a Node process with the same care as any other app: a reverse proxy with websocket support, a restart policy, and monitoring. For turn-based games, a lighter path is a tiny backend on a hosted-anything platform such as PocketBase, with the game itself still served as static files. Budget the server before you promise friends a co-op mode.
What I'd do
Pick a Vite template, write the game, npm run build, and rsync dist/ to a directory served by Caddy on the same box that already hosts your other static sites. Long cache on hashed assets, no cache on the HTML, brotli on, tested once on a phone for scaling and audio. The Core Web Vitals notes apply here too, since a game page is still a page. Keep it single-player until you have a reason not to, because a static Phaser game is the one deployment in your homelab that will never page you.
Compare Phaser
2 head-to-head comparisons.
Similar game engines & frameworks apps
PixiJS
Game Engines & FrameworksFast 2D WebGL rendering engine for browser games
Replaces Adobe Animate runtime
OpenRA
Game Engines & FrameworksOpen-source remake of classic RTS games
Replaces Command & Conquer, Red Alert
PlayCanvas Engine
Game Engines & FrameworksOpen-source WebGL game engine for 3D browser games
Replaces Unity WebGL
openage
Game Engines & FrameworksOpen-source engine reimplementation of Age of Empires II
Replaces Age of Empires II original engine
Retroarch Web Player
Game Engines & FrameworksEmulate videogames system and play videogames through your web browser
Luanti
Game Engines & FrameworksOpen-source voxel game engine and server
Replaces Minecraft