How to Update Ghost on a Digital Ocean Droplet
This guide covers my process for updating my Ghost CMS sites on a Digital Ocean Droplet.
This post contains my SOP for updating the Ghost sites that I have running on Digital Ocean. I've been using this process for a few years now and find it to be helpful since it has all of the commands I need.
What this guide covers:
- Updating Ghost CMS
- On Ubuntu
- Hosting on a Digitial Ocean Droplet
Step 1: Access the Server
Login to the server as root. You can do that with SSH or simply press the console button on the right of the Droplet's header. This button will open up a console window logged in as root.
Step 2: Update the server
Make sure you are root:
sudo su
Run the following commands:
# Update package lists
sudo apt-get update
# Update installed packages
sudo apt-get upgrade
Update Node if needed by following this guide.
Update Ghost CLI:
npm install -g ghost-cli@latest
If needed, restart using:
sudo reboot
Update Ghost Installations
Change to ghost manager user:
sudo -i -u ghost-mgr
Change to the directory you want to update:
cd /var/www && ls
Pick which one you want to update. Directory name ghost
is the default name, but yours may be different. If there are multiple Ghost sites on this server you will want to complete this step for each of them.
Change into the directory of the ghost install you want to manage using cd directory_name
.
Optionally check to see if an update is available by running:
ghost check-update
Make a backup of the ghost site in case something bad happens (should probably backup all the sites on the server before updating). Before making the backup, make sure to make note of your administrator email and password as it's required to make the backup:
ghost backup
Run ghost update to update the site 🤞:
ghost update
Finally, check to make sure the site loads by opening it in a private tab (to avoid caches) and navigating some in the Ghost dashboard.
You've done it! Now, make sure to complete this process regularly to ensure that your site stays up to date with the latest features and security patches.