hugo envhugo env prints your Hugo version, OS, Go toolchain and bundled library versions in one shot, perfect for pasting into a bug report. The command only prints information: it does not build the site, edit configuration, write output or restart a service. Allow about five minutes if Hugo is already installed.
This guide describes the installed command on this machine, Hugo 0.123.7, supplied by the Ubuntu package 0.123.7-1ubuntu0.3+esm2. Other Hugo releases can report different build dates, Go versions or compiled libraries, so keep the output with the report instead of copying the sample as if it were universal. No elevated privilege is normally required.
Start by checking which executable your shell will run, then ask it for its release information:
$ command -v hugo
/usr/bin/hugo
$ hugo version
hugo v0.123.7+extended linux/amd64 BuildDate=2026-03-17T19:51:14Z VendorInfo=ubuntu:0.123.7-1ubuntu0.3+esm2
The command -v result matters when more than one Hugo binary is installed. A project may behave differently when a shell, editor or build service finds another executable earlier in its PATH.
Checkpoint: Record the path and version from your own machine. If command -v hugo prints nothing, stop here and install Hugo through your normal package or release-management process. Do not use sudo merely to make a diagnostic command work.
Run hugo env without arguments. It is the command documented by the installed hugo-env(1) manual page for printing Hugo version and environment information:
$ hugo env
hugo v0.123.7+extended linux/amd64 BuildDate=2026-03-17T19:51:14Z VendorInfo=ubuntu:0.123.7-1ubuntu0.3+esm2
GOOS="linux"
GOARCH="amd64"
GOVERSION="go1.22.2"
github.com/sass/libsass="3.6.5"
github.com/webmproject/libwebp="v1.3.2"
Your report may contain different values. The first line identifies the Hugo build. The following lines describe:
GOOS and GOARCH: the target operating system and architecture.GOVERSION: the Go toolchain used for the build.Together they give someone investigating a failure more context than a bare statement such as "Hugo does not build my site". The command can be run from a Hugo project directory or from another directory; it does not need a site source tree to print this report. If you want the report to be unambiguous, run it in the same environment where the failure occurred, such as the same container, virtual machine or build account.
For a bug report, save standard output to a new diagnostic file in a temporary or incident directory:
$ mkdir -p /tmp/hugo-diagnostic
$ hugo env > /tmp/hugo-diagnostic/hugo-env.txt
$ test -s /tmp/hugo-diagnostic/hugo-env.txt && echo 'report written'
report written
The redirection creates or replaces the named report file, not your Hugo site. Choose a new filename if an earlier report is worth keeping. If you also need the command's error output, capture both streams explicitly:
$ hugo env > /tmp/hugo-diagnostic/hugo-env.txt 2> /tmp/hugo-diagnostic/hugo-env.err
$ printf 'hugo env status: %s\n' "$?"
hugo env status: 0
The status is the exit status of hugo env because printf runs afterwards only to display the saved value. If the status is non-zero, read the error file and report it with the exact command, executable path and current working directory. Do not turn a failed diagnostic into an excuse to delete configuration or rebuild a site.
If you need to confirm the subcommand syntax on the installed release, use its help option:
$ hugo env --help
Print Hugo version and environment info
Usage:
hugo env [flags] [args]
The subcommand has its own -h and --help options. The manual also lists inherited global options, including configuration and source-directory options, but they are not needed for the normal environment snapshot. Keep a diagnostic command small: adding unrelated build flags can make a report harder to reproduce and can distract from the version mismatch you are trying to establish.
Attach the saved hugo-env.txt file and include the Hugo command that failed, its complete error output, and the working directory. If the failure only occurs in automation, run hugo env inside that automation environment rather than on your workstation. Compare the GOOS, GOARCH and GOVERSION values as well as the Hugo version; a report from a different architecture or build can send debugging in the wrong direction.
Review the file before sharing it. The normal output shown here contains version and build details, not project content. Still, treat any diagnostic bundle you create as potentially sensitive if you add shell history, paths or other logs beside it. Share only what the recipient needs. The command itself does not expose your site configuration, but that does not make every file in the surrounding directory safe to upload.
There is no rollback for the printed information because hugo env does not change Hugo state. To remove only the temporary example report after the issue is closed, use the exact file path:
$ rm -- /tmp/hugo-diagnostic/hugo-env.txt /tmp/hugo-diagnostic/hugo-env.err
$ rmdir --ignore-fail-on-non-empty /tmp/hugo-diagnostic
Warning: check the path before running rm. Deleting a report is optional and irreversible; keep it if the incident record still depends on it.
hugo executable was used.hugo env.