Skip to content

Quickstart

Echo is a high performance, minimalist Go web framework. This guide gets a server running in under five minutes.

Echo requires Go 1.25 or newer. Check your version:

Terminal window
go version

Create a module and add Echo:

Terminal window
go mod init myapp
go get github.com/labstack/echo/v5

Create main.go:

package main
import (
"net/http"
"github.com/labstack/echo/v5"
"github.com/labstack/echo/v5/middleware"
)
func main() {
e := echo.New()
e.Use(middleware.RequestLogger())
e.Use(middleware.Recover())
e.GET("/", func(c *echo.Context) error {
return c.JSON(http.StatusOK, map[string]string{"message": "Hello, World!"})
})
if err := e.Start(":1323"); err != nil {
e.Logger.Error("failed to start server", "error", err)
}
}

Run it:

Terminal window
go run main.go

Your server is live at http://localhost:1323. Echo’s router dispatches requests with zero dynamic memory allocation per route.

  • Routing — static, parameterized, and wildcard routes.
  • Context — the per-request request/response object.
  • Binding — parse request data into typed structs.