You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/installation/bsd.md
+40-10Lines changed: 40 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,8 +20,6 @@ Unless your specific deployment needs require the extended/deploy edition, we re
20
20
21
21
Most BSD derivatives maintain a repository for commonly installed applications. Please note that these repositories may not contain the [latest release].
[DragonFly BSD] includes Hugo in its package repository. To install the extended edition of Hugo:
@@ -30,8 +28,6 @@ Most BSD derivatives maintain a repository for commonly installed applications.
30
28
sudo pkg install gohugo
31
29
```
32
30
33
-
[DragonFly BSD]: https://www.dragonflybsd.org/
34
-
35
31
### FreeBSD
36
32
37
33
[FreeBSD] includes Hugo in its package repository. To install the extended edition of Hugo:
@@ -40,8 +36,6 @@ sudo pkg install gohugo
40
36
sudo pkg install gohugo
41
37
```
42
38
43
-
[FreeBSD]: https://www.freebsd.org/
44
-
45
39
### NetBSD
46
40
47
41
[NetBSD] includes Hugo in its package repository. To install the extended edition of Hugo:
@@ -50,8 +44,6 @@ sudo pkg install gohugo
50
44
sudo pkgin install go-hugo
51
45
```
52
46
53
-
[NetBSD]: https://www.netbsd.org/
54
-
55
47
### OpenBSD
56
48
57
49
[OpenBSD] includes Hugo in its package repository. This will prompt you to select which edition of Hugo to install:
@@ -60,10 +52,48 @@ sudo pkgin install go-hugo
60
52
doas pkg_add hugo
61
53
```
62
54
63
-
[OpenBSD]: https://www.openbsd.org/
64
-
65
55
{{% include "/_common/installation/04-build-from-source.md" %}}
66
56
57
+
## Docker container
58
+
59
+
### Prerequisites {#docker-prerequisites}
60
+
61
+
Before running the Docker container locally you must install Docker. See the [installation instructions].
62
+
63
+
When building your production site in a [CI/CD](g) workflow, whether you can run the Docker container depends on the service provider. For example, GitHub Pages and GitLab Pages allow you to run the Docker container.
64
+
65
+
To prevent ownership and permission problems, create the Hugo [cache directory](#cache-directory) and ignore the error if the directory already exists:
66
+
67
+
```text
68
+
mkdir -p $HOME/.cache/hugo_cache
69
+
```
70
+
71
+
### Commands
72
+
73
+
To build your site using the latest version:
74
+
75
+
```sh {copy=true}
76
+
docker run --rm -v .:/project -v $HOME/.cache/hugo_cache:/cache ghcr.io/gohugoio/hugo:latest build
77
+
```
78
+
79
+
To build your site and start the embedded web server using the latest version:
80
+
81
+
```sh {copy=true}
82
+
docker run --rm -v .:/project -v $HOME/.cache/hugo_cache:/cache -p 1313:1313 ghcr.io/gohugoio/hugo:latest server --bind="0.0.0.0"
83
+
```
84
+
85
+
To use a specific version, in the commands above replace `latest` with any of the [tagged image versions]. For example, to build your site using v0.136.1:
86
+
87
+
```sh {copy=true}
88
+
docker run --rm -v .:/project -v $HOME/.cache/hugo_cache:/cache ghcr.io/gohugoio/hugo:v0.136.1 build
89
+
```
90
+
91
+
### Cache directory
92
+
93
+
Attaching the host's Hugo cache directory to the container can significantly enhance performance, particularly for large and image-heavy sites. This allows Hugo to reuse previously generated content, reducing the need for repeated processing and transpilation.
94
+
95
+
If you are using a custom Hugo cache directory, in the commands above replace `$HOME/.cache/hugo_cache` with the absolute path to your cache directory.
96
+
67
97
## Comparison
68
98
69
99
|Prebuilt binaries|Repository packages|Build from source
Copy file name to clipboardExpand all lines: content/en/installation/linux.md
+43Lines changed: 43 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -172,6 +172,46 @@ sudo xbps-install -S hugo
172
172
173
173
{{% include "/_common/installation/04-build-from-source.md" %}}
174
174
175
+
## Docker container
176
+
177
+
### Prerequisites {#docker-prerequisites}
178
+
179
+
Before running the Docker container locally you must install Docker Desktop or Docker Engine. See the installation instructions for either [Docker Desktop] or [Docker Engine].
180
+
181
+
When building your production site in a [CI/CD](g) workflow, whether you can run the Docker container depends on the service provider. For example, GitHub Pages and GitLab Pages allow you to run the Docker container.
182
+
183
+
To prevent ownership and permission problems, create the Hugo [cache directory](#cache-directory) and ignore the error if the directory already exists:
184
+
185
+
```text
186
+
mkdir -p $HOME/.cache/hugo_cache
187
+
```
188
+
189
+
### Commands
190
+
191
+
To build your site using the latest version:
192
+
193
+
```sh {copy=true}
194
+
docker run --rm -v .:/project -v $HOME/.cache/hugo_cache:/cache ghcr.io/gohugoio/hugo:latest build
195
+
```
196
+
197
+
To build your site and start the embedded web server using the latest version:
198
+
199
+
```sh {copy=true}
200
+
docker run --rm -v .:/project -v $HOME/.cache/hugo_cache:/cache -p 1313:1313 ghcr.io/gohugoio/hugo:latest server --bind="0.0.0.0"
201
+
```
202
+
203
+
To use a specific version, in the commands above replace `latest` with any of the [tagged image versions]. For example, to build your site using v0.136.1:
204
+
205
+
```sh {copy=true}
206
+
docker run --rm -v .:/project -v $HOME/.cache/hugo_cache:/cache ghcr.io/gohugoio/hugo:v0.136.1 build
207
+
```
208
+
209
+
### Cache directory
210
+
211
+
Attaching the host's Hugo cache directory to the container can significantly enhance performance, particularly for large and image-heavy sites. This allows Hugo to reuse previously generated content, reducing the need for repeated processing and transpilation.
212
+
213
+
If you are using a custom Hugo cache directory, in the commands above replace `$HOME/.cache/hugo_cache` with the absolute path to your cache directory.
214
+
175
215
## Comparison
176
216
177
217
|Prebuilt binaries|Package managers|Repository packages|Build from source
@@ -190,6 +230,8 @@ Latest version available?|:heavy_check_mark:|:heavy_check_mark:|varies|:heavy_ch
Copy file name to clipboardExpand all lines: content/en/installation/macos.md
+44-2Lines changed: 44 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,10 +28,48 @@ Unless your specific deployment needs require the extended/deploy edition, we re
28
28
sudo port install hugo
29
29
```
30
30
31
-
[MacPorts]: https://www.macports.org/
32
-
33
31
{{% include "/_common/installation/04-build-from-source.md" %}}
34
32
33
+
## Docker container
34
+
35
+
### Prerequisites {#docker-prerequisites}
36
+
37
+
Before running the Docker container locally you must install Docker Desktop. See the [installation instructions].
38
+
39
+
When building your production site in a [CI/CD](g) workflow, whether you can run the Docker container depends on the service provider. For example, GitHub Pages and GitLab Pages allow you to run the Docker container.
40
+
41
+
To prevent ownership and permission problems, create the Hugo [cache directory](#cache-directory) and ignore the error if the directory already exists:
42
+
43
+
```text
44
+
mkdir -p $HOME/Library/Caches/hugo_cache
45
+
```
46
+
47
+
### Commands
48
+
49
+
To build your site using the latest version:
50
+
51
+
```sh {copy=true}
52
+
docker run --rm -v .:/project -v $HOME/Library/Caches/hugo_cache:/cache ghcr.io/gohugoio/hugo:latest build
53
+
```
54
+
55
+
To build your site and start the embedded web server using the latest version:
56
+
57
+
```sh {copy=true}
58
+
docker run --rm -v .:/project -v $HOME/Library/Caches/hugo_cache:/cache -p 1313:1313 ghcr.io/gohugoio/hugo:latest server --bind="0.0.0.0"
59
+
```
60
+
61
+
To use a specific version, in the commands above replace `latest` with any of the [tagged image versions]. For example, to build your site using v0.136.1:
62
+
63
+
```sh {copy=true}
64
+
docker run --rm -v .:/project -v $HOME/Library/Caches/hugo_cache:/cache ghcr.io/gohugoio/hugo:v0.136.1 build
65
+
```
66
+
67
+
### Cache directory
68
+
69
+
Attaching the host's Hugo cache directory to the container can significantly enhance performance, particularly for large and image-heavy sites. This allows Hugo to reuse previously generated content, reducing the need for repeated processing and transpilation.
70
+
71
+
If you are using a custom Hugo cache directory, in the commands above replace `$HOME/Library/Caches/hugo_cache` with the absolute path to your cache directory.
72
+
35
73
## Comparison
36
74
37
75
|Prebuilt binaries|Package managers|Build from source
@@ -44,3 +82,7 @@ Latest version available?|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mar
44
82
45
83
[^1]: Easy if a previous version is still installed.
46
84
[^2]: Possible but requires advanced configuration.
> See these [detailed instructions](https://discourse.gohugo.io/t/41370) to install GCC on Windows.
58
58
59
+
## Docker container
60
+
61
+
> [!note]
62
+
> Run the commands in this section from [PowerShell] or a Linux terminal such as WSL or Git Bash. Do not use the Command Prompt.
63
+
64
+
### Prerequisites {#docker-prerequisites}
65
+
66
+
Before running the Docker container locally you must install Docker Desktop. See the [installation instructions].
67
+
68
+
When building your production site in a [CI/CD](g) workflow, whether you can run the Docker container depends on the service provider. For example, GitHub Pages and GitLab Pages allow you to run the Docker container.
69
+
70
+
To prevent ownership and permission problems, create the Hugo [cache directory](#cache-directory) and ignore the error if the directory already exists:
71
+
72
+
```text
73
+
mkdir -f $Env:LocalAppData/hugo_cache
74
+
```
75
+
76
+
### Commands
77
+
78
+
To build your site using the latest version:
79
+
80
+
```sh {copy=true}
81
+
docker run --rm -v .:/project -v $Env:LocalAppData/hugo_cache:/cache ghcr.io/gohugoio/hugo:latest build
82
+
```
83
+
84
+
To build your site and start the embedded web server using the latest version:
85
+
86
+
```sh {copy=true}
87
+
docker run --rm -v .:/project -v $Env:LocalAppData/hugo_cache:/cache -p 1313:1313 ghcr.io/gohugoio/hugo:latest server --bind="0.0.0.0"
88
+
```
89
+
90
+
To use a specific version, in the commands above replace `latest` with any of the [tagged image versions]. For example, to build your site using v0.136.1:
91
+
92
+
```sh {copy=true}
93
+
docker run --rm -v .:/project -v $Env:LocalAppData/hugo_cache:/cache ghcr.io/gohugoio/hugo:v0.136.1 build
94
+
```
95
+
96
+
### Cache directory
97
+
98
+
Attaching the host's Hugo cache directory to the container can significantly enhance performance, particularly for large and image-heavy sites. This allows Hugo to reuse previously generated content, reducing the need for repeated processing and transpilation.
99
+
100
+
If you are using a custom Hugo cache directory, in the commands above replace `%LocalAppData%/hugo_cache` with the absolute path to your cache directory.
101
+
59
102
## Comparison
60
103
61
104
|Prebuilt binaries|Package managers|Build from source
@@ -70,5 +113,8 @@ Latest version available?|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mar
70
113
[^2]: Easy if a previous version is still installed.
0 commit comments