Start Your Ghost NPM Server on Mac Log In

Danny Wahl's picture Danny Wahl  •   •  Ghost

If you follow the Ghost documentation to install and start Ghost then you probably just open terminal, cd to your install directory and type npm start, this leaves you with a terminal window always opened. There's a few simple steps you can take to get node, and therefore Ghost, running on log in on OS X.

The first is to install the NPM package forever:

npm install forever -g

Next you should copy this .plist and save it to ~/Library/LaunchAgents/node.forever.ghost.plist.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
		<string>[PATH TO GHOST]/ghost/index.js</string>

replacing [PATH TO GHOST] with the path to your Ghost installation. Finally load the launchAgent:

launchctl load ~/Library/LaunchAgents/node.forever.ghost.plist 

Now you can head to your ghost URL (default http://localhost:2368) and start blogging- node forever will start ghost every time you log in to your Mac.

Share this post