How to install Ghost on your local machine [A beginner's guide]
Tags: webdev, writing, devjournal
Published: 2021-07-13 14:31:58

[Ghost](https://ghost.org/) is an open-source blogging platform developed using the modern tech stack NodeJS. Ghost is more suitable for creating blogging and membership sites than a full-fledged website [atleast for now].

Ghost platform is free to use. You can self-host Ghost on your own server, but you can't expect support from the Ghost team.

You can also use Ghost's hosting, the cost of which starts from 9$ a month. [Which is great for personal bloggers]

In this article, we're gonna see the steps required to run Ghost locally.

[Which I found it difficult to understand when I'm creating this website]


##Let's get started with Ghost local installation

- Install Node latest version from https://nodejs.org/en/.

- Verify the Node and NPM package version by running the node -v code on your terminal.

```
C:\Users\user>node -v
v14.17.0
```
- Then run the code for NPM - npm -v

- You sould see the following response.
```
C:\Users\user>npm -v
7.16.0
```
- Now, install Ghost CLI by entering the following code in to terminal.
```
C:\Users\user>npm install -g ghost-cli@latest
```
- Now verify the successful installation of your Ghost CLI in your local machine and its version using ghost -v.
```
C:\Users\user>ghost -v
Ghost-CLI version: 1.17.3
```
- You've successfully installed Ghost CLI on your local machine.

### Now, it's time to install Ghost using Ghost CLI.

- We have to create a folder where we can install Ghost.

- Type in cd Desktop on your terminal.

- Create a folder named Ghost on your desktop by entering mkdir ghost

- Now you'll be in the 'Ghost' folder
```
C:\Users\user\Desktop>cd ghost
```
- Finally, install Ghost on to the folder by using the command ghost install local.

- After a successful installation, you'll see a message like this.

- You'll get something like this on your screen now.
```
C:\Users\user\Desktop\ghost>ghost install local
√ Checking system Node.js version - found v14.17.0
√ Checking current folder permissions
√ Checking memory availability
√ Checking free space
√ Checking for latest Ghost version
√ Setting up install directory
√ Downloading and installing Ghost v4.6.4
√ Finishing install process
√ Configuring Ghost
√ Setting up instance
√ Starting Ghost

Ghost uses direct mail by default. To set up an alternative email method read our docs at https://ghost.org/docs/config/#mail

------------------------------------------------------------------------------

Ghost was installed successfully! To complete setup of your publication, visit:

    http://localhost:2352/ghost/
```
- Copy and paste the URL [http://localhost:2352/ghost/] into your browser.

- You will be displayed with the Ghost admin screen.

- Create an account in Ghost.

- After creating your account, you'll be directed to the admin dashboard of your Ghost website.

- We have installed Ghost on the local machine and logged in to the admin dashbaord. But is it possible to customize the theme?

- Yes, you can!

- But for that, you need to install YARN on to your theme folder.

Go to your theme's folder on your command line.
```
C:\Users\user\Desktop\ghost\content\themes\casper>
```
- In this folder, enter the code yarn install.

- You'll get something like this. [Unless you played wrong!]
```
yarn install v1.22.10
[1/5] Validating package.json...
warning casper@4.0.5: The engine "ghost" appears to be invalid.
warning casper@4.0.5: The engine "ghost-api" appears to be invalid.
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents@1.2.13: The platform "win32" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
[5/5] Building fresh packages...
Done in 204.81s.
```

- To start the development server, run yarn dev on another terminal.

- Now you can edit the code of your theme and see the changes by refreshing the local server.

- That's it.

We've installed Ghost on your local machine and set up the development server. You can now customize the theme locally and once satisfied, you can upload it to the production server.

Source: [Ghost Local Installation](https://www.natheemscreative.com/install-ghost-on-local-machine/) published on my personal website.