
Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Caddy is an extensible server platform that uses TLS by default.
Releases · Documentation · Get Help
The simplest, cross-platform way to get started is to download Caddy from GitHub Releases and place the executable file in your PATH.
See our online documentation for other install instructions.
Requirements:
Note: These steps will not embed proper version information. For that, please follow the instructions in the next section.
$ git clone "https://github.com/caddyserver/caddy.git"
$ cd caddy/cmd/caddy/
$ go build
When you run Caddy, it may try to bind to low ports unless otherwise specified in your config. If your OS requires elevated privileges for this, you will need to give your new binary permission to do so. On Linux, this can be done easily with: sudo setcap cap_net_bind_service=+ep ./caddy
If you prefer to use go run which only creates temporary binaries, you can still do this with the included setcap.sh like so:
$ go run -exec ./setcap.sh main.go
If you don't want to type your password for setcap, use sudo visudo to edit your sudoers file and allow your user account to run that command without a password, for example:
username ALL=(ALL:ALL) NOPASSWD: /usr/sbin/setcap
replacing username with your actual username. Please be careful and only do this if you know what you are doing! We are only qualified to document how to use Caddy, not Go tooling or your computer, and we are providing these instructions for convenience only; please learn how to use your own computer at your own risk and make any needful adjustments.
Then you can run the tests in all modules or a specific one:
$ go test ./...
$ go test ./modules/caddyhttp/tracing/
Using our builder tool, xcaddy...
$ xcaddy build
...the following steps are automated:
mkdir caddycd caddygo mod init caddygo get github.com/caddyserver/caddy/v2@version replacing version with a git tag, commit, or branch name._ "import/path/here"go build -tags=nobadger,nomysql,nopgxThe Caddy website has documentation that includes tutorials, quick-start guides, reference, and more.