Installation

Last updated on
15 February 2026

The GOV.UK theme contains full compiled CSS and works out-of-the-box. You only need Node.js if you want to modify and compile the theme’s Sass files.

The current v3.1.x branch of GOV.UK Theme targets GOV.UK Frontend v6.

Detailed install for Ubuntu / Debian / macOS

The following steps work for Debian/Ubuntu and macOS. On Windows, install Node.js from the official website: https://nodejs.org.

1. Check Node.js and npm

node -v
npm -v

2. Do not install Node.js using apt

If you see:

Command 'node' not found, but can be installed with:
sudo apt install nodejs

Do not do this. Distribution packages are often outdated and may not meet GOV.UK Frontend requirements.

Install nvm (Node Version Manager) using the instructions at:

https://github.com/nvm-sh/nvm

Then install the latest Node.js LTS:

nvm install --lts
nvm use --lts
node -v
npm -v

You should now see a recent Node.js version (for example v24.x). npm is included with Node.js.

4. Install theme dependencies

Switch to the GOV.UK theme directory, for example:

cd web/themes/custom/govuk_theme

If a package-lock.json file exists, run:

npm ci

Otherwise run:

npm install

This installs GOV.UK Frontend v6 and all required build dependencies.

Important: Sass compiler requirement

GOV.UK Frontend requires Dart Sass (sass) v1.79.0 or newer. LibSass (node-sass) is not supported.

npm ls sass
npm install -D sass@^1.79.0

Compiling Sass (Gulp)

The theme includes Gulp locally. You do not need a global install.

npx gulp

To automatically compile Sass on changes:

npx gulp watch

Updating dependencies

npm outdated

If packages are listed, update within the allowed version ranges:

npm update

The v3.1.x release line is designed for GOV.UK Frontend v6. Do not downgrade GOV.UK Frontend unless specifically required.

Help improve this page

Page status: No known problems

You can: