Echo
Echo
Build fast Go APIs.
Without the bloat.
A high-performance, minimalist Go web framework with a zero-allocation router, batteries-included middleware and an expressive API.
Get started 32.9k on GitHubgo get github.com/labstack/echo/v5
Building a multi-tenant API? Echo Pro adds API keys, tenant isolation, quotas and signed webhooks.
e := echo.New()
// Middleware
e.Use(middleware.RequestLogger())
e.Use(middleware.Recover())
// Route => handler
e.GET("/", func(c *echo.Context) error {
return c.String(http.StatusOK, "Hello, World!\n")
})
Built on Echo
- Bluesky indigo
- Temporal UI
- NVIDIA Cloud Functions
- Azure Container Networking
- osbuild-composer (Red Hat)
- Docker Agent
- YugabyteDB
- PostHog
- Bytebase
- Hatchet
- CasaOS
- Hanko
Features
Optimized router
Radix-tree router; matching a route allocates no memory with default settings. Static paths match before parameters, parameters before wildcards.Middleware
CORS, CSRF, rate limiting, gzip, recover and request logging ship in Echo'smiddleware package. JWT, sessions and metrics are official add-ons.
Data binding
Bind JSON, XML or form bodies and path parameters into a struct with one call toc.Bind. The binding guide covers query parameters.
TLS and HTTP/2
StartConfig.StartTLS serves HTTPS from certificate files, or set StartConfig.TLSConfig and call Start. HTTP/2 works over TLS by default.
Extensible
Write middleware as a plain function. Replace the binder, validator, renderer, IP extractor or error handler.Templates
Useecho.TemplateRenderer for html/template, or set e.Renderer to any engine that implements echo.Renderer.
Quickstart
Install
Create a module and add Echo.
go mod init myapp go get github.com/labstack/echo/v5Write
Create
server.gowith one route. The full example adds imports andmain.e.GET("/", func(c *echo.Context) error { return c.String(http.StatusOK, "Hello, World!\n") })Run
Fetch dependencies and start serving on port 1323.
go mod tidy go run server.go
Official packages
echo-jwt JWT authentication middleware backed by golang-jwt. echo-otel OpenTelemetry tracing and metrics middleware. echo-prometheus Prometheus metrics middleware. echo-contrib Casbin, sessions, pprof and tracing helpers.Sponsors
Blacksmith Faster, drop-in GitHub Actions runners. Encore The platform for building Go-based cloud backends. Customer.io Gravity Carbon Codeerror Become a sponsorEcho stays MIT. Echo Pro is a separate commercial library that funds it.
Production building blocks for teams running multi-tenant APIs on Echo v5.
Auth and tenant isolation API keys, JWT access tokens and deny-by-default tenant authorizers. Quotas and usage metering Per-tenant plans, AI and MCP metering, and Stripe meter export. Audit, webhooks and execution records Durable evidence, signed delivery and records of external effects. Embedded admin console Plans, usage, audit and outbox views behind your own sign-in. Explore Echo Pro See pricingSite links
echoHigh performance, extensible, minimalist Go web framework.