Prerequisites
Elysia runs on Bun, a fast all-in-one JavaScript runtime. Before installing Elysia, youβll need to install Bun.System requirements
- macOS, Linux, or Windows (via WSL)
- Node.js is not required - Bun is a complete runtime
Install Bun
Create a new project
Use the Elysia scaffolding tool
The fastest way to get started is with the official scaffolding tool:This creates a new directory called
app with a basic Elysia project structure.Install dependencies
Dependencies are automatically installed by
bun create, but you can reinstall them if needed:Manual installation
If you prefer to set up your project manually:Project structure
A typical Elysia project structure looks like this:Elysia doesnβt enforce a specific project structure. Organize your code however works best for your project.
Development setup
TypeScript configuration
Elysia works best with TypeScript. Hereβs a recommendedtsconfig.json:
tsconfig.json
Hot reload during development
Bun supports hot reloading out of the box:Installing plugins
Elysia has a rich ecosystem of official and community plugins. Install them with Bun:Runtime adapters
While Elysia is optimized for Bun, it also supports other runtimes through adapters:Bun (default)
Native support with optimal performance.
Cloudflare Workers
Deploy to edge with the Cloudflare Workers adapter.
Web Standard
Use the web standard adapter for maximum compatibility.
Node.js
Limited support via web standard adapter (Bun recommended).
Verify installation
To verify everything is working correctly, create a simple test:test.ts
http://localhost:3000/health - you should see a JSON response.
Next steps
Quick start guide
Build your first real application with Elysia.
Core concepts
Learn about routing, handlers, and context.
Validation
Add schema validation to your routes.
Plugins
Extend Elysia with plugins.