Hugo does not host websites. Its hugo command turns your content and templates into a folder of static files, by default named public, and a web server or hosting platform has to serve that folder to visitors. To host a Hugo site yourself, you choose one of two routes: copy the generated files to a virtual host you manage, or connect a Git repository to a platform that builds and deploys the site whenever you push. Neither route requires a particular computer. Running a machine at home is one possible setup, not a requirement.
What “hosting a Hugo site” actually involves
Hugo is a static site generator. When you run hugo in your project folder, it reads your content, templates and configuration, then writes plain HTML, CSS, JavaScript and media files into public. That folder is the deployable output. Visitors never run Hugo; they only receive the files.
As an Amazon Associate I earn from qualifying purchases.
Two consequences follow. First, the work of publishing is always the same in principle: produce the public folder, then make it reachable at a domain. Second, Hugo’s own development tools are for editing, not for serving the public. The Hugo basic usage guide describes building, local preview and transfer as separate steps.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Before you start
- Install Hugo and note the version. Installation methods for Linux are listed in the Hugo Linux installation guide. Run
hugo versionand keep that number; your hosting environment should match it. - Check the output directory.
publicis the default, but thepublishDirsetting in your site configuration can change it. Confirm the actual value before you point a host or a build platform at a folder. - Plan for stale files. Hugo does not empty
publicbefore a build. A page you deleted yesterday can still sit in the output and be published. Section 1 of Route A and the pitfalls list below deal with this.
Route A: copy the output to a virtual host you manage
This is the most direct model. A virtual host is a web-serving space with a document root, usually provided by a hosting company or a server you administer. You build locally and move the generated files there. The Hugo documentation puts it this way:
#1 Best Overall
In a simple hosting environment, where you typically
ftp,rsync, orscpyour files to the root of a virtual host, the contents of thepublicdirectory are all that you need.
Source: Hugo Authors, “Basic usage”.
Step by step
- Clean and build. From the project root, run
hugo --cleanDestinationDir. The flag removes files frompublicthat the current build no longer generates. The equivalent cleanup can be set in the site configuration if you prefer to make it permanent. - Transfer the contents of
public. Copy what is inside the folder to the document root of your virtual host, not the folder itself. Hugo names FTP, rsync and scp as typical methods. A rsync example looks like this, where the trailing slash onpublic/copies its contents and the host and path are placeholders for your own values:rsync -av --delete public/ [email protected]:/var/www/example.com/The
--deleteoption removes files on the server that are absent frompublic. Test withrsync -avn --delete(the-nflag is a dry run) before the first real transfer. - Verify. Open your domain in a browser and check a few pages, the navigation and the assets. If images or stylesheets fail, check whether the
baseURLin your configuration matches the address visitors use.
The trade-off is responsibility. You own the web server configuration, the transfer method, backups and availability. Hugo’s documentation does not prescribe a server product or provider for this route, so those choices are yours.
Route B: connect a Git repository to a build platform
In this model the Hugo project lives in a remote Git repository, and a hosting platform watches it. When you push a commit, the platform runs the build, collects the output and publishes it. You do not transfer files by hand. The platform needs three settings: a build command, an output directory and, optionally, a Hugo version.
Free tools Windows power users keep installed
One-click scans. No signup required.
Cloudflare Pages
The Cloudflare Pages Hugo guide documents the build command hugo and the build output directory public. Two further points matter:
Rank #3
- Base URL. If your pages must contain absolute URLs that match the deployment address, pass the address to Hugo with
-bor--baseURLin the build command. - Hugo version. The guide describes configuring the Hugo version through an environment variable in the build environment, so the hosted build uses the same version you tested locally.
The guide also describes automatic redeployment, so a push to the connected branch starts a new build.
Netlify
The Netlify Hugo guide lists the same suggested build command, hugo, and publish directory, public. It supports setting the Hugo version with the HUGO_VERSION environment variable. Netlify also warns that a mismatch between the local and hosted Hugo versions can cause a failed build.
Themes need one specific handling step. Netlify’s guide states that a theme installed with a plain git clone will not work in its continuous integration system. Add the theme as a Git submodule instead, so the hosted build fetches it along with the rest of the repository.
Local preview is not public hosting
While you edit, run hugo server. It serves the site locally, watches project files, rebuilds when it detects changes and refreshes the browser. The usage guide gives the local address as http://localhost:1313/. The hugo server command reference lists the default bind interface as 127.0.0.1, so by default only your own machine can reach it.
Best Value
The development server is a tool for writing and checking layouts. Publish through Route A or Route B, not by exposing hugo server to the internet.
Choosing a route
The two routes differ mainly in how much server administration you want and how you prefer to deploy.
| Question | Route A: virtual host you manage | Route B: Git-connected platform |
|---|---|---|
| Server and network administration | Yours. You maintain the virtual host and its public availability. | Handled by the platform for the build and publishing pipeline, according to the Cloudflare and Netlify Hugo guides. |
| How deployment happens | Manual or scripted transfer with FTP, rsync or scp. | Push to the connected repository; the platform rebuilds and redeploys. |
| Where version and build settings live | On your machine and in your transfer commands. | In the platform’s build command, output directory and environment variables. |
| Theme handling | Themes are used at build time on your machine; only the output is transferred. | Netlify requires a Git submodule for themes; the Cloudflare guide does not describe the same requirement. |
| Cost, uptime and security guarantees | Not stated in the Hugo documentation reviewed. | Not stated in the Cloudflare or Netlify Hugo guides reviewed; check each provider’s current pricing and terms. |
Choose Route A if you want direct control over the server and are comfortable operating it. Choose Route B if you want pushes to publish and prefer that the platform run the build. Either route works with the same Hugo project.
Recommended Free Tools
Common pitfalls and fixes
- Old pages still appear. Build with
--cleanDestinationDirlocally, or usersync --deleteso the server matchespublic. - Wrong folder uploaded. Confirm
publishDirbefore transferring. Uploading the project root instead ofpublicpublishes source files, not the site. - Hosted build differs from local output. Pin the Hugo version in the platform’s environment variables to the version from
hugo version. - Theme missing on Netlify. Re-add the theme as a Git submodule rather than a plain clone.
- Links point to the wrong address. Check
baseURLin the configuration, and on Cloudflare Pages pass-bor--baseURLat build time when absolute URLs are needed. - The site works only on your machine. You are probably visiting
http://localhost:1313/, which exists only whilehugo serverruns.
Provider interfaces, supported Hugo versions and pricing change over time. The Hugo, Cloudflare and Netlify pages above were checked in early October 2026; confirm current labels and settings in each provider’s documentation before you deploy.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




