Updating Ghost on Digital Ocean
I've written before that I host this blog on the Ghost blogging platform and I run that on a Digital Ocean Droplet 🌊 for a very reasonable price.
I wanted to update ghost which should have been pretty straight forward although I was finding it to be a bit of a pain. And that's in part because I am a bit hack and slash when it comes to Linux;
So in short my droplet was created using the ghost marketplace install script which at the time installed 8.x of nodejs which ghost 3.x doesn't support, its recommended you move to 10.x.
My machine was being a total pain about updating this package (using the virtual console) so I logged in as root via terminal. I've left my instructions here for anyone getting node update errors/issues.
login via terminal...
ssh root@xxx.xx.xx.xx
you will need to enter your password which should be in your email - you can reset it if required via your digital ocean account (which is a different login and password to your machine!)
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - sudo apt-get install -y nodejs
sudo -i -u ghost-mgr
this switches you over to the non root user that digital ocean sets up for you (you can change 'ghost-mgr' if you setup a different user for this)
cd /var/www/ghost
ghost update
It should now update correctly 😰
Future updates for the foreseeable future should just be possible via running the above commands but this time excluding the one to add the node source and update etc.
Enjoy!