Before you begin
This page describes the prerequisites for building a site that uses Docsy as a Hugo Module.
Install Hugo
You need a
recent extended version
(version 0.158.0 or later) of Hugo
to do local builds and previews of sites (like this one) that use Docsy. If you
install from the release page, make sure to get the extended Hugo version,
which supports
SCSS; you
may need to scroll down the list of releases to see it.
For comprehensive Hugo documentation, see gohugo.io.
On Linux
If you’ve already installed Hugo, check your version:
hugo version
If the result is 0.158.0 or earlier, or if you don’t see
Extended, you’ll need to install the latest version. You can see a complete
list of Linux installation options in
Install Hugo. The following shows you
how to install Hugo from the release page:
Go to the Hugo releases page.
In the most recent release, scroll down until you find a list of Extended versions.
Download the latest extended version.
Create a new directory:
mkdir hugoExtract the files you downloaded to
hugo.Switch to your new directory:
cd hugoInstall Hugo:
sudo install hugo /usr/bin
On macOS
Install Hugo using Brew.
As an npm module
You can conveniently install any Hugo version using hugo-extended (replace
latest with the version you want to install):
npm install hugo-extended@latest --save-dev
Install Go language
Hugo’s commands for module management require that the Go programming language
is installed on your system. Check whether go is already installed:
$ go version
go version go1.25.6
Ensure that you are using version 1.12 or higher.
If the go language is not installed on your system yet or if you need to
upgrade, go to the download area of the Go website, choose
the installer for your system architecture and execute it. Afterwards, check for
a successful installation.
Install Git VCS client
Hugo’s commands for module management require that the git client is installed
on your system. Check whether git is already present in your system:
$ git version
git version 2.52.0
If no git client is installed on your system yet, go to the
Git website, download the installer for your system
architecture and execute it. Afterwards, check for a successful installation.
Install Node.js
Docsy sources its Bootstrap and Font Awesome assets from npm, so you need
Node.js (which provides npm, the Node package manager)
to install them. Install or upgrade to the active long-term support (LTS)
release, then check your version:
node -v
You install these assets when you create your site, as described in the next steps.
Install PostCSS (optional)
This section applies to all installation options, not just Hugo-module setups.
Docsy builds its CSS without PostCSS by default, so most sites don’t need it. Install PostCSS only if:
- Your site has a right-to-left (RTL) language, or
- You post-process your own CSS with a project-root
postcss.config.{js,mjs,cjs}file.
If either applies, install PostCSS from your project root:
npm install --save-dev autoprefixer postcss-cli
npm also installs postcss itself, as a peer dependency of the
packages listed above. If you use a package manager that doesn’t auto-install
peer dependencies, such as Yarn, add postcss to the install command.
What’s next?
With all prerequisites installed, choose how to start off with your new Hugo site
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.