Python raylib → Web

Put your Python game on the web.

Rayport packages Python raylib games as static files that run directly in a browser. No separate raylib installation. No compiler setup.

uv tool install rayport
main.py Python
from raylib import *

InitWindow(800, 600, b"Hello")

while not WindowShouldClose():
    BeginDrawing()
    ClearBackground(RAYWHITE)
    DrawText(b"Hello, web!", 260, 280, 32, RED)
    EndDrawing()
Build complete dist/
HTMLJavaScriptWebAssembly
Python game+raylibRayportStatic website

Why Rayport

Keep making the game. Rayport handles the browser build.

Your source stays Python. Rayport brings the browser runtime, finds the files your project needs, and produces a folder you can put on any static web host.

01

One tool to install

The CPython and raylib browser runtime is included. You do not need to install Emscripten or compile raylib yourself.

02

Fast local iteration

Use the development server while you work. Rayport rebuilds when project files change and serves the result locally.

03

Portable output

The final build is ordinary static web content. Upload it to your host without a Python server or application backend.

04

Project-aware packaging

Rayport follows imports, includes project assets and pure Python dependencies, and explains what will be packaged.

Get started

From game folder to browser in three commands.

Rayport expects a main.py entry point. Your images, sounds, modules, and other files can stay beside it in the project.

1

Install

Install the Rayport command

Install it as an isolated command-line tool with uv.

uv tool install rayport
2

Develop

Run your game locally

Start the development server from your game directory.

rayport dev .
3

Build

Create the static site

Upload the contents of dist/ to any static web server.

rayport build . --output dist
my-game/
├── main.py
├── rayport.toml
├── game/
│   ├── player.py
│   └── level.py
└── assets/
    ├── sprites.png
    └── music.ogg

Optional configuration

Control how the game meets the browser.

Add rayport.toml to set the page title, background, presentation mode, and packaging rules.

[web]
title = "My Game"
presentation = "fit"
background = "#111114"
See configuration options →

Example game

This is a Rayport build.

Breakout is written in Python with raylib, then packaged as static web files by Rayport.

Live example Breakout

Move with the mouse · Press R to restart

Current compatibility

Know the boundaries before you build.

Rayport CLIPython 3.13 and 3.14
Browser runtimeCPython 3.12.11 · raylib 5.5
Automated browser testChromium
Native extensionsNot supported in WebAssembly

Ready to port?

Build the web version.

uv tool install rayport