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
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.Patchv2.7.6-beta.1- Pre-release versionv0.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:Custom build with version
Building from source
If you build from source without special flags:Checking Version Programmatically
In scripts, you can parse the version:Official Releases
Official Caddy releases are available from:- GitHub Releases
- Caddy Download Page
- Package managers (apt, yum, brew, etc.)
Related Commands
caddy list-modules- List installed modules and versions