Ghost 4.x + SQlite3 : Support

Hi Guys,

I’ve decided to do a “fresh install” to move to Ghost V4 → Currently use Ghost V3 + SQlite3 (ghost install --db sqlite3)
However I have an issue when running “Ghost Start”

Cannot find module 'sqlite3'

Some research on google led me to an issue on Github : Ghost 4.0.1 + Sqlite 3 : Missing module · Issue #12788 · TryGhost/Ghost · GitHub

So I’m wondering if SQlite3 still supported ? (small blog)
According Documentation I know that MySQL is recommended for production but SQlite3 has worked smoothly over 3 years for me now :wink:

Thank you in advance,

1 Like

sqlite3 is definitely still supported! Can you provide more information - are you installing Ghost locally or on a server? What commands did you run?

I’ve run into this issue a few times and found that force re-updating ghost to the current version helps

ghost version
ghost update {version} --force

@vikaspotluri123 I ran into the same issue and made a separate thread for it before I saw this post. Linking it here for convenience. Ghost 4.1.0 does not seem to work with an sqlite database without additional manual setup


It’s a fresh Install on a new server (Ubuntu 20.04)


# Add the NodeSource APT repository for Node 14
curl -sL | sudo -E bash

# Install Node.js
sudo apt-get install -y nodejs

# Install Ghost Cli
sudo npm install ghost-cli@latest -g
 ghost install --db sqlite3
✔ Checking system Node.js version
✔ Checking logged in user
✔ Checking current folder permissions
✔ Checking system compatibility
✔ Checking memory availability
✔ Checking free space
✔ Checking for latest Ghost version
✔ Setting up install directory
✔ Downloading and installing Ghost v4.1.0
✔ Finishing install process
? Enter your blog URL:
✔ Configuring Ghost
✔ Setting up instance
+ sudo useradd --system --user-group ghost
+ sudo chown -R ghost:ghost /var/www/blog/content
✔ Setting up "ghost" system user
? Do you wish to set up Systemd? Yes
+ sudo mv /tmp/X-X-X-X/ghost_X-X-X-X.service /lib/systemd/system/ghost_X-X-X-X.service
+ sudo systemctl daemon-reload
✔ Setting up Systemd
+ sudo systemctl is-active ghost_X-X-X-X
? Do you want to start Ghost? Yes
+ sudo systemctl start ghost_X-X-X-X
+ sudo systemctl stop ghost_X-X-X-X
✖ Starting Ghost
One or more errors occurred.

1) GhostError

Message: Ghost was able to start, but errored during boot with: Knex: run
$ npm install sqlite3 --save
Cannot find module 'sqlite3'
Require stack:
- /var/www/blog/versions/4.1.0/node_modules/knex/lib/dialects/sqlite3/index.js
- /var/www/blog/versions/4.1.0/node_modules/knex/lib/config-resolver.js
- /var/www/blog/versions/4.1.0/node_modules/knex/lib/knex.js
- /var/www/blog/versions/4.1.0/node_modules/knex/lib/index.js
- /var/www/blog/versions/4.1.0/node_modules/knex/knex.js
- /var/www/blog/versions/4.1.0/node_modules/knex-migrator/lib/database.js
- /var/www/blog/versions/4.1.0/node_modules/knex-migrator/lib/index.js
- /var/www/blog/versions/4.1.0/core/server/data/db/state-manager.js
- /var/www/blog/versions/4.1.0/core/boot.js
- /var/www/blog/versions/4.1.0/ghost.js
- /var/www/blog/versions/4.1.0/index.js
Suggestion: journalctl -u ghost_X-X-X-X -n 50

Debug Information:
    OS: Ubuntu, v20.04.2 LTS
    Node Version: v14.16.0
    Ghost Version: 4.1.0
    Ghost-CLI Version: 1.16.3
    Environment: production
    Command: 'ghost install --db sqlite3'

Try running ghost doctor to check your system for known issues.

Running “npm install sqlite3 --save”, resolved my issue but I’ve never had to do this before :thinking:

Hi @vikaspotluri123
Issue seems to be related to Node version 14.
How to install Ghost on Ubuntu

# Add the NodeSource APT repository for Node 14
curl -sL | sudo -E bash

I did an other install an replace Node 14 by Node 12 and it’s work without additional steps.

curl -sL | sudo -E bash

I hope this helps !