Quick-search for anything
⌘F

Root user permissions fix

A fix for root user permissions problems

Error

We discovered that you are using the DigitalOcean One-Click install. You need to create a user with regular account privileges and migrate your installation to this user.

Solution

When you installed Ghost with the DigitalOcean One-Click install you probably set up your Ghost installation as a root user. As of Ghost-CLI 1.5.0, running Ghost commands as root is disallowed. Therefore you will need to migrate your current installation to a new Linux user.

Run the following steps as root user to fix it:

Add a new user:

adduser <user>

Add user to sudo group:

usermod -aG sudo <user>

Now create a new instance file and move to new user location:

mkdir -p /home/<user>/.ghost/

chown <user>:<user> /home/<user>/.ghost

mv /root/.ghost/config /home/<user>/.ghost/config

chown <user>:<user> /home/<user>/.ghost/config

Next, change into your ghost installation directory (/var/www/ghost/ is default in the DigitOcean One-Click installs) to change the ownership of your installation files:

cd /var/www/ghost

And then execute this command (might take a while):

find . -group root -user root -exec chown <user>:<user> {} \;

Last step, Login as new user:

su - <user>

You can check ghost ls now to see if your installation is still up and running.