Ghost Error - The directory is not readable by other users on the system/Cannot find module 'sqlite3'

Ghost Error - The directory is not readable by other users on the system/Cannot find module 'sqlite3'

Late last year, I began switching my website back from an 11ty static site/blog, to Ghost, since then, I've had fun redeveloping the default theme and encountered an issue or two along the way. This post is about how to solve those issues.

Why Ghost?

Before we explore the issues, let's discuss the reason I opted to move from 11ty to Ghost.

There's nothing particularly wrong with 11ty. All it does is generate the "output" requested and creates a static site. In some ways, that's a much better because the functionality and output are more predictable and it makes the attack surface smaller for any potential malicious actors. However, adding posts, particularly long and complex ones, did become a bit burdensome and I found that I was blogging less when I had to load up the entire code base and create a markdown file for each post. There's something to be said for having clean, publishing specific interface especially for how I think and write.

On that basis, I chose Ghost because it's very clean and minimal and I like the direction it's headed with the integrated social, payment and membership features and because it's much less complex than Wordpress - a platform I used to enjoy, probably about 10 years ago.

System Considerations

The issues I'm about to discuss will apply to setups on Linux, specifically Ubuntu. I'm running Ubuntu 24.04 LTS on a home built system with an AMD Ryzen 3900X, X570 AORUS Master motherboard, 128GB Ram, 7TB storage capacity and 2 x AMD RX570 Series Graphics Cards. That might sound like a lot, but this system is about 6 years old now.

Side note - One thing that I have noticed, because I also have Windows setups, is that Ghost Development on Windows is more annoying than it should be for what amounts to, basic web development. Because the Ghost devs don't really support Windows, you're required to either use WSL (Windows Subsystem for Linux), or setup a docker container if you want to develop locally which adds overhead to the whole process; in contrast, on Linux the process is as simple installing the Ghost CLI, Making a new folder, and running ghost install local.

Error 1 - The directory is not readable by other users on the system

I initially encountered this error after rebooting my machine after installing Ghost locally for the first time, so it's worth noting that it may not present during the initial install or running of Ghost.

I also got two error codes for it, the first one said -

**Message: Ghost was able to start, but errored during boot with: Cannot read properties of undefined (reading 'members')

Debug Information:
OS: Ubuntu, v24.04.4 LTS
Node Version: v22.11.0
Ghost Version: 6.24.0
Ghost-CLI Version: 1.28.4
Environment: development
Command: 'ghost start'**

The second read -

One or more errors occurred.

1) SystemError

Message: The directory /home/closebracket/ is not readable by other users on the system.
This can cause issues with the CLI, you must either make this directory readable by others or install node and Ghost-CLI in another location.

2) SystemError

Message: The directory /home/closebracket/ is not readable by other users on the system.
This can cause issues with the CLI, you must either make this directory readable by others or run ghost install in another location.

Debug Information:
OS: Ubuntu, v24.04.4 LTS
Node Version: v22.11.0
Ghost Version: 6.24.0
Ghost-CLI Version: 1.28.4
Environment: development
Command: 'ghost doctor'

My initial thoughts when trying to solve the issue were that it was a permissions issue. You can see from the "SystemError" messages that /home/closebracket/ isn't readable, and ghost does setup it's own user when it installs, so perhaps that was the issue. It's also evident from the first error message that ghost was looking for an undefined member variable when reading members, read - permissions.

As it turns out, when installing locally, the Ghost user is the same user who installed ghost, so in my case, closebracket, so the resolution was simple -

sudo chown closebracket:closebracket -R ~/Source Make sure that you adjust the command to suit your own environment. e.g. putting your own user and folder structure instead of mine, otherwise you might break more stuff!

Ensuring that my user had ownership of all folders and files in the source folder, resolved the permissions issue. Then, for good measure, I updated ghost.

This led to the next error message.

Cannot find module 'sqlite3'

Ghost still wouldn't start after the update. I got the following error message -

A GhostError occurred. Cannot find module 'sqlite3'

I'm not sure how or why sqlite3 wasn't installed as a npm module, given it had been installed when ghost was initially installed, but the fix is trival. Just install it with the following command - npm install sqlite3 --save

In theory, that should be both errors resolved. It certainly resolved the issues for me.

The only thing I haven't mentioned is that I had an issue with node versions, I had 22.11.0 installed but the latest version of Ghost required ^22.13.1, again, not a huge issue, just use nvm install 22 for the latest version and then nvm use 22.