Skip to content

Instantly share code, notes, and snippets.

@nickisnoble
Created August 4, 2017 14:57
Show Gist options
  • Save nickisnoble/7102c0317cf343a5559a59afc4e2a55c to your computer and use it in GitHub Desktop.
Save nickisnoble/7102c0317cf343a5559a59afc4e2a55c to your computer and use it in GitHub Desktop.
A quick script to update a self hosted Ghost installation (must have root access)
# update server software
apt-get update
# go to web root
cd /var/www/
# Remove any previous zips
rm ghost*.zip
# download the latest version of ghost
curl -LOk https://ghost.org/zip/ghost-latest.zip
# Stop ghost from running
service ghost stop
# Remove ghost core
rm -rf ghost/core
# Unzip and copy updated files
# -uo overwrites only where necessary
unzip -uo ghost*.zip -d ghost
# Reset permissions
chown -R ghost:ghost ghost/*
# Cleanup zip
rm ghost*.zip
# Go into ghost folder
cd ghost
# Install any new dependencies
npm install --production
# Start ghost service again
service ghost start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment