Skip to main content
The caddy version command prints the version of the Caddy binary.

Usage

Description

Prints the version of this Caddy binary. Version information must be embedded into the binary at compile-time for Caddy to display anything useful with this command. If Caddy is built from within a version control repository, the Go command will embed the revision hash if available. However, if Caddy is built in the way specified by the official documentation (or by using xcaddy), more detailed version information is printed as given by Go modules.

Output

The output format includes:
  • Version number - The Caddy release version (e.g., v2.7.6)
  • Module path - The Go module path
  • Module sum - The Go module checksum
  • Build metadata - Compiler version, platform, etc.

Example Output

For a more detailed build, the output might look like:

Exit Codes

  • 0 - Success

Version Information

The version string follows the Go module version numbering scheme. See the Go module documentation for more details.

Version Format

Versions follow semantic versioning:
  • v2.7.6 - Major.Minor.Patch
  • v2.7.6-beta.1 - Pre-release version
  • v0.0.0-20230101120000-abc123def456 - Pseudo-version (built from specific commit)

Building with Version Info

Using xcaddy

The recommended way to build Caddy with proper version information:
This embeds the version automatically.

Custom build with version

Building from source

If you build from source without special flags:
The version will be based on the git commit:

Checking Version Programmatically

In scripts, you can parse the version:
Or check if a minimum version is installed:

Official Releases

Official Caddy releases are available from: