gohugoio/hugo · error

deploy not supported in this version of Hugo; install a rele

Error message

deploy not supported in this version of Hugo; install a release with 'withdeploy' in the archive filename or build yourself with the 'withdeploy' build tag. Also see https://github.com/gohugoio/hugo/pull/12995

What it means

Returned unconditionally by the stub `hugo deploy` command compiled when the `withdeploy` build tag is absent (commands/deploy_off.go:42-44, guarded by `//go:build !withdeploy`). Since Hugo v0.141 (PR 12995), the deploy feature and its heavy cloud-provider dependencies (AWS/GCS/Azure SDKs) were moved behind an opt-in build tag, so standard release binaries ship with deploy disabled and the command hidden.

Source

Thrown at commands/deploy_off.go:43

// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package commands

import (
	"context"
	"errors"

	"github.com/bep/simplecobra"
	"github.com/spf13/cobra"
)

func newDeployCommand() simplecobra.Commander {
	return &simpleCommand{
		name: "deploy",
		run: func(ctx context.Context, cd *simplecobra.Commandeer, r *rootCommand, args []string) error {
			return errors.New("deploy not supported in this version of Hugo; install a release with 'withdeploy' in the archive filename or build yourself with the 'withdeploy' build tag. Also see https://github.com/gohugoio/hugo/pull/12995")
		},
		withc: func(cmd *cobra.Command, r *rootCommand) {
			applyDeployFlags(cmd, r)
			cmd.Hidden = true
		},
	}
}

View on GitHub ↗ (pinned to 8a468df065)

Solutions

  1. Download the release archive whose filename contains 'withdeploy' (e.g. hugo_withdeploy_<version>_<os>-<arch>.tar.gz) from the GitHub releases page and use that binary.
  2. Build from source with the tag: `go install -tags withdeploy github.com/gohugoio/hugo@latest` (add `extended,withdeploy` if you also need extended features).
  3. Update CI to pin the withdeploy artifact, or replace `hugo deploy` with a provider CLI (aws s3 sync, gcloud storage rsync, az storage blob upload-batch).

Example fix

# before (CI)
go install github.com/gohugoio/hugo@latest
hugo deploy
# after
go install -tags withdeploy github.com/gohugoio/hugo@latest
hugo deploy
Defensive patterns

Strategy: fallback

Validate before calling

// Check at startup whether this Hugo build includes deploy support
out, _ := exec.Command("hugo", "version").Output()
if !strings.Contains(string(out), "withdeploy") {
    // deploy unavailable in this binary
}

Try / catch

if err != nil && strings.Contains(err.Error(), "deploy not supported") {
    // fall back to an alternate deploy path (rsync, CI deploy) or instruct install of withdeploy build
}

Prevention

When it happens

Trigger: Running `hugo deploy` with any binary built without `-tags withdeploy` — the stub command always returns this error regardless of flags or configuration. Applies to the standard release archives (those without 'withdeploy' in the filename), most package-manager builds, and default `go install github.com/gohugoio/hugo@latest` builds.

Common situations: Upgrading from Hugo < v0.141 where deploy was built-in and having existing deploy pipelines break; installing Hugo via apt/snap/brew/scoop packages built without the tag; CI images pulling the plain release archive instead of the withdeploy variant.

Related errors


AI-assisted analysis of gohugoio/hugo@8a468df065 (2026-07-31). Data as JSON: /data/errors/670f13bb6bea8f49.json. Report an issue: GitHub ↗.