New install of latest Ghost fails due to permissions

New install of latest Ghost fails due to permissions of content folder. Unable to start a fresh install

  • What’s your URL? http://<mydomain>.co.uk
  • What version of Ghost are you using? Ghost v3.38.2 and Ghost-CLI v1.15.2

And

  • How was Ghost installed and configured?
    Vanilla instance of Ubuntu Focal Fossa on Scaleway public cloud
    instance details:
  • 2x x86_64 cores
  • 2gb memory
  • 20gb ssd
  • What Node version, database, OS & browser are you using?
    Node: v12.19.1
    MySQL: 8.0.22-0ubuntu0.20.04.2
    OS: Ubuntu Ubuntu 20.04.1 LTS

  • What errors or information do you see in the console?

βœ” Checking system Node.js version
βœ” Checking logged in user
βœ” Checking current folder permissions
βœ” Checking system compatibility
βœ” Checking for a MySQL installation
βœ” Checking memory availability
βœ” Checking free space
βœ” Checking for latest Ghost version
βœ” Setting up install directory
βœ” Downloading and installing Ghost v3.38.2
βœ” Finishing install process
? Enter your blog URL: http://<mydomain>.co.uk
? Enter your MySQL hostname: localhost
? Enter your MySQL username: root
? Enter your MySQL password: [hidden]
? Enter your Ghost database name: ghost_prod
βœ” Configuring Ghost
βœ” Setting up instance
+ sudo useradd --system --user-group ghost
+ sudo chown -R ghost:ghost /var/www/ghost/content
βœ” Setting up "ghost" system user
? Do you wish to set up "ghost" mysql user? Yes
βœ” Setting up "ghost" mysql user
? Do you wish to set up Nginx? Yes
+ sudo mv /tmp/<mydomain>-co-uk/<mydomain>.co.uk.conf /etc/nginx/sites-available/<mydomain>.co.uk.conf
+ sudo ln -sf /etc/nginx/sites-available/<mydomain>.co.uk.conf /etc/nginx/sites-enabled/<mydomain>.co.uk.conf
+ sudo nginx -s reload
βœ” Setting up Nginx
? Do you wish to set up SSL? No
β„Ή Setting up SSL [skipped]
? Do you wish to set up Systemd? No
Systemd setup skipped, reverting to local process manager
β„Ή Setting up Systemd [skipped]
? Do you want to start Ghost? Yes
βœ– Starting Ghost
One or more errors occurred.

1) SystemError

Message: The content folder is not owned by the current user.
Ensure the content folder has correct permissions and try again.

Debug Information:
    OS: Ubuntu, v20.04.1 LTS
    Node Version: v12.19.1
    Ghost Version: 3.38.2
    Ghost-CLI Version: 1.15.2
    Environment: production
    Command: 'ghost install'

Try running ghost doctor to check your system for known issues.

You can always refer to https://ghost.org/docs/api/ghost-cli/ for troubleshooting.

File permissions

omranb@ghost:/var/www/ghost$ ls -al
total 24
drwxrwxr-x 4 omranb omranb 4096 Nov 22 12:33 .
drwxr-xr-x 4 root   root   4096 Nov 22 12:30 ..
-rw-rw-r-- 1 omranb omranb   88 Nov 22 12:33 .ghost-cli
-rw-rw-r-- 1 omranb omranb  497 Nov 22 12:33 config.production.json
drwxrwxr-x 8 ghost  ghost  4096 Nov 22 12:30 content
lrwxrwxrwx 1 omranb omranb   30 Nov 22 12:33 current -> /var/www/ghost/versions/3.38.2
drwxrwxr-x 3 omranb omranb 4096 Nov 22 12:30 versions

I attempted to change the owner of the content folder using
sudo chown -R omranb:omranb /var/www/ghost/content

The error persists and the folder permissions are reverted to ghost when running ghost setup

  • What steps could someone else take to reproduce the issue you’re having?
    output from hist
as root:
root@ghost:~# history
    1  adduser omranb
    2  usermod -aG sudo omranb
    3  su - omranb
    4  history

as omranb:
root@ghost:~# su - omranb
omranb@ghost:~$ history
    1  sudo apt-get update
    2  sudo apt-get upgrade
    3  sudo apt-get install nginx
    4  sudo apt-get install mysql-server
    5  sudo mysql
    6  curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash
    7  sudo apt-get install -y nodejs
    8  sudo npm install ghost-cli@latest -g
    9  sudo mkdir -p /var/www/ghost
   10  sudo chown omranb:omranb /var/www/ghost
   11  sudo chmod 775 /var/www/ghost
   12  cd /var/www/ghost
   13  ghost install
   14  mysql -u root -p -v
   15  cat /etc/issue
   16  ls -al
   17  exit
   18  history

Can you try running ghost doctor and running any suggested commands?

This is the output for ghost doctor, there are no suggested commands

omranb@ghost:/var/www/ghost$ ghost doctor
βœ” Checking system Node.js version
β„Ή Ensuring user is not logged in as ghost user [skipped]
β„Ή Checking if logged in user is directory owner [skipped]
βœ” Checking current folder permissions
βœ” Checking for a MySQL installation
βœ” Validating config
βœ” Checking content folder ownership
βœ” Checking memory availability
βœ” Checking binary dependencies
βœ” Checking free space

Aah, I think you’re running into this issue because you’re using the local process manager. Is there a reason you chose not to set up systemd?

Thanks, that fixed the problem.

There wasn’t any particular reason I didn’t use systemd. Now that I’ve selected β€˜Y’, it works.

Thank you for your help.

1 Like

Hello~ I also had a similar problem:

