Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Update Ghost w/PM2
# Based on
# Backup the content.
# TODO: Add date suffix.
cp -R ./content /tmp/content-backup
cp ./config.js /tmp/config.js-backup
# Download latest version of Ghost.
curl -LOk
# Unzip downloaded Ghost.
unzip ./ -d /tmp/ghost-latest && rm
# Remove the files that you don't want to update.
rm -R /tmp/ghost-latest/content && /tmp/ghost-latest/config.js
# Replace the old files with the new Ghost files.
rm -r core
cp -u -R /tmp/ghost-latest/* .
# Re-install all dependencies.
rm -r ./node_modules
npm install --production
# npm install sqlite3 --build-from-source
# Restart the server.
pm2 stop REC
NODE_ENV=production pm2 start index.js --name REC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment