Netlify CLI

Documenting the installation process for Netlify CLI in Ubuntu 18.04 on WSL 2 in Windows 10 build 2004, in order to develop with Hugo locally, using the same tools we'll use in production.

Windows #

Set up development #

Install Yarn, Node.js, nvm. Instructions adapted from:

curl -sS | sudo apt-key add -
echo "deb stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install yarn
sudo apt install npm
yarn --version
curl -o- | bash

Then, close the terminal and re-open

nvm --version

Check the latest LTS version of Node.js

nvm install 12.18.1
node --version

Install Netlify Dev

npm install netlify-cli -g

Fix metadata on /mnt/c/, with this post from

sudo umount /mnt/c
sudo mount -t drvfs C: /mnt/c -o metadata

Check for the latest version of Hugo


sudo dpkg -i hugo_extended_0.73.0_Linux-64bit.deb

As I've previously mentioned, I use a Go module, so I need to install Go

sudo tar -C /usr/local -xzf go1.14.4.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin

Then I can run

netlify build --dry

Once I'm happy with that:

netlify build
netlify dev

And then I can read locally with a URL like http://localhost:1313/post/netlify-cli-ubuntu-windows/



Since you've made it this far, sharing this article on your favorite social media network would be highly appreciated 💖! For feedback, please ping me on Twitter.