Hugo builds locally; the host only sees public/
Hugo is a static site generator: Markdown in, HTML out. StaticHost publishes the out. There is no Hugo binary on the server, no hugo server remote, and no theme compilation step in the cloud. Your laptop or CI runs Hugo; the host serves public/.
Configure baseURL
In hugo.toml / config.toml:
baseURL = "https://example.com/"
languageCode = "en-us"
title = "Example"
For first deploys on StaticHost preview, you can temporarily set baseURL to the preview origin or use relative URLs carefully. Wrong baseURL produces wrong canonical links and sometimes wrong asset paths depending on theme. When the custom domain is live, set baseURL to that HTTPS canonical URL and rebuild.
Build commands
hugo version
hugo --minify
ls public
--minify shrinks HTML/CSS/JS output. Useful flags:
hugo --minify --gc
hugo --environment production
Themes and modules must be present locally (git submodule update --init if themes are submodules):
git submodule update --init --recursive
hugo --minify
Output directory defaults to public/. Publish contents of public/:
cd public && zip -r ../hugo-site.zip .
Verify index.html at archive root. Upload to StaticHost or push public contents to a deploy branch. Nested zip mistakes: zip guide.
CI without remote Hugo on StaticHost
Example pattern: GitHub Actions installs Hugo, builds, uploads artifact or commits to gh-pages-style branch that StaticHost reads. StaticHost itself still just receives files—git deploy.
Pretty URLs and strict nginx
Hugo emits directories with index.html for pretty URLs (/posts/my-post/). That maps cleanly to try_files $uri $uri/ =404. You generally will not hit SPA fallback problems unless you embedded a history-mode JS app inside a Hugo layout. If you did, read SPA hosting.
Taxonomies, aliases, and redirects
Hugo aliases generate extra HTML stubs—good for static hosts. Do not expect Apache .htaccess redirect semantics. Prefer alias pages or external DNS/host features you control.
Media and memory
Image processing happens at build time on your machine (hugo image funcs). Upload the processed results. Large photo sites may need Pro (10 GB) or Scale (30 GB) rather than Starter (2 GB). Plans: Starter $9, Pro $30 (also staging + 3 sites), Scale $65 (10 sites), Business $130 (30 sites, teams, 100 GB). Trial ~1 day.
Verify on StaticHost
- Deploy
public/contents; open HTTPS preview. - Check home, a section list, a single post, RSS if you publish it.
- View source for asset paths matching
baseURLexpectations. - Roll back if a theme upgrade broke layouts.
- Point DNS; certificate after verification—custom domain.
No cPanel, email, built-in CDN, forever-free, or WordPress runtime.
Worked example: multilingual section with aliases
# hugo.toml excerpt
baseURL = "https://docs.example.com/"
defaultContentLanguage = "en"
[languages.en]
weight = 1
languageName = "English"
[languages.es]
weight = 2
languageName = "Español"
hugo --minify
find public -type f -name 'index.html' | head
# confirm public/es/... exists before zipping
cd public && zip -r ../hugo-docs.zip .
Deploy, open HTTPS preview, hard-open /es/ and an English post URL. If Spanish pages 404, your language config never emitted files—fix Hugo, not nginx. Add aliases in front matter when renaming posts so old URLs keep HTML stubs that static hosting can serve. Custom domain certificates still wait on DNS verification after preview looks right—static hosting with a custom domain. Pair with static documentation hosting when the Hugo site is primarily docs.
Content editors and Hugo’s boundary
If non-engineers edit Markdown, give them a preview path that runs hugo server locally or in a ephemeral CI preview environment you own—not a fantasy that StaticHost will compile drafts on save. Publish still means hugo --minify and an upload of public/. That boundary keeps the live host stable while editors iterate.
Failure table: Hugo on StaticHost
| Symptom | Likely cause | Fix |
|---|---|---|
| Host “can’t find hugo” | Expected remote binary | Install Hugo in CI/laptop only |
| CSS/canonical wrong | Bad baseURL | Set HTTPS canonical; rebuild |
| Theme missing partials | Submodules not fetched | git submodule update --init --recursive |
| Nested blank site | Zipped public/ as subfolder | Zip contents of public |
| Drafts on production | Used hugo -D for release | Production build without -D |
| Images huge / quota | Processed poorly / originals uploaded | Use Hugo image pipeline; web sizes |
| JS app routes 404 | Embedded history SPA | Hash/prerender or remove SPA |
Extra procedure: Hugo release checklist
git submodule update --init --recursivehugo --minify(Extended if theme needs it)- Spot-check
public/for home, a post, taxonomy, 404 page if you ship one grep -R "http://" public | headfor mixed content before HTTPS custom domains—SSL- Zip/push artifacts; deploy; HTTPS preview QA
- Only then DNS → verify → cert
- Keep previous deploy for rollback after theme upgrades
- Remember non-features: no email, no cPanel, no CDN product, no forever-free after trial, no SPA fallback
JAMstack framing without fog: jamstack hosting for beginners. Hugo stays a local/CI compiler; StaticHost stays a file host.
Theme upgrades without surprise outages
Hugo themes move under your feet. A submodule bump that looks harmless on hugo server can change partial names, asset pipelines, or SCSS assumptions that only appear after hugo --minify. Treat theme upgrades like dependency upgrades in any other stack.
- Branch locally; update the theme submodule intentionally.
- Build production output; diff
public/sizes and spot-check critical templates (home, single, list, 404). - Deploy to StaticHost HTTPS preview—or Pro staging—before production.
- If layouts collapse, roll back the StaticHost deploy first, then revert the submodule.
Do not combine a theme upgrade, a baseURL change, and a DNS cutover on the same afternoon. Sequence reduces mystery. StaticHost still will not run Hugo for live reload; your CI must install Hugo Extended when the theme requires it. Keep aliases for renamed docs so old inbound links keep serving HTML stubs under try_files $uri $uri/ =404 instead of soft-404 confusion. When editors ask for on-server draft compilation, restate the boundary: drafts with hugo server -D locally, production with a non-draft minify build, files only on the host. That sentence saves more outages than any theme tweak.
FAQ
Can StaticHost run hugo server for live reload?
No. Develop locally with hugo server; publish with hugo --minify.
Where do extended Sass features run?
On your machine with Hugo Extended. Install Extended locally/CI before build.
Should I upload the whole Hugo repo?
No. Upload public/ output only (plus whatever static files Hugo already copied there).
How do I preview drafts?
hugo server -D locally. Do not publish draft-enabled production builds by accident (hugo -D on production is a common mistake).
Is Hugo “JAMstack”?
It can be part of a JAMstack-style flow. StaticHost hosts the markup/assets piece without platform functions—JAMstack beginners.