How To Start Ghost With Forever

There is a bug with Forever currently that keeps it from starting the process on Windows (some people had trouble on linux, but we did not). If you are on Windows, use the following article to start Ghost in the background: Keep Ghost Alive on Windows XP, 7 and 8

The node module, forever, can be used to start Ghost in the background, and monitor to make sure it stays up. If Ghost crashes, forever will automatically start another instance of Ghost.

Installing Forever

Install forever with this command from within your Ghost directory: npm install -g forever.

Start Ghost with Forever

To start Ghost with forever, run the following command from the Ghost directory (/var/www/ghost/):

 forever start index.js

Ghost defaults to loading the development configurations from config.js. If you want to start Ghost with the production configurations with Ghost run

 NODE_ENV=production forever start index.js

Stop Forever

To stop Ghost with `forever, run the following from the Ghost directory (/var/www/ghost)

 forever stop index.js

Forever Stream Logs to stdout

 forever -f start index.js

Forever Log to File

 forever -l /var/www/ghost/forever.log start index.js

Possible Errors

  1. Error: SQLITE_READONLY: attempt to write a readonly database

Run the forever start command with Sudo or elevated privileges

 sudo forever start index.js

If the last command says it cannot find 'forever', use the full path to forever

 sudo /usr/local/bin/forever start index.js