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:
Starting Ghost
One or more errors occurred.
- 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