EACCES: permission denied, open ‘/var/www/ghost/.ghost-cli

I’m trying to update my ghost to the latest version 4.0

Here’s more info on what I did:

Running ghost update:

✔ Checking system Node.js version
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking for available migrations
An error occurred.
Message: 'EACCES: permission denied, open '/var/www/ghost/.ghost-cli''

Debug Information:
    OS: Ubuntu, v16.04
    Node Version: v6.11.5
    Ghost-CLI Version: 1.9.8
    Environment: production
    Command: 'ghost update'

Additional log info available in: /home/vikash/.ghost/logs/ghost-cli-debug-2018-12-01T10_45_40_015Z.log

This is what I got for Ghost doctor:

✔ Checking system Node.js version
✔ 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 operating system compatibility
✔ Checking for a MySQL installation
+ sudo systemctl is-active ghost_ip.address
Instance is currently running
ℹ Validating config [skipped]
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability

I’m not really sure how to get over this EACCES issue. Any help is gladly appreciated. :slight_smile:

Also published here

My first guess is that a different user installed ghost. If you run ls -al /var/www/ghost/.ghost-cli you can see who the owner user is. Try switching to that user and updating

Somewhy Digital Ocean manual worked for my Jino server instance:

sudo mkdir -p /home/<user>/.ghost/
sudo chown <user>:<user> /home/<user>/.ghost
sudo mv /root/.ghost/config /home/<user>/.ghost/config
sudo chown <user>:<user> /home/<user>/.ghost/config
sudo cd /var/www/ghost
sudo  find . -group root -user root -exec chown <user>:<user> {} \;
1 Like