# Can't install Ghost-CLI ( permission trouble?)

**URL:** <https://forum.ghost.org/t/cant-install-ghost-cli-permission-trouble/3470>\
**Category:** Installation\
**Created:** [October 8, 2018, 5:56pm UTC](https://forum.ghost.org/t/cant-install-ghost-cli-permission-trouble/3470 "2018-10-08T17:56:36Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![boobab](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@boobab](https://forum.ghost.org/u/boobab)\
**Post date:** [October 8, 2018, 5:56pm UTC](https://forum.ghost.org/t/cant-install-ghost-cli-permission-trouble/3470/1 "2018-10-08T17:56:36Z")

</div>

npm i -g ghost-cli@latest  
npm WARN checkPermissions Missing write access to /usr/local/lib/node\_modules  
npm ERR! path /usr/local/lib/node\_modules  
npm ERR! code EACCES  
npm ERR! errno -13  
npm ERR! syscall access  
npm ERR! Error: EACCES: permission denied, access ‘/usr/local/lib/node\_modules’  
npm ERR! { Error: EACCES: permission denied, access ‘/usr/local/lib/node\_modules’  
npm ERR! stack: ‘Error: EACCES: permission denied, access ‘/usr/local/lib/node\_modules’’,  
npm ERR! errno: -13,  
npm ERR! code: ‘EACCES’,  
npm ERR! syscall: ‘access’,  
npm ERR! path: ‘/usr/local/lib/node\_modules’ }  
npm ERR!  
npm ERR! The operation was rejected by your operating system.  
npm ERR! It is likely you do not have the permissions to access this file as the current user  
npm ERR!  
npm ERR! If you believe this might be a permissions issue, please double-check the  
npm ERR! permissions of the file and its containing directories, or try running  
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:  
npm ERR! /home/spore/.npm/\_logs/2018-10-08T18\_03\_02\_629Z-debu

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [October 8, 2018, 6:07pm UTC](https://forum.ghost.org/t/cant-install-ghost-cli-permission-trouble/3470/2 "2018-10-08T18:07:12Z")

</div>

You need to use sudo in linux to install node modules

So it would be `sudo npm i -g ghost-cli@latest`

---

<div class="post-metadata">

**Author:** ![boobab](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@boobab](https://forum.ghost.org/u/boobab)\
**Post date:** [October 8, 2018, 6:11pm UTC](https://forum.ghost.org/t/cant-install-ghost-cli-permission-trouble/3470/3 "2018-10-08T18:11:36Z")

</div>

thanks so much

---

<div class="post-metadata">

**Author:** ![boobab](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@boobab](https://forum.ghost.org/u/boobab)\
**Post date:** [October 8, 2018, 6:18pm UTC](https://forum.ghost.org/t/cant-install-ghost-cli-permission-trouble/3470/4 "2018-10-08T18:18:24Z")

</div>

Quick question. Manual says to install Ghost in an empty directory. What’s your suggestion for where to create this directory on a system?

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [October 8, 2018, 6:20pm UTC](https://forum.ghost.org/t/cant-install-ghost-cli-permission-trouble/3470/5 "2018-10-08T18:20:50Z")

</div>

The docs use `/var/www/ghost` so that’s probably the best place since it will make following along a lot easier 🙂

---

<div class="post-metadata">

**Author:** ![boobab](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@boobab](https://forum.ghost.org/u/boobab)\
**Post date:** [October 8, 2018, 6:24pm UTC](https://forum.ghost.org/t/cant-install-ghost-cli-permission-trouble/3470/6 "2018-10-08T18:24:12Z")

</div>

Thanks. Even in a local install?

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [October 8, 2018, 6:37pm UTC](https://forum.ghost.org/t/cant-install-ghost-cli-permission-trouble/3470/7 "2018-10-08T18:37:46Z")

</div>

For theme development, I use this folder structure (note this is on Windows where folders in the root directory are acceptable):

/code  
├─── git // code which uses version control  
├────── theme // specific theme  
├───────── src //theme code  
├───────── instance // Ghost instance

---

<div class="post-metadata">

**Author:** ![boobab](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@boobab](https://forum.ghost.org/u/boobab)\
**Post date:** [October 8, 2018, 6:57pm UTC](https://forum.ghost.org/t/cant-install-ghost-cli-permission-trouble/3470/8 "2018-10-08T18:57:50Z")

</div>

Thanks. Do you know how this will look on linux?

---

<div class="post-metadata">

**Author:** ![boobab](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@boobab](https://forum.ghost.org/u/boobab)\
**Post date:** [October 8, 2018, 7:13pm UTC](https://forum.ghost.org/t/cant-install-ghost-cli-permission-trouble/3470/9 "2018-10-08T19:13:12Z")

</div>

Also, someone mentioned Docker for theme development. How useful is this?

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [October 8, 2018, 7:33pm UTC](https://forum.ghost.org/t/cant-install-ghost-cli-permission-trouble/3470/10 "2018-10-08T19:33:06Z")

</div>

You could use that folder structure in your home directory, and everything should be functional

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [October 8, 2018, 7:37pm UTC](https://forum.ghost.org/t/cant-install-ghost-cli-permission-trouble/3470/11 "2018-10-08T19:37:57Z")

</div>

I don’t use docker much, but imo it’s an unneeded abstraction. Unless you’re trying to manage multiple running instances (which even then, you might not need docker), the CLI is fully functional and makes managing your Ghost instance painless. All you have to do is run `ghost install local`, (sometimes) `ghost restart` and `ghost update` and you will get an instance, be able to manage the state of it, and update it super easily.

Docker would require more resources to run and provide no tangible benefits, other than you don’t need to install node. However, you would need to install docker… 🙃 Moreover, you’re not going to get any Docker support from Ghost - you might find people that know docker and can help you here, but the CLI is maintained and developed by the Ghost Core team.

---

<div class="post-metadata">

**Author:** ![boobab](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@boobab](https://forum.ghost.org/u/boobab)\
**Post date:** [October 8, 2018, 7:57pm UTC](https://forum.ghost.org/t/cant-install-ghost-cli-permission-trouble/3470/12 "2018-10-08T19:57:00Z")

</div>

Hold on one second please. /code is a directory name? What about git, theme, src, instance? Is that all directory names?

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [October 8, 2018, 7:58pm UTC](https://forum.ghost.org/t/cant-install-ghost-cli-permission-trouble/3470/13 "2018-10-08T19:58:14Z")

</div>

Yep, sorry if that wasn’t clear 😬 That’s the directory structure I use, since I have more projects which I contribute to than just Ghost Themes

---

<div class="post-metadata">

**Author:** ![boobab](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@boobab](https://forum.ghost.org/u/boobab)\
**Post date:** [October 8, 2018, 8:04pm UTC](https://forum.ghost.org/t/cant-install-ghost-cli-permission-trouble/3470/14 "2018-10-08T20:04:23Z")

</div>

Oh, you shouldn’t be sorry 🙂 I’ll do the directory as you suggested, thanks so much

---

<div class="post-metadata">

**Author:** ![boobab](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@boobab](https://forum.ghost.org/u/boobab)\
**Post date:** [October 8, 2018, 8:06pm UTC](https://forum.ghost.org/t/cant-install-ghost-cli-permission-trouble/3470/15 "2018-10-08T20:06:43Z")

</div>

One more question. “Instance” is the directory on which I run ghost install local?

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [October 8, 2018, 8:07pm UTC](https://forum.ghost.org/t/cant-install-ghost-cli-permission-trouble/3470/16 "2018-10-08T20:07:16Z")

</div>

Yep!

---

<div class="post-metadata">

**Author:** ![boobab](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@boobab](https://forum.ghost.org/u/boobab)\
**Post date:** [October 8, 2018, 8:07pm UTC](https://forum.ghost.org/t/cant-install-ghost-cli-permission-trouble/3470/17 "2018-10-08T20:07:38Z")

</div>

Great

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/b/ba9ce5100b8bb264586f4f572545596b2ce3f081.png) [@system](https://forum.ghost.org/u/system)\
**Post date:** [October 22, 2018, 8:07pm UTC](https://forum.ghost.org/t/cant-install-ghost-cli-permission-trouble/3470/18 "2018-10-22T20:07:40Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
