After I got it spun up, I wanted to update Ghost from 3 to 3.4. As I did, I figured I’d document some of the steps I went through for both updating Ghost and also a few other nice tips I stumbled into.
You can see the project here - just remix to get started:
Steps to update Ghost
Ghost on Glitch is installed with a bit of a workaround due to disk size. As a result, you can’t simply run the
ghost update command within the Glitch terminal. So here’s a workaround that is working for current builds. This example is done updating 3.0.0 to 3.40.2.
- Install Ghost locally (using the same version you’re running on Glitch). First install the ghost-cli with
npm install ghost-cliand then install your version (in my case, 3.0.0) with
ghost install 3.0.0 --local.
- Download your project’s
.data/ghost-local.dbfrom your glitch project. It may be easiest to simply download your whole project and fish it out of the
.datahidden folder. I opened up my terminal to the app’s folder and used
mv .data/ghost-local.db ghost-local.dbto bring it to the project root folder.
ghost-local.dbto your local install’s data folder. By default, that’s
LOCAL_GHOST_INSTALL/content/data. Overwrite the existing sqlite3 db file.
ghost updateto bring your local version up to the latest Ghost version.
- Update your Glitch’s package.json with the relevant package version numbers (that’s ghost, ghost-cli, and knex-migrator).
- Upload your local .db file (now correctly updated to 3.40.2) to the Glitch project’s assets folder
- Move it to your
wget -O .data/ghost-local.db YOUR_URL.
- Wait for everything to update!
Log into your admin page
You probably know this already, but by default your admin page is available at PROJECT_DOMAIN.glitch.com/ghost.
Turn off logs
Ghost’s log files take a huge amount of bandwidth. We’ve turned them off but you can turn them back on within your config file.
Get custom domains working
- Set your domain in config-development.json.base (it’s the one with the line “SET ME!”)
- Duplicate the file and rename it
- Enable Glitch’s custom domains feature by going to the tools drawer and clicking “custom domain”
- Update your
.envfile and set
- If it’s working correctly, logging into your admin panel (PROJECT_DOMAIN.glitch.com/ghost) and clicking “Design” should show your current domain.
- Still not working? Try opening up terminal and typing
enable-pnpm. Sometimes that helps. It’s the Glitch equivalent of turning it off and turning it on again.
Trouble with packages?
I haven’t run into this yet but if you have problems with Sharp or other packages (especially if your project goes to sleep and takes forever to wake up), you might try looking at this thread.