Stack: Error: EACCES: permission denied ghost config url

Hello I just set up ghost with digital ocean but at the time I did not have a domain name. No I am trying to setup SSL with lets encrypt and I am trying to edit the config file to setup my domain and I get this error:

Debug Information:
OS: Ubuntu, v18.04
Node Version: v8.10.0
Ghost-CLI Version: 1.11.0
Ghost version: 2.31.1 (at /var/www/ghost)
Environment: production
Command: ‘ghost config url http://bryanhope.com/
An error occurred.

Message: ‘EACCES: permission denied, open ‘/var/www/ghost/config.production.json’’

Here is the content of the log file

Stack: Error: EACCES: permission denied, open ‘/var/www/ghost/config.production.json’
at Object.fs.openSync (fs.js:646:18)
at Object.fs.writeFileSync (fs.js:1299:33)
at Object.writeFileSync (/usr/local/lib/node_modules/ghost-cli/node_modules/jsonfile/index.js:117:13)
at Config.save (/usr/local/lib/node_modules/ghost-cli/lib/utils/config.js:91:12)
at ConfigCommand.run (/usr/local/lib/node_modules/ghost-cli/lib/commands/config.js:38:50)
at Function._run (/usr/local/lib/node_modules/ghost-cli/lib/command.js:178:35)
at Object.handler (/usr/local/lib/node_modules/ghost-cli/lib/command.js:60:22)
at Object.runCommand (/usr/local/lib/node_modules/ghost-cli/node_modules/yargs/lib/command.js:242:26)
at Object.parseArgs [as _parseArgs] (/usr/local/lib/node_modules/ghost-cli/node_modules/yargs/yargs.js:1078:30)
at Object.parse (/usr/local/lib/node_modules/ghost-cli/node_modules/yargs/yargs.js:566:25)
at Object.run (/usr/local/lib/node_modules/ghost-cli/lib/bootstrap.js:182:14)
at Object. (/usr/local/lib/node_modules/ghost-cli/bin/ghost:16:11)
at Module._compile (module.js:652:30)
at Object.Module._extensions…js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
Code: EACCES
Path: /var/www/ghost/config.production.json

What user are you running as? It should be the same user that installed Ghost

well I created a super user from the command line which is probably different from whatever I did when I set up the DO droplet how would I find out which user was created when the droplet was created?

You can probably guess by looking at the file owner:

stat /var/www/ghost/config.production.json -c "%U"

I’m guessing you did it with ghost-mgr

That worked thanks but now when I run ghost setup ssl I get the error:
Nginx config file does not exist, skipping SSL setup
Setting up SSL skipped

do I need to generate this config file?

Try running ghost setup nginx ssl
(this will setup nginx + add ssl)

That worked, when I originally ran ghost config url I ran this:
ghost config url http://bryanhope.com/
do I need to rerun as https://bryanhope.com

also do I need to restart server for changes to take effect?

Yep, to change the url just run ghost config set url {url} and ghost restart:

https://ghost.org/faq/change-configured-site-url/#change-the-configuration

excellent thank you!

1 Like