# Install Hugo into your repository

**URL:** <https://discourse.gohugo.io/t/install-hugo-into-your-repository/33564>\
**Category:** tips & tricks\
**Created:** [June 26, 2021, 11:23am UTC](https://discourse.gohugo.io/t/install-hugo-into-your-repository/33564 "2021-06-26T11:23:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![h-enk](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/h-enk/32/11738_2.png) [@h-enk](https://discourse.gohugo.io/u/h-enk)\
**Post date:** [June 26, 2021, 11:23am UTC](https://discourse.gohugo.io/t/install-hugo-into-your-repository/33564/1 "2021-06-26T11:23:44Z")

</div>

Highly recommended if using npm for dependency management: [hugo-installer](https://github.com/dominique-mueller/hugo-installer) by Dominique Müller.

Unlike [hugo-bin](https://github.com/fenneclab/hugo-bin), [hugo-installer](https://github.com/dominique-mueller/hugo-installer) verifies the checksum & runs a health check when installing.

> **[Hugo](https://gohugo.io/)** is one of the most popular static site generators. In the world of web development we usually choose **[npm](https://www.npmjs.com/)** as our dependency management solution. **Hugo** , however, is written in [Go](https://golang.org/) - and thus not integrated into the npm module ecosystem. Instead, users are asked to install Hugo globally on their systems. Suboptimal, really.
> 
> But don’t you worry, **Hugo Installer** is here to help! It’s a small Node.js script which you can use to fetch the correct Hugo binary for your system, e.g. via a `postinstall` hook within a `package.json` file. Neat!
> 
> Features include:
> 
> - 💻 Compatible with all operating systems and system architectures (Windows, MacOS, Linux, …, CI/CD)
> - ⭐ Supports all Hugo versions, including extended version
> - ❤ Verifies checksum & runs health check when installing
> - 👀 Recognizes already downloaded binaries

---

<div class="post-metadata">

**Author:** ![peaceiris](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/peaceiris/32/7358_2.png) [@peaceiris](https://discourse.gohugo.io/u/peaceiris)\
**Post date:** [June 26, 2021, 11:40am UTC](https://discourse.gohugo.io/t/install-hugo-into-your-repository/33564/2 "2021-06-26T11:40:15Z")

</div>

Good share. I’m interested in whether they have any plan to enjoy the power of Dependabot (to bump Hugo version, not its) and dart-sass.

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [June 27, 2021, 7:17am UTC](https://discourse.gohugo.io/t/install-hugo-into-your-repository/33564/3 "2021-06-27T07:17:55Z")

</div>

> [@h-enk](#):
>
> But don’t you worry, **Hugo Installer** is here to help! It’s a small Node.js script which you can use to fetch the correct Hugo binary for your system, e.g. via a `postinstall` hook within a `package.json` file. Neat!

How would dependabot know which Hugo to load? I don’t think it has THAT abilities. But maybe, as the binaries are installed in our own project via postinstall hook, it could just be solved by a parallel semver number for the hugo-installer project instead of 3.0.1

---

<div class="post-metadata">

**Author:** ![peaceiris](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/peaceiris/32/7358_2.png) [@peaceiris](https://discourse.gohugo.io/u/peaceiris)\
**Post date:** [June 27, 2021, 7:34am UTC](https://discourse.gohugo.io/t/install-hugo-into-your-repository/33564/4 "2021-06-27T07:34:43Z")

</div>

> [@davidsneighbour](#):
>
> How would dependabot know which Hugo to load?

Specifically, I meant **a default Hugo version** the installer has. If the installer has that, update and publish it to npm continuously, Dependabot can detect the latest version of the installer including the latest Hugo version, and create a pull-request automatically. This is a reason I love to use the [hugo-bin](https://github.com/fenneclab/hugo-bin).

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [June 27, 2021, 7:38am UTC](https://discourse.gohugo.io/t/install-hugo-into-your-repository/33564/5 "2021-06-27T07:38:07Z")

</div>

They could add a script that loads once daily (or more often) the Github API delivered release info and _tadaah_ we have the latest version number. There are some very old version numbers in a JSON file in there already, so they might have had tried it before.

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [June 27, 2021, 11:59am UTC](https://discourse.gohugo.io/t/install-hugo-into-your-repository/33564/6 "2021-06-27T11:59:59Z")

</div>

I put a proposal forward on the repo. With proper automatic release management we would have fewer issues handing over finished projects to the end-users 🙂

> <https://github.com/dominique-mueller/hugo-installer/issues/36>
>
> How about some form of release management? You could load the API based release …info of Hugo (via workflow every x hours) and the installer could, in case I do NOT select a specific version always install/update to the latest available version. 
> 
> See discussion here: https://discourse.gohugo.io/t/install-hugo-into-your-repository/33564
> 
> You can receive up-to-date info about releases from here: https://api.github.com/repos/gohugoio/hugo/releases
> 
> I know it's a lot of work, but it probably would make it easier to update Hugo downstream without having to release a tagged version each time Hugo updates. 
> 
> Included in this proposal/feature request is the ability to "install latest hugo" and maintain the currently up-to-date version of Hugo without brain work.
