Issue Summary
Cannot install ghost according to the documentation because of permission errors.
To Reproduce
// server and user setup
- Launch an Ubuntu Server 18.04 LTS (HVM), SSD Volume Type - ami-0bbe6b35405ecebdb (64-bit x86) / ami-0db180c518750ee4f (64-bit Arm) instance on AWS.
- SSH into the instance.
- sudo adduser sarthak
- sudo usermod -aG sudo sarthak
- sudo ufw allow OpenSSH
- sudo ufw enable
//nodejs setup
7. curl -sL https://deb.nodesource.com/setup_8.x-o nodesource_setup.sh
8. sudo bash nodesource_setup.sh
9. sudo apt-get install nodejs
//ghost cli
10. sudo npm i -g ghost-cli
//ghost directory
11. cd /var/
12. sudo mkdir www
13. cd www
14. sudo mkdir ghost
15. sudo -su sarthak
16. sudo chown $USER:$USER /var/www/ghost
//ngingx install
- sudo apt-get update
- sudo apt-get install nginx
//mysql install
- sudo apt-get install mysql-server
- sudo mysql_secure_installation
// ghost installation
- cd /var/www/ghost/
- ghost install
- blog url: blog.example.com, mysql hostname: localhost, mysql_username: root, ghost db name: ghost_prod
Any other info e.g. Why do you consider this to be a bug? What did you expect to happen instead?
This is the error on the output console:
✔ Checking system Node.js version
✔ Checking logged in user
✔ Checking current folder permissions
✔ Checking operating system compatibility
✔ Checking for a MySQL installation
✔ Checking memory availability
✔ Checking for latest Ghost version
✔ Setting up install directory
✔ Downloading and installing Ghost v2.9.0
✔ Finishing install process
? Enter your blog URL: https://blog.example.com
? 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
An error occurred.
Message: 'EACCES: permission denied, mkdir '/home/ubuntu/.ghost''
Debug Information:
OS: Ubuntu, v18.04
Node Version: v8.14.0
Ghost-CLI Version: 1.9.8
Environment: production
Command: 'ghost install'
A promise was rejected but did not have a .catch() handler:
Error: EACCES: permission denied, mkdir '/home/ubuntu/.ghost'
at Object.fs.mkdirSync (fs.js:885:18)
at mkdirsSync (/usr/lib/node_modules/ghost-cli/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js:31:9)
at Object.mkdirsSync (/usr/lib/node_modules/ghost-cli/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js:36:14)
at System.writeErrorLog (/usr/lib/node_modules/ghost-cli/lib/system.js:359:12)
at UI.error (/usr/lib/node_modules/ghost-cli/lib/ui/index.js:446:40)
at precheck.then.catch (/usr/lib/node_modules/ghost-cli/lib/command.js:188:16)
at <anonymous>
/usr/lib/node_modules/ghost-cli/lib/bootstrap.js:28
throw reason;
^
Error: EACCES: permission denied, mkdir '/home/ubuntu/.ghost'
at Object.fs.mkdirSync (fs.js:885:18)
at mkdirsSync (/usr/lib/node_modules/ghost-cli/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js:31:9)
at Object.mkdirsSync (/usr/lib/node_modules/ghost-cli/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js:36:14)
at System.writeErrorLog (/usr/lib/node_modules/ghost-cli/lib/system.js:359:12)
at UI.error (/usr/lib/node_modules/ghost-cli/lib/ui/index.js:446:40)
at precheck.then.catch (/usr/lib/node_modules/ghost-cli/lib/command.js:188:16)
at <anonymous>
What I tried
Using the “ls -l” command on the /home directory gives me the following output:
total 8
drwxr-xr-x 2 sarthak sarthak 4096 Dec 19 07:44 sarthak
drwxr-xr-x 7 ubuntu ubuntu 4096 Dec 19 07:40 ubuntu
I set the permission for the /home/ubuntu to ‘drwxwrxr-x’. Then I added the user sarthak to the ubuntu group.The installation was sucessful. However upon restart I could not connect to the instance through ssh because ssh does not allow any user belonging to the same group to write on the $HOME directory because then the user will be able to change the ssh config files located in $HOME/.ssh. What would be an appropriate fix and why can’t I install ghost by following the official installation instructions?
Technical details:
- Ghost Version: 2.9.0
- Node Version: v8.14.0
- Browser/OS: Ubuntu, v18.04
- Database: MySQL
- Ghost-CLI Version: 1.9.8
- Environment: production
- Command: ‘ghost install’
Any help will be appreciated. Thanks.