Express-inspired web framework for Go, built on the fasthttp engine, for writing REST APIs and web servers.
ktorio/ktor
Asynchronous Kotlin framework for building microservices, web applications and HTTP APIs, developed by JetBrains.
- Stars
- 14,552
- Forks
- 1,319
- Open issues
- 133
- Last commit
- 6 days ago
What is it?
Ktor is a framework for building connected applications in Kotlin, from microservices and web applications to RESTful HTTP APIs. It is written in Kotlin from the ground up and uses Kotlin coroutines so that request handling is asynchronous and does not block threads.
Applications are configured through a Kotlin DSL: routes are defined with lambdas, and features are installed into the application through a unified interception mechanism. Ktor does not force a choice of logging, templating, persistence, serialization or dependency injection libraries. Servers can run embedded on Netty or Jetty, or be hosted in a Servlet 3.0+ container such as Tomcat.
Ktor applications can be tested in a test environment that emulates a server without real networking, and can also be run as integration tests against an embedded server. The project is an official JetBrains product, and the Gradle plugin handles dependency BOM management, run tasks and deployment.
Key features
- 01Asynchronous request handling built on Kotlin coroutines
- 02Kotlin DSL for defining routes and installing features
- 03Embedded hosting on Netty or Jetty, or deployment to Servlet 3.0+ containers such as Tomcat
- 04Test environment that runs applications without real networking
- 05Gradle plugin for BOM management, run tasks and deployment
Use cases
- Building RESTful HTTP APIs and microservices in Kotlin
- Developing server-side web applications on the JVM
- Writing integration tests against an embedded Kotlin web server
Quick start
- 1
Add the Ktor Netty server dependency to your Gradle project
implementation("io.ktor:ktor-server-netty:$ktor_version") - 2
Create an Application with routing and install features, as shown in the README example
- 3
Run the application with Gradle
./gradlew run
Things to know
- Requires Kotlin and the JVM build toolchain such as Gradle or Maven.
In collections
Topics
FAQ
- What is ktor?
- Asynchronous Kotlin framework for building microservices, web applications and HTTP APIs, developed by JetBrains. Ktor is a framework for building connected applications in Kotlin, from microservices and web applications to RESTful HTTP APIs. It is written in Kotlin from the ground up and uses Kotlin coroutines so that request handling is asynchronous and does not block threads.
- Is ktor free to use? What license does it have?
- ktor is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is ktor still maintained?
- Actively maintained. The last commit to ktor was on Oct 19, 2026.
- What can I use ktor for?
- Building RESTful HTTP APIs and microservices in Kotlin Developing server-side web applications on the JVM Writing integration tests against an embedded Kotlin web server
- How do I install ktor?
- Add the Ktor Netty server dependency to your Gradle project: implementation("io.ktor:ktor-server-netty:$ktor_version") Create an Application with routing and install features, as shown in the README example Run the application with Gradle: ./gradlew run
- Where can I get ktor?
- The source code and installation instructions are on GitHub: https://github.com/ktorio/ktor
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A fast, Flask-style C++ microframework for building HTTP and WebSocket web services, header-only and easy to use.
Kotlin library providing coroutine builders, dispatchers, Flow, channels and structured concurrency primitives for asynchronous code.
A PHP extension providing an event-driven networking engine and coroutine runtime for building long-running TCP, UDP, HTTP, and WebSocket services.
A C++11 parallel computing and asynchronous networking framework used in Sogou's back-end services, for building DAG-based task workflows.
A Rust web server with a compact config, automatic TLS, and per-request tracing linked to logs, for static sites and reverse proxies.