How To Start Ghost With Forever

Article By steve


start Ghost Linux BIP media 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

Tags: , , , , , , , , , ,

Spin Up A VPS Server In No Time Flat

Simple Setup

Full Root Access

Straightforward Pricing


Leave a Reply