Guide · Open source
How to use Elysia: install, define routes and get started
Updated · written with AI from the project's own documentation and checked against our catalogue data
Elysia is an open-source TypeScript framework for building web servers and HTTP APIs. Its README emphasizes end-to-end type safety and a developer-friendly experience, and it is built to run on the Bun JavaScript runtime. This guide walks you through what you need, how to create an app, and how the pieces fit together so you can start defining routes and handlers.
Quick start
- 1Install Bun. Install the Bun runtime, which is the listed prerequisite for Elysia.
- 2Create the app. Run bun create elysia app in your terminal to generate a new Elysia project.
- 3Open the project. Move into the folder the template created so you can work on the generated code.
- 4Define routes. Write routes and handlers in TypeScript, using the types you share across your code.
- 5Check the docs. Use elysiajs.com for current syntax, type helpers and configuration details.
- 6Build your API. Extend the app with the endpoints your project needs and keep types consistent between server and client.
What you need before installing Elysia
Elysia is a TypeScript framework that the README ties to the Bun runtime. Installation is done through a package manager, and the listed prerequisite is Bun. Make sure Bun is installed on your machine before you continue.
The source does not cover running Elysia on Node.js, so do not assume it will work there.
- Prerequisite: Bun
- Language: TypeScript
- Install method: package manager
Create a new Elysia app with the template
The README's documented way to start is the Elysia template. Run the command below in the terminal from the folder where you want the project created. It generates a new app for you to work in.
The README's documentation for everything else lives at elysiajs.com.
bun create elysia appUnderstand routes, handlers and shared types
Elysia is used to define routes and handlers in TypeScript, with types shared across the code. The README emphasizes end-to-end type safety, meaning the types you define on the server are meant to carry through the rest of your code.
For the exact route syntax, handler signatures and type helpers, use the official documentation at elysiajs.com, since the source provided here does not include code examples for them.
- Define routes and their handlers in TypeScript.
- Keep types shared across server code to catch mismatches early.
- Refer to elysiajs.com for current API details.
Get help and find the project resources
The README links to the documentation, a Discord community channel, and a sponsors page. The contributing guide and code of conduct are in the repository as CONTRIBUTING.md and CODE_OF_CONDUCT.md.
If you run into trouble, the documentation and the Discord community are the links the README points to for help.
- Documentation: elysiajs.com
- Community: the Discord link in the README
- Contributing: CONTRIBUTING.md in the repository
What people use it for
- Building an HTTP API in TypeScript with shared types.
- Creating a web server for a project already running on Bun.
- Sharing type definitions between server and client code in a TypeScript project.
Frequently asked questions
How do I install Elysia?
Install Bun first, then run bun create elysia app in your terminal. The README lists this as the way to create a new app with the Elysia template.
Does Elysia require Bun?
The README ties Elysia to the Bun JavaScript runtime and lists Bun as the prerequisite. Running it on Node.js only is not verified in the source.
Is Elysia free to use?
Elysia is released under the MIT licence, which is a permissive open-source licence. Check the repository's licence file for the full terms.
Is Elysia a good choice for beginners?
It can be a lot to learn at once for people new to both TypeScript and backend development. A working knowledge of TypeScript makes the setup and concepts easier to follow.
What are the alternatives to Elysia?
Projects often compared with Elysia include Hono, Fastify, Express and tRPC. Pick based on your runtime, your need for shared types and how mature you need the framework to be.
Is Elysia stable enough for production?
The source notes the latest release has a pre-2.0 version number, so projects that need a long track record of stability should weigh that before adopting it.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Elysia suits TypeScript developers and teams who are building HTTP APIs or web servers, already use Bun or are willing to adopt it, and want types shared between server and client. Developers who need Node.js only, beginners new to both TypeScript and backend work, or projects that need a long stability history should consider alternatives such as Hono, Fastify, Express or tRPC.
Install options & downloads