Hello,
I am self hosting the ghost on digital ocean but continously facing the permission issue. I just want to confirm what should be ideal the permission we need to set for the directory in which we install ghost. Should it be user:user or ghost:ghost??
You need to create a new user (do not name it ‘ghost’ else it will conflict with the user that Ghost creates). In below example, I am adding ‘ghost-mgr’ as the new user.
Ref: How to install & setup Ghost on Ubuntu 20.04 or 22.04
# Create a new user and follow prompts
# adduser <user>
adduser ghost-mgr
Then you need to give proper permissions to that user after you create the ghost installation directory (e.g. myghostsite
).
Ref: How to install & setup Ghost on Ubuntu 20.04 or 22.04
# Set directory owner: Replace <user> with the name of your user
# sudo chown <user>:<user> /var/www/sitename
sudo chown ghost-mgr:ghost-mgr /var/www/myghostsite
# Set the correct permissions
# sudo chmod 775 /var/www/sitename
sudo chmod 775 /var/www/myghostsite
If you run ghost doctor
command in your installation directory, that should give you the command you can execute to set the permissions correctly.