when I execut ghost install One or more errors occurred:
SystemError Message: The content folder is not owned by the current user.

details as follows:

[kevin@cube_hk_1 ghost]$ ghost install --no-stack

Love open source? We’re hiring Node.js Engineers to work on Ghost full-time.
[https://careers.ghost.org/p...](https://disq.us/url?url=https%3A%2F%2Fcareers.ghost.org%2Fproduct-engineer-node-js%3AHDZ6WlghlxwKeAQ1vxE6nJjicHk&cuid=5017776)

Running in development mode

βœ” Checking system Node.js version - found v16.17.1
βœ” Checking logged in user
βœ” Checking current folder permissions
β„Ή Checking system compatibility [skipped]
βœ” Checking for a MySQL installation
βœ” Checking memory availability
βœ” Checking free space
βœ” Checking for latest Ghost version
βœ” Setting up install directory
βœ” Downloading and installing Ghost v5.16.0
βœ” Finishing install process
? Enter your blog URL: [http://ifree.love](http://disq.us/url?url=http%3A%2F%2Fifree.love%3AtNUYq6HBlvsz12UflAtKuA3VXuI&cuid=5017776)
? Enter your MySQL hostname: localhost
? Enter your MySQL username: root
? Enter your MySQL password: [hidden]
? Enter your Ghost database name: ghost_dev
βœ” Configuring Ghost
βœ” Setting up instance
+ sudo chown -R ghost:ghost /var/www/ghost/content
βœ” Setting up "ghost" system user
? Do you wish to set up "ghost" mysql user? Yes
βœ” Setting up "ghost" mysql user
Nginx configuration already found for this url. Skipping Nginx setup.
β„Ή Setting up Nginx [skipped]
Nginx setup task was skipped, skipping SSL setup
β„Ή Setting up SSL [skipped]
? Do you want to start Ghost? Yes
βœ– Starting Ghost
One or more errors occurred.

1) SystemError

Message: The content folder is not owned by the current user.
Ensure the content folder has correct permissions and try again.

Debug Information:
OS: CentOS Stream, v8
Node Version: v16.17.1
Ghost Version: 5.16.0
Ghost-CLI Version: 1.23.0
Environment: development
Command: 'ghost install --no-stack'

Try running ghost doctor to check your system for known issues.

You can always refer to [https://ghost.org/docs/ghos...](https://disq.us/url?url=https%3A%2F%2Fghost.org%2Fdocs%2Fghost-cli%2F%3AiLpFogr445qW-NNBAD-5SvWoFdY&cuid=5017776) for troubleshooting.

File permissions:

[kevin@cube_hk_1 ghost]$ ll -al
总用量 24
drwxrwxr-x. 4 kevin kevin 4096 9月 25 02:54 .
drwxr-xr-x. 3 root root 4096 9月 24 21:15 ..
-rw-rw-r--. 1 kevin kevin 492 9月 25 02:54 config.development.json
drwxrwxr-x. 11 ghost ghost 4096 9月 25 02:53 content
lrwxrwxrwx. 1 kevin kevin 30 9月 25 02:54 current -> /var/www/ghost/versions/5.16.0
-rw-rw-r--. 1 kevin kevin 107 9月 25 02:54 .ghost-cli
drwxrwxr-x. 3 kevin kevin 4096 9月 25 02:53 versions

ζ‰§θ‘Œ ghost docter

[kevin@cube_hk_1 ghost]$ ghost doctor

Love open source? We’re hiring Node.js Engineers to work on Ghost full-time.
[https://careers.ghost.org/p...](https://disq.us/url?url=https%3A%2F%2Fcareers.ghost.org%2Fproduct-engineer-node-js%3AHDZ6WlghlxwKeAQ1vxE6nJjicHk&cuid=5017776)

Running in development mode
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚Warning: MySQL 8 will be the required database in the next major release of Ghost.β”‚
β”‚ Make sure your database is up to date to ensure forwards compatibility. β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

βœ” Checking system Node.js version - found v16.17.1
β„Ή Ensuring user is not logged in as ghost user [skipped]
β„Ή Checking if logged in user is directory owner [skipped]
βœ” Checking current folder permissions
βœ” Checking for a MySQL installation
βœ” Validating config
βœ” Checking content folder ownership
βœ” Checking memory availability
βœ” Checking binary dependencies
βœ” Checking free space

You say chose to set up systemd?
But I don’t show it here:? Do you wish to set up Systemd?

What should I do?

1 Like

same question here. how to solved this?

1 Like

I think I had a similar problem.

Installed Ghost in --development mode using
ghost install --development

Output:

:heavy_multiplication_x: Starting Ghost
One or more errors occurred.

  1. SystemError

Message: The content folder is not owned by the current user.
Ensure the content folder has correct permissions and try again.

Debug Information:
OS: Ubuntu, v22.04.3 LTS
Node Version: v18.19.0
Ghost Version: 5.75.3
Ghost-CLI Version: 1.25.3
Environment: development
Command: β€˜ghost install --development’

Try running ghost doctor to check your system for known issues.

You can always refer to Ghost-CLI - A fully loaded tool for installation and configuration for troubleshooting.
admin@vmd125609:/var/www/sitename$ ls -l
total 12
-rw-rw-r-- 1 admin admin 508 Jan 6 13:12 config.development.json
drwxrwxr-x 11 ghost ghost 4096 Jan 6 13:10 content
lrwxrwxrwx 1 admin admin 34 Jan 6 13:11 current β†’ /var/www/sitename/versions/5.75.3
drwxrwxr-x 3 admin admin 4096 Jan 6 13:10 versions

For me installing systemd fixed it

ghost setup systemd