Skip to content

Kofysh/webcraft

🧱 WebCraft

CI License: MIT Node.js

A Minecraft server that runs on any machine with Node.js β€” no VPS, no Docker, no cloud platform required.

How does it work?

Minecraft normally requires raw TCP on port 25565.
WebCraft wraps the server behind a WebSocket bridge so it can run anywhere Node.js is available.

Player's PC                        Any Node.js host
────────────────────────────     ─────────────────────────────────
Minecraft Client                   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   └─► TCP :25565 (local)          β”‚  WebCraft                  β”‚
         β”‚                         β”‚                            β”‚
webcraft-proxy    ──── WSS ────────►│  WS Bridge β†’ flying-squid  β”‚
(run once on PC)                   β”‚  :8080     β†’ :25565 (lo)   β”‚
                                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

One-line install

curl -fsSL https://raw.githubusercontent.com/Kofysh/webcraft/main/scripts/install.sh | bash

Or manually:

git clone https://github.com/Kofysh/webcraft.git
cd webcraft
npm install
cp .env.example .env   # edit .env
node src/index.js

Plugin pack

WebCraft ships with a full plugin pack:

Plugin Commands
LuckPerms Lite /lp, /whoami
EssentialsX Lite /spawn, /home, /msg, /broadcast, /kick, /heal, /feed, /fly, /tp, /warp, /help
Ban Manager /ban, /unban, /tempban, /banlist
Gamemode /gmc, /gms, /gma, /gmsp
Vanish /vanish, /vanishlist
Nick /nick, /realname
Staff Chat /sc, /togglesc
Sudo /sudo
Chat Formatter Group prefix + nick in chat
Anti-Spam Auto rate-limit + auto-mute
InvSee /invsee

See plugins/README.md for the full command reference.


Configuration

All settings live in .env (see .env.example):

Variable Default Description
WS_PORT 8080 Public WebSocket port
CERT_PATH β€” TLS certificate path (enables WSS)
KEY_PATH β€” TLS private key path
MC_PORT 25565 Internal Minecraft port (loopback only)
MC_VERSION 1.20.4 Minecraft version
ONLINE_MODE true Require Mojang auth
MAX_PLAYERS 20 Slot limit
VIEW_DISTANCE 8 Render distance
MOTD see .env.example Server list message
RATE_LIMIT_MAX 10 Max WS connections/IP/min
ADMIN_PORT 9090 Internal admin API port
ADMIN_TOKEN β€” Bearer token for admin API
WORLD_DIR ./world World save directory
AUTOSAVE_MIN 5 Auto-save interval (minutes)
PLUGINS_DIR ./plugins Plugins directory
LOG_LEVEL INFO Log verbosity
ANTISPAM_MSG_MAX 5 Anti-spam: max messages per window
ANTISPAM_WINDOW_MS 3000 Anti-spam: window in ms
ANTISPAM_MUTE_SECONDS 30 Anti-spam: auto-mute duration

Admin API

Listens on 127.0.0.1:ADMIN_PORT β€” never exposed publicly.

Method Path Description
GET /admin/status Server status + player list
GET /admin/players Online players
POST /admin/kick/:username Kick a player
POST /admin/broadcast Broadcast a message

Secure with ADMIN_TOKEN: Authorization: Bearer <token>


TLS / WSS

certbot certonly --standalone -d your-domain.com

Then in .env:

CERT_PATH=/etc/letsencrypt/live/your-domain.com/fullchain.pem
KEY_PATH=/etc/letsencrypt/live/your-domain.com/privkey.pem

Project structure

webcraft/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.js              Entry point + graceful shutdown
β”‚   β”œβ”€β”€ config.js             Config + validation
β”‚   β”œβ”€β”€ logger.js             Structured logger
β”‚   β”œβ”€β”€ minecraft-server.js   flying-squid wrapper (loopback)
β”‚   β”œβ”€β”€ ws-bridge.js          WS/WSS bridge + healthcheck
β”‚   β”œβ”€β”€ admin.js              Internal HTTP admin API
β”‚   β”œβ”€β”€ plugins.js            Plugin loader
β”‚   └── world-persistence.js  Auto-save world
β”œβ”€β”€ plugins/                  Plugin pack (EssentialsX, LuckPerms, ...)
β”œβ”€β”€ tests/                    Jest unit tests
β”œβ”€β”€ proxy/
β”‚   └── index.js              Local TCPβ†’WS proxy (run by players)
β”œβ”€β”€ scripts/
β”‚   └── install.sh            One-line installer
β”œβ”€β”€ .env.example
β”œβ”€β”€ CHANGELOG.md
β”œβ”€β”€ SECURITY.md
└── README.md

Contributing

See CONTRIBUTING.md.

Security

See SECURITY.md.

License

MIT Β© 2026 β€” Kofysh

About

🧱 A Minecraft server that runs on standard web hosting via WebSocket transport β€” no VPS, no Docker, no port 25565 exposed

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors