How To Keep Ghost Running With pm2

Article By: steve


img

ghost VPS BIP media hosting

Introduction to Ghost

When installing manually on a VPS, most people wonder how to keep Ghost running after their terminal session has ended. There are multiple ways to do this, the most popular way currently being forever and pm2 is a great alternative. It's Very easy to setup and use. Here are the steps to installing pm2 with Ghost:

Note: These commands should be run from a non root user that is dedicated to running this process.

cd /path/to/ghost/folder
sudo npm install -g pm2
echo "export NODE_ENV=production" >> ~/.profile
source ~/.profile
pm2 kill
pm2 start index.js --name ghost
pm2 dump
pm2 startup 


In the last command you will need to set the start up mode based on your operating system. For example if you are running in Amazon then your command will be: pm2 startup amazon.

Once you have it up and running with pm2 some other useful pm2 commands are:

  • pm2 status
  • pm2 stop
  • pm2 monit
  • pm2 logs pm2 status command will allow you to see some useful status. Three useful things to note from the command will be the id, Uptime, and err logs columns. These are very valuable.


The pm2 logs command will give you live output.

And the pm2 monit command will give you live status on the memory footprint.

If you want more information on pm2, here is a link to their GitHub page.  


Tags: , , , , ,


Welcome to the healthcare-only HIPAA - GDPR compliant cloud. Exclusively hosted on a HPC environment!

Learn more or start today by choosing your secure HIPAA - GDPR compliant server's Operating System bellow and pick the package that's best for you.

BIPmd makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine, thousand or more.



Windows VPS options and add ons
Linux VPS options and add ons

>

Looking for a custom solution?

Our technicians can provide you with the best custom-made solutionss on the market, no matter whether you're a small business or large enterprise.

Get in touch

Leave a Reply



Feedbacks