Debian Codegraph @

docs/content/en/installation/windows.md

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