gohugoio/hugo · warning
multihost change detected, please restart server
Error message
multihost change detected, please restart server
What it means
Returned by reloadConfig during a live config reload in `hugo server` when the number of configured languages changed and either the old or new configuration is multihost (per-language baseURLs). The multihost server wires one HTTP server per language at startup, so adding/removing a language can't be applied via hot reload and Hugo asks for a restart instead of serving an inconsistent state.
Source
Thrown at commands/hugobuilder.go:1181
return
}
func (c *hugoBuilder) reloadConfig() error {
c.r.resetLogs()
c.r.configVersionID.Add(1)
if err := c.withConfOrOldConfE(func(conf *commonConfig) error {
oldConf := conf
c.conf = nil
newConf, err := c.r.ConfigFromConfig(configKey{counter: c.r.configVersionID.Load()}, conf)
if err != nil {
return err
}
sameLen := len(oldConf.configs.Languages) == len(newConf.configs.Languages)
if !sameLen {
if oldConf.configs.IsMultihost || newConf.configs.IsMultihost {
return errors.New("multihost change detected, please restart server")
}
}
c.conf = newConf
return nil
}); err != nil {
return err
}
if c.onConfigLoaded != nil {
if err := c.onConfigLoaded(true); err != nil {
return err
}
}
return nil
}
View on GitHub ↗ (pinned to 8a468df065)
Solutions
- Stop and restart `hugo server` — the new language set will be picked up on startup.
- If you want hot reloads while iterating, avoid per-language baseURLs (non-multihost) during development.
Defensive patterns
Strategy: retry
Validate before calling
// avoid editing multihost-related config (languages' baseURL entries) // while the dev server is running; plan such changes for a restart
Try / catch
if err := server.Run(); err != nil {
if strings.Contains(err.Error(), "multihost change detected") {
// config edit toggled multihost mode; restart the server process
return restartServer()
}
return err
} Prevention
- Treat changes to per-language baseURL (which toggle multihost mode) as restart-requiring
- In wrappers/supervisors, detect this message and automatically restart the hugo server process
- Don't attempt to continue the live-reload session after this error — state is stale; a clean restart is the fix
When it happens
Trigger: Editing the site config while `hugo server` is running such that len(languages) changes (adding or removing a [languages.xx] block) while multihost mode is active before or after the change — i.e. languages have distinct baseURL values.
Common situations: Iterating on a multilingual site in server mode and adding a new language section, or adding a per-language baseURL (switching into multihost) together with a language count change.
Related errors
- --appendPort=false not supported when in multihost mode
- failed to compile Headers glob %q: %w
- redirects must have either From or FromRe set
- failed to compile Redirect glob %q: %w
- failed to compile Redirect regexp %q: %w
AI-assisted analysis of gohugoio/hugo@8a468df065 (2026-07-31).
Data as JSON: /data/errors/75950aaae54b46e1.json.
Report an issue: GitHub ↗.