| 1 |
--- |
| 2 |
title: Windows |
| 3 |
description: Install Hugo on Windows. |
| 4 |
categories: [] |
| 5 |
keywords: [] |
| 6 |
weight: 30 |
| 7 |
--- |
| 8 |
|
| 9 |
> [!NOTE] |
| 10 |
> Hugo requires Windows 10, Windows Server 2016, or later. |
| 11 |
|
| 12 |
{{% include "/_common/installation/01-editions.md" %}} |
| 13 |
|
| 14 |
{{% include "/_common/installation/02-prerequisites.md" %}} |
| 15 |
|
| 16 |
{{% include "/_common/installation/03-prebuilt-binaries.md" %}} |
| 17 |
|
| 18 |
## Package managers |
| 19 |
|
| 20 |
### Chocolatey |
| 21 |
|
| 22 |
[Chocolatey][] is a free and open-source package manager for Windows. To install the extended edition of Hugo: |
| 23 |
|
| 24 |
```sh |
| 25 |
choco install hugo-extended |
| 26 |
``` |
| 27 |
|
| 28 |
### Scoop |
| 29 |
|
| 30 |
[Scoop][] is a free and open-source package manager for Windows. To install the extended edition of Hugo: |
| 31 |
|
| 32 |
```sh |
| 33 |
scoop install hugo-extended |
| 34 |
``` |
| 35 |
|
| 36 |
### Winget |
| 37 |
|
| 38 |
[Winget][] is Microsoft's official free and open-source package manager for Windows. To install the extended edition of Hugo: |
| 39 |
|
| 40 |
```sh |
| 41 |
winget install Hugo.Hugo.Extended |
| 42 |
``` |
| 43 |
|
| 44 |
To uninstall the extended edition of Hugo: |
| 45 |
|
| 46 |
```sh |
| 47 |
winget uninstall --name "Hugo (Extended)" |
| 48 |
``` |
| 49 |
|
| 50 |
## Build from source |
| 51 |
|
| 52 |
To build Hugo from source you must install: |
| 53 |
|
| 54 |
1. [Git][] |
| 55 |
1. [Go][] version {{% current-go-version %}} or later |
| 56 |
|
| 57 |
> [!NOTE] |
| 58 |
> The Bash-style `KEY=VALUE cmd` syntax used in the macOS and Linux build-from-source instructions does not work in PowerShell or Command Prompt. Use the code block matching your shell. |
| 59 |
|
| 60 |
### Standard edition |
| 61 |
|
| 62 |
To build and install the standard edition: |
| 63 |
|
| 64 |
PowerShell: |
| 65 |
|
| 66 |
```powershell |
| 67 |
$env:CGO_ENABLED=0; go install github.com/gohugoio/hugo@latest |
| 68 |
``` |
| 69 |
|
| 70 |
Command Prompt: |
| 71 |
|
| 72 |
```bat |
| 73 |
set CGO_ENABLED=0 |
| 74 |
go install github.com/gohugoio/hugo@latest |
| 75 |
``` |
| 76 |
|
| 77 |
### Deploy edition |
| 78 |
|
| 79 |
{{< new-in v0.159.2 />}} |
| 80 |
|
| 81 |
To build and install the deploy edition: |
| 82 |
|
| 83 |
PowerShell: |
| 84 |
|
| 85 |
```powershell |
| 86 |
$env:CGO_ENABLED=0; go install -tags withdeploy github.com/gohugoio/hugo@latest |
| 87 |
``` |
| 88 |
|
| 89 |
Command Prompt: |
| 90 |
|
| 91 |
```bat |
| 92 |
set CGO_ENABLED=0 |
| 93 |
go install -tags withdeploy github.com/gohugoio/hugo@latest |
| 94 |
``` |
| 95 |
|
| 96 |
### Extended edition |
| 97 |
|
| 98 |
To build and install the extended edition, first install a C compiler such as [GCC][] or [Clang][] and then run the following command: |
| 99 |
|
| 100 |
PowerShell: |
| 101 |
|
| 102 |
```powershell |
| 103 |
$env:CGO_ENABLED=1; go install -tags extended github.com/gohugoio/hugo@latest |
| 104 |
``` |
| 105 |
|
| 106 |
Command Prompt: |
| 107 |
|
| 108 |
```bat |
| 109 |
set CGO_ENABLED=1 |
| 110 |
go install -tags extended github.com/gohugoio/hugo@latest |
| 111 |
``` |
| 112 |
|
| 113 |
### Extended/deploy edition |
| 114 |
|
| 115 |
To build and install the extended/deploy edition, first install a C compiler such as [GCC][] or [Clang][] and then run the following command: |
| 116 |
|
| 117 |
PowerShell: |
| 118 |
|
| 119 |
```powershell |
| 120 |
$env:CGO_ENABLED=1; go install -tags extended,withdeploy github.com/gohugoio/hugo@latest |
| 121 |
``` |
| 122 |
|
| 123 |
Command Prompt: |
| 124 |
|
| 125 |
```bat |
| 126 |
set CGO_ENABLED=1 |
| 127 |
go install -tags extended,withdeploy github.com/gohugoio/hugo@latest |
| 128 |
``` |
| 129 |
|
| 130 |
> [!NOTE] |
| 131 |
> See these [detailed instructions][] to install GCC on Windows. |
| 132 |
|
| 133 |
## Comparison |
| 134 |
|
| 135 |
|Prebuilt binaries|Package managers|Build from source |
| 136 |
:--|:--:|:--:|:--: |
| 137 |
Easy to install?|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark: |
| 138 |
Easy to upgrade?|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark: |
| 139 |
Easy to downgrade?|:heavy_check_mark:|:heavy_check_mark: [^2]|:heavy_check_mark: |
| 140 |
Automatic updates?|:x:|:x: [^1]|:x: |
| 141 |
Latest version available?|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark: |
| 142 |
|
| 143 |
[^1]: Possible but requires advanced configuration. |
| 144 |
[^2]: Easy if a previous version is still installed. |
| 145 |
|
| 146 |
[Chocolatey]: https://chocolatey.org/ |
| 147 |
[Clang]: https://clang.llvm.org/ |
| 148 |
[GCC]: https://gcc.gnu.org/ |
| 149 |
[Git]: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git |
| 150 |
[Go]: https://go.dev/doc/install |
| 151 |
[Scoop]: https://scoop.sh/ |
| 152 |
[Winget]: https://learn.microsoft.com/en-us/windows/package-manager/ |
| 153 |
[detailed instructions]: https://discourse.gohugo.io/t/41370 |