How to install Ghost

Ghost is a brand new CMS that specifically targets bloggers and other content writers, while doing an incredible job at it. While installing the Ghost CMS is a bit different than any other content management system that you may have previously installed, this article fully teach you how to install Ghost.

Installing Ghost

Note: You will need a VPS or dedicated server with root access to install Ghost.

  1. First, log into your server via SSH. As nearly every process of the Ghost installation and setup will be done via SSH, we recommend at least a basic understanding of how a Linux command line works.

  2. Install Node.js

    As Ghost depends on Node.js, you will first need to have it installed and running on your server. Once Node.js is fully installed on your VPS or dedicated server, you’re ready to continue on to the next step.

    1. Next, you will need to download the core files for Ghost. Keep in mind, that the location that you place the files, will be the location of your Ghost installation so you will want to put them in a good place. For this, I recommend placing them in your home directory for a poarticular cPanel user. For example, if your cPanel user is userna5, you will place the files within userna5 in the next step.

    2. To move to your desired directory, download, and extract the Ghost core files, you will want to run commands similar to the following. Of course, change the username to a valid user.

      cd /home/userna5

    3. Now, create a new folder in your home directory for Ghost to reside.

      mkdir ghost

    4. Then, move into that directory.

      cd /home/userna5/ghost

    5. Next, you just need to download the core files for Ghost. To do so, run the following command.

      wget https://en.ghost.org/zip/ghost-0.3.2.zip

    6. Now, you just need to extract the zip file that is provided by Ghost. Running the following will do so.

      unzip ghost*

    7. From here, the Ghost setup files will then be extracted to the directory that you are in. Now, we’re ready to continue with installing Ghost. To do so, run the following command.

      npm install –production

    8. Once the previous command finishes, Ghost is now installed to that directory. In the next steps, we will walk you through configuring Ghost.

Configuring Ghost

As Ghost is its own, standalone server process that does not use a standard HTTP server such as Apache, these processes will need to be stopped and disabled before you can set Ghost to run on your site.

Disabling Apache

First, you will need to disable the Apache service from restarting. This can be done from either within cPanel, or manually changing the file that controls it. As we are already in the command line, it is easiest to just manually change the file. To do so, you may run the following.

nano -w /etc/chkserv.d/chkservd.conf

Running this command will allow you to change the configuration file that determines what services are automatically restarted if they are down. Here, you should see a line that says:

httpd:1

To disable Apache from automatically restarted and taking control over port 80 instead of our Ghost installation, we will need to turn this option off. To do so, just change the 1 to a 0. After you are done making the change, hold the Ctrl key down and press X. Then, press Y to confirm that you want to save your changes.

Now that Apache will no longer restart itself if it is turned off, its time to stop the Apache service. To stop Apache, issue the following command.

service httpd stop

Editing config.js

Now that Ghost has been installed and Apache has been disabled to allow Ghost to run on port 80, its time to configure Ghost.

First, you will need to open the file in a text editor. In this example, we will use nano, but if you are familiar with the Linux command line, feel free to use any text editor that you want.

nano -w config.js

The file will then open up in the text editor. Here, you will see a few entires that you will need to change. In the Production section, you will see the following:

host: ‘127.0.0.1’,
port: ‘2368’

Here, you will change the host option to reflect the IP of the server, and the port will be changed to port 80 as this is the port that will be used by default when an individual types in your domain into their web browser.

Once done making these changes to the Ghost config.js file, press Ctrl+X to exit, and Y when you are asked to save your changes.

Starting Ghost

Now that Ghost is configured, you will just need to start it up. From your command line, inside the directory that you have Ghost installed on, enter the following command.

screen npm start –production

This will allow you to start Ghost within a screen session so that you can run it in the background. Without using the screen command first, if your SSL session were to close, your site would be down as well. After you have entered this command, you can detach the screen session by holding the Ctrl key down, pressing A, then pressing D. The screen should then display as detached so that you can leave Ghost running in the background.

Creating your first Ghost user account

Of course, your installation is no good unless your have a user to modify content. To create your first Ghost user, simply go to your admin panel at:

https://example.com/ghost

Ghost should then prompt you to create a new user and log you into the admin panel.

6 thoughts on “How to install Ghost

  1. It’s very old tutorial. Now it’s 2020 and GHost developed and changed their files model. I did not get any config.js file. Please keep it updated

    1. Thanks Amit! We are in the process of evaluating and updating content. Due to the number of articles it does take a little time. We appreciate your feedback!

  2. Can you add a tutorial to not only install, but to reverse proxy Ghost with Apache so we don’t have to disable Apache.

    I have a VPS running other sites on standard port 80 so I can’t just turn off apache. It seems that the apache configuration is pretty customized so an official guide on how to add the reverse proxy as an include file would be really good. And how to make Ghost persistent at startup.

  3. Damn this is quite a lot of stuff. I’m loving Ghost in my local server and wanted to put it in my public html folder to have friends comment and test it but it seems such a long process to have everything up and running and it’s not working…

    I don’t wanna wait until it’ll be easy to install as WordPress but it seems it’s the only way :/

  4. Is there a way to install this on the website, sort of like WordPress offers?

     

    Or do I really need my own VPS or server or whatnot?

    1. Due to how Ghost runs and its requirement of Node.js, this is the only way you will be able to install it. This may change in the future, but currently you will need to install it manually on the server via SSH. It does indeed require a VPS to install.

Was this article helpful? Join the conversation!