Skip to content

Deploy Hugo

Hugo is a Go-based static site generator. deploybase runs Hugo builds in a dedicated Docker image with extended features including Sass/SCSS support.

  • Hugo site with a valid config.toml, config.yaml, or hugo.toml configuration file

No special configuration needed. Hugo sites build with hugo --minify by default.

SettingValue
Frameworkhugo
Build commandhugo --minify
Output directorypublic
Install command— (none)
Docker imagehugomods/hugo:0.139.0

Hugo does not have a dependency install step. The Docker image includes Hugo with extended features.

Terminal window
curl -X POST https://api.deploybase.eu/api/v1/projects \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "My Hugo Site",
"framework": "hugo",
"git_repo_url": "https://github.com/user/hugo-site.git",
"git_provider": "github"
}'

To pass additional Hugo flags:

Terminal window
curl -X PATCH https://api.deploybase.eu/api/v1/projects/PROJECT_ID \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"build_command": "hugo --minify --baseURL https://blog.example.com"}'

Theme not found — Hugo themes added as Git submodules must be included in the repository. Ensure the submodule is initialized. Alternatively, install the theme as a Hugo module.

Hugo version mismatch — deploybase uses Hugo 0.139.0. If your site requires a different version, check for breaking changes in the Hugo release notes.

Custom output directory — If your Hugo config sets publishDir to something other than public, update the project’s output_dir to match.

Sass/SCSS — The extended Hugo image supports Sass/SCSS transpilation natively. No additional setup needed.