Skip to main content

Quick Start


The version of kratos must be v2.0.0 or above.

Environment Requirements

These environments and tools must be installed properly.

The GO111MODULE should be enabled.

go env -w GO111MODULE=on

If you faced with network problem (especially you are in China Mainland), please setup GOPROXY


# install kratos CLI tool
go get -u

Project Creation

# create project's layout
kratos new helloworld

cd helloworld
# pull dependencies
go mod download
# generate proto template
kratos proto add api/helloworld/helloworld.proto
# generate proto code
kratos proto client api/helloworld/helloworld.proto
# generate server template
kratos proto server api/helloworld/helloworld.proto -t internal/service

Compilation and Running

# generate all codes of proto and wire etc.
go generate ./...

# run the application
kratos run

Try it out

curl ''

The response should be
"message": "Hello kratos"

Project Layout

Kratos CLI always pull the layout project from GitHub for project creation. The layout project is: