I have a website running on Ghost v5.33.0. I want to update it to the latest version, which requires me to run ghost backup and ghost update. However, I am encountering errors that prevent me from proceeding.
When I run ghost doctor, I receive errors related to the logged-in user not being the directory owner and current folder permissions
Checking if logged in user is directory owner
Checking current folder permissions
The last time I encountered a similar issue, I ended up completely crashing my ghost blog and couldn’t start ghost because I received the same error after running ghost start .
Somehow, systemd is corrupt or broken. You’ll need to manually remove the entry, and try again.
I’d also double check permissions for the Ghost directory.
Incidentally, please post code snippets, not screenshots, using preformatted text button in the forum editor. It’s difficult to read screenshots, especially on mobile devices.
i backup my server and now trying ghost doctor. and get this:
✔ Checking system Node.js version - found v16.19.0
✔ Checking logged in user
✔ Ensuring user is not logged in as ghost user
✖ Checking if logged in user is directory owner
✖ Checking current folder permissions
✔ Checking system compatibility
✔ Checking for a MySQL installation
+ sudo systemctl is-active ghost_solidity-university
Instance is currently running
ℹ Validating config [skipped]
✔ Checking folder permissions
✖ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking binary dependencies
✔ Checking free space
✔ Checking systemd unit file
✔ Checking systemd node version - found v16.19.0
One or more errors occurred.
1) Checking if logged in user is directory owner
Message: Your user does not own the directory /var/www/uni and is also not a member of the owning group.
You must either log in with the user that owns the directory or add your user to the owning group.
Help: https://ghost.org/docs/install/ubuntu/#create-a-new-user
2) Checking current folder permissions
Message: The directory /var/www/uni is not writable by your user. You must grant write access and try again.
Help: https://ghost.org/docs/install/ubuntu/#create-a-directory
3) Checking file permissions
Message: Your installation folder contains some directories or files with incorrect permissions:
- ./.ghost-cli
- ./content/settings/routes-2023-02-02-08-54-41.yaml
- ./content/settings/routes.yaml
Is there is proper way to fix it? maybe i should start from here with another way?
Of course, you’ll get this error if Nginx is running and Ghost is not.
As already stated, the likely issues are:
permissions, and
systemd isn’t configured correctly.
I suggest you resolve the permission problem first. The folder in /var/www should be owned by the Ghost user, and this user should have sudo privileges.
Other than correcting ownership issues, you shouldn’t use sudo. Try this:
cd /var/www
sudo chown -R ghost:ghost uni
cd uni
find . -type d -exec chmod 775 {} \;
find . -type f -exec chmod 664 {} \;
I have assumed your Ghost user is ghost, and you are logged in as this user.