Deploy Hugo to Netlify
Hugo is the fastest static site generator, capable of building thousands of pages in seconds. Netlify has built-in Hugo support — no plugins or adapters needed. Just connect your repo, and Netlify handles the rest. Hugo + Netlify is one of the most popular combinations for blogs, documentation sites, and marketing pages.
Prerequisites
- Hugo installed locally
- A Hugo site
- A Netlify account
- Git repository (GitHub, GitLab, or Bitbucket)
Step 1: Specify your Hugo version
Netlify includes Hugo but may use an older version. Set the HUGO_VERSION environment variable to ensure your site builds with the correct version.
[build]
command = "hugo"
publish = "public"
[build.environment]
HUGO_VERSION = "0.143.0"Check your local Hugo version with 'hugo version' and use the same version in your Netlify config.
Step 2: Push to Git and import in Netlify
Push your Hugo site to Git and import it in Netlify. Netlify detects Hugo automatically.
Build command: hugo
Publish directory: publicStep 3: Enable Hugo modules (optional)
If your Hugo site uses Go modules for themes, Netlify's build environment includes Go. Set the Go version if needed.
[build.environment]
HUGO_VERSION = "0.143.0"
GO_VERSION = "1.22"Step 4: Deploy
Click 'Deploy site'. Hugo builds are extremely fast — even sites with thousands of pages build in seconds on Netlify. Your site is immediately available on a .netlify.app domain with automatic HTTPS.
netlify.toml Configuration
This configures Hugo to build in production mode on Netlify. Setting HUGO_ENV to 'production' enables minification and other production optimizations. Always pin your Hugo version to avoid unexpected build failures.
[build]
command = "hugo"
publish = "public"
[build.environment]
HUGO_VERSION = "0.143.0"
[context.production.environment]
HUGO_ENV = "production"Common Errors
Error: command error: Unable to locate themeCause: Your Hugo theme is referenced as a Git submodule that wasn't cloned during the build.
Fix: If using a theme as a submodule, add 'git submodule update --init --recursive' before the Hugo build command. Or switch to Hugo Modules: 'hugo mod init' and reference the theme in your config.
Error: this feature is not available in your current Hugo versionCause: Netlify's default Hugo version is older than the one you developed with locally.
Fix: Set the HUGO_VERSION environment variable in netlify.toml to match your local version.
Build failed: 'hugo' not foundCause: This is very rare on Netlify but can happen with custom build images.
Fix: Ensure you're using Netlify's default build image, which includes Hugo. If you need Hugo Extended (for SCSS), set HUGO_EXTENDED=true as an environment variable.
Pro Tips
Hugo builds are so fast on Netlify that you get near-instant deploy previews for every pull request.
Use Hugo's built-in minification with 'hugo --minify' as your build command for smaller output files.
Set up Netlify CMS (now Decap CMS) alongside Hugo for a complete content management workflow.
Monitor your Hugo site's deployment status with the Netli.fyi app — Hugo builds complete in seconds, but you'll still want to catch configuration errors.
Use Netlify's _redirects file or netlify.toml for URL management. Hugo generates static files, so redirects are handled at the CDN level.

Developer Advocate at RevenueCat and creator of Netli.fyi. Building on Netlify since 2019. Writes from hands-on experience deploying dozens of production sites.
Manage Netlify on the go
Download Netli.fyi and monitor your sites, check deploys, and manage your projects from anywhere.