# Package.json like version manager for Hugo?

**URL:** <https://discourse.gohugo.io/t/package-json-like-version-manager-for-hugo/56721>\
**Category:** support\
**Created:** [February 14, 2026, 10:33am UTC](https://discourse.gohugo.io/t/package-json-like-version-manager-for-hugo/56721 "2026-02-14T10:33:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![user645235](https://avatars.discourse-cdn.com/v4/letter/u/df788c/32.png) [@user645235](https://discourse.gohugo.io/u/user645235)\
**Post date:** [February 14, 2026, 10:33am UTC](https://discourse.gohugo.io/t/package-json-like-version-manager-for-hugo/56721/1 "2026-02-14T10:33:00Z")

</div>

Hello friends!

Let’s say I have an old website that was built with an older version of Hugo.

If I install Hugo on a different PC or laptop, the official installers always installs the latest version.

Why isn’t there something like a `package.json` file, where a specific version of the framework is defined? With tools like `npm`, you can run `npm install` and automatically install the exact version required to run the website without surprise errors.

My main concern is if my website was built with an older version of Hugo, what happens if some methods or functions are deprecated or removed in newer versions? I might run into errors?

Technically, it would make much more sense if I could install and run a specific version of Hugo required for each site based on version control system.

Don’t you think it’s a necessary feature?

---

<div class="post-metadata">

**Author:** ![kijana](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@kijana](https://discourse.gohugo.io/u/kijana)\
**Post date:** [February 14, 2026, 10:35am UTC](https://discourse.gohugo.io/t/package-json-like-version-manager-for-hugo/56721/2 "2026-02-14T10:35:03Z")

</div>

@user645235 see [GitHub - jmooring/hvm: Hugo Version Manager](https://github.com/jmooring/hvm).

---

<div class="post-metadata">

**Author:** ![markupandmatcha](https://avatars.discourse-cdn.com/v4/letter/m/ec9cab/32.png) [@markupandmatcha](https://discourse.gohugo.io/u/markupandmatcha)\
**Post date:** [February 15, 2026, 9:40pm UTC](https://discourse.gohugo.io/t/package-json-like-version-manager-for-hugo/56721/3 "2026-02-15T21:40:36Z")

</div>

The Hugo Version Manager that was linked is great, but there are a couple of other approaches worth knowing about too:

1. **Netlify/Vercel config** : If you deploy via Netlify, you can pin the Hugo version in your `netlify.toml`:

```toml
[build.environment]
  HUGO_VERSION = "0.139.0"

```

This means your CI/CD always uses the right version regardless of what is installed locally.

1. **Docker** : Running Hugo in a Docker container with a pinned version tag is another solid approach for team environments. `klakegg/hugo` on Docker Hub has versioned tags.

2. **GitHub Actions** : If you use GitHub Pages, you can pin the version in your workflow file.

But yeah, a built-in `package.json` equivalent would be nice. The closest Hugo has is the `module` system, but that manages theme dependencies rather than the Hugo binary itself. Version pinning at the project level is something a few static site generators still have not solved neatly.

---

<div class="post-metadata">

**Author:** ![kijana](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@kijana](https://discourse.gohugo.io/u/kijana)\
**Post date:** [February 15, 2026, 9:50pm UTC](https://discourse.gohugo.io/t/package-json-like-version-manager-for-hugo/56721/4 "2026-02-15T21:50:24Z")

</div>

> [@markupandmatcha](#):
>
> This means your CI/CD always uses the right version regardless of what is installed locally.

Always recommended to use the same Hugo version locally and in production.

> [@markupandmatcha](#):
>
> `klakegg/hugo` on Docker Hub

Would not recommend that for newer versions. It seems abandoned [klakegg/hugo - Docker Image](https://hub.docker.com/r/klakegg/hugo/).

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [February 15, 2026, 10:48pm UTC](https://discourse.gohugo.io/t/package-json-like-version-manager-for-hugo/56721/5 "2026-02-15T22:48:25Z")

</div>

If you’re looking for a Docker image, you might consider… the official one:  
[https://github.com/gohugoio/hugo/pkgs/container/hugo](https://github.com/gohugoio/hugo/pkgs/container/hugo)

Here’s an example of using the official image when building a project for GitHub Pages:  
[https://github.com/jmooring/hosting-github-pages-official-docker-image/blob/main/.github/workflows/hugo.yaml](https://github.com/jmooring/hosting-github-pages-official-docker-image/blob/main/.github/workflows/hugo.yaml)

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [February 15, 2026, 11:34pm UTC](https://discourse.gohugo.io/t/package-json-like-version-manager-for-hugo/56721/6 "2026-02-15T23:34:03Z")

</div>

In the next release, if you have this in your project configuration:

```auto
[module.hugoVersion]
min = '0.148.0'
max = '0.148.0'

```

And use the `--panicOnWarning` flag:

```plaintext
hugo build --gc --minify --panicOnWarning

```

The build will fail.

I would only use the `--panicOnWarning` flag for the production build, whether local or CI/CD.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [February 17, 2026, 11:34pm UTC](https://discourse.gohugo.io/t/package-json-like-version-manager-for-hugo/56721/7 "2026-02-17T23:34:50Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
