GHOST local development
For local development of templates for ghost blogs
- Use the Terminal to navigate to the directory you want to run your development in (I call mine "repos" and will use that name in these instructions)
- Create a directory in "repos" for your ghost templates, I recommend creating a Git repo for them
- Create a directory in "repos" called "ghost-server"
- run
cd ghost-server - run
npm install ghost-cli@latest -g- if you get EACCESS errors run this
sudo chown -R `whoami` ~/.npmthensudo chown -R `whoami` /usr/local/lib/node_modules
- if you get EACCESS errors run this
- then run
ghost install local- If you get a "command not found" error, try closing the terminal, and try again on a new one
- run
cd ../to get back to your "repos" folder, then runpwdand copy the return - In the terminal, navigate to the
../repos/ghost-server/contentfolder and deletethemesfrom it - run
ln -s {pwd results}/ghost-blogs/themes {pwd results}/repos/ghost-server/content
- Follow the instructions at this link to install Ghost locally: https://docs.ghost.org/install/local/
- Always always always commit & push changes to gitub so there is a good record of changes.
- Local ghost is on localhost://2368 (plus /ghost for admin panel)
- This just gets you navigated to the location you want to run things out of. Some people like this on the desktop, I like mine to have the shortest path name possible, because I use it a lot.
- This directory is where your templates will live, you can have as many different templates as you would like here. This is where you will make changes to your templates.
- This directory is just a server, once you get this setup you will just need to be in this directory to run
ghost startto start the local development server - This step simply navigates you into the new server directory
- This command installs the ghost cli, this is the groundwork you need before installing the server
- if you have access errors, this command will make you an owner of the correct directories so that you can install as needed
- This command installs the actual ghost server
- You may need to close & re-open your terminal to pick up the install
- This command returns the absolute path to the directory that contains both the "ghost-server" and the "ghost-templates" directories
- This step removes the themes folder so it doesn't conflict with the next step
- This command creates a symbolic link from the server to the templates folder. This
if you still get the error you may need to add ghost to your PATH
- Open up Terminal.
- Run the following command: sudo nano /etc/paths.
- Enter your password, when prompted.
- Go to the bottom of the file, and enter the path to
- Hit control-x to quit.
- Enter “Y” to save the modified buffer.
- That's it! To test it, in new terminal window, type: echo $PATH.
- Jump back to step 6 and re-run the ghost install