Setting Up nvm, Node.js and a Ghost Dev Environment on a Mac for Theme Editing
A detailed look at setting up a local environment with nvm and Node.js for Ghost theme development on a Mac. From installing the Ghost CLI to editing themes — even someone like me with no development experience can install it without much trouble.
From installing Node.js with nvm to running Ghost locally
Now that Ghost is installed, the next step is creating my own blog style. Ghost is well designed for freely modifying themes or building new ones, and for that you need to prepare a local development environment.
Especially on a Mac, errors can occur depending on the system's Node.js version or package setup, so version management is key. This post walks step by step through installing the Node.js version Ghost officially recommends with nvm, then using ghost-cli to run Ghost locally and develop a theme.
1. Understanding the Structure of a Ghost Theme Dev Environment
Ghost is a Node.js-based headless CMS. Themes live in the content/themes directory by default and are written in the Handlebars templating language, an extension of HTML. (For me, it was the most intuitive and easiest to understand of the HTML templating languages.)
To modify or develop a theme, the most efficient flow is to keep a Ghost instance running locally, edit the theme files directly, and check the changes in the browser.
2. Checking the Node.js Version Ghost Officially Recommends
Ghost doesn't support the latest Node.js in every version. The official documentation states:
Ghost 5.x supports 20.x (Node v20 Iron LTS).
https://ghost.org/docs/faq/node-versions/
✅ Recommended version: 20.x (Node v20 Iron LTS)
For stability and compatibility, Ghost only supports LTS (Long-Term Support) versions. That's why you need a version management tool like nvm.
3. Installing nvm (Node Version Manager)
To manage Node.js versions safely on macOS, nvm is the best choice.
⬇ Installation
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bashOnce the install finishes, create the .zshrc file with the following command,
sudo nano .zshrcand paste in the following:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"4. Installing and Using Node.js 20.xx
# Download and install Node.js:
nvm install 20
# Check the Node.js version:
node -v # should print "v20.19.4"
nvm current # should print "v20.19.4"
# Check the npm version:
npm -v # should print 10.8.25. Installing the Ghost CLI
With the Ghost CLI tool you can easily install, run and debug Ghost locally.
npm install ghost-cli@latest -g6. Building a Local Ghost Dev Environment
Now you can install and run Ghost locally.
📁 Create a Directory
mkdir ~/ghost-dev
cd ~/ghost-dev👻 Install Ghost
ghost install localThis command installs Ghost locally with a SQLite DB and starts it automatically.
7. Checking the Local Server and Opening the Admin Page
Once installation completes, Ghost runs at the following addresses by default:
- Blog: http://localhost:2368
- Admin page: http://localhost:2368/ghost
Open it in a browser and go through the user setup.
8. Theme Folder Structure and How to Edit
Ghost themes live in the content/themes directory. You can copy an installed theme (such as Casper) to use as a new theme, or download and apply a theme you like from the Ghost Marketplace.
✍ Basic Theme Customization Flow
cd content/themes
cp -R casper mytheme
cd mythemeAs you edit package.json, default.hbs, index.hbs, partials/ and so on, you can check the results right away on the local server.
Wrapping Up: You Now Have a Basic Environment for Changing Themes
Ghost offers simple yet powerful customization. With the process above, you can start theme development on a Mac, and if needed, version-control your theme with Git or automate deployment.
Above all, this setup using the Ghost CLI and nvm delivers both stable version compatibility and fast reflection of edits at the same time.