How to Install & Setup Ghost CMS in 2024

Ghost is a free open-source blogging platform built with Node Js. As a quick, contemporary WordPress opportunity, Ghost is centered completely on expert publishing.

Related Post : Top 7 Ghost Website Hosting in 2023

Create A New User

Ghost CLI desires sudo privileges, so instead of walking your web page as a root consumer, we recommend developing a new user with those sudo privileges. This may be done by using going-for-walks commands inside the terminal – however, it’s a good deal easier to do it in the RunCloud dashboard.

To create a new person, visit the RunCloud dashboard and open the “System User” menu.

Once opened, click on “Add New System User” to create a brand new person. Give it a descriptive call and a stable password. Make sure to test the container to permit the execution of privileged instructions.

After this, click on “Save System User” and retain the setup manner.

Create A New User ghost cms

Create A New Database

After developing the system user, the following step is to create a brand new database and database consumer. To do that, visit the “Database” menu under your server in the RunCloud Dashboard to create a new database consumer.

Give this database consumer an appropriate call and a steady password, and make a notice of these credentials as they’ll be needed later for the duration of the setup.

After creating the database person, create a brand new database and provide permission to the consumer that we simply created. Save the adjustments before shifting on to the next step.

Create A New Database to ghost cms

Create An Empty Web App

After you’ve created the user, go to the “Web Applications” tab and make a brand new net application on your server. Choose the “Empty Web App” choice and deliver your application with an appropriate name. 

Don’t forget to change the owner of the utility – instead of the usage of the default RunCloud consumer, we are able to make the user account that we simply created the owner of the internet utility.

Create An Empty Web App

After configuring the software proprietor, you could set up the area of the utility and configure the DNS records manually for your DNS registrar’s web page. If you’re the use of RunCloud’s Cloudflare integration, you could take advantage of the automated DNS replace functionality.

It is likewise viable to put in Ghost the usage of RunCloud’s take-a-look at the domain. If you want to follow along with this tutorial while not having to set up your own area or subdomain, then use RunCloud to take a look at the area.

For “Web Application Stack“, we recommend selecting “Native Nginx + Custom Config” for putting in Ghost CMS, then clicking on “Deploy” to complete the set-up process. That said, if your server runs on OpenLiteSpeed – we’ve protected notes on steps that can be specific in this guide.

deploy ghost cms

After developing the app, go to the settings page and scroll right down to the “Linked Database” segment. From the dropdown menu, select the database that we just created. Don’t neglect to click “Update Linked Database” which will show the modifications.

Update Linked Database

Installing Ghost-CLI

In the preceding step, we created a dummy web software within the RunCloud dashboard, as this helps us carry out administrative tasks including tracking the logs from the RunCloud dashboard. Now we will use Ghost-CLI, a command-line device, to put in and configure Ghost CMS and update that dummy software.

We will install the Ghost-CLI because the owner of the internet software to avoid any permission conflicts. To do that, log into your server because the gadget user is assigned to the web application – you could both do this through SSH or use the su (transfer user) command.

Method 01

# Method 1

ssh ghostcms-user@<youripaddress>

Method 02

# Method 2

ssh root@<youripaddress>

sudo su ghostcms-user

After logging into the server, navigate to the root listing of your net utility using the following command. Replace the “<course to root>” together with your route – you can locate this within the RunCloud dashboard.

cd <path to root>

Once you’re in the ideal listing you can run the subsequent instructions to take away the default “index.html” report and start the setup.

rm index.html

sudo npm install ghost-cli@latest -g
install ghost cms

After the setup is whole, you may run the “ghost model” in your terminal to check the model of Ghost-CLI and make sure that the CLI works as anticipated.

Install ghost csm

Checking Node.Js version

Ghost CMS desires Node.Js to function well. At the time of writing, the endorsed node model changed to 18; confer with the professional internet site to see the supported node version. Execute the following command to look the model of the node established in your server.

node -v
find ghost version

In the above screenshot, the primary wide variety in v18.18.0 suggests the primary version variety of the software. The predominant version number displays the level of compatibility and capability of the software. The different numbers after the dot (.) are minor model numbers or patch numbers. They no longer affect the compatibility or capability of the software program as tons because of the primary model quantity. Therefore, they can be disregarded if you are simply interested in the major version range.

Note: If you created your server before 27 September 2023, you may need to replace the node version for your server manually. Refer to our guide for updating node to your RunCloud server to discover ways to do that.

Related Post: Top 10 SEO Tips for Ghost Blog 2024

Installing Ghost CMS

After installing Ghost-CLI, you may run the following command to begin the Ghost CMS installation.

ghost install
install ghost cms 2024

If you comply with the commands correctly you will get a message that the setup was a success. However, whilst you visit your website you’ll see a 404 error message. This is because we skipped the Nginx setup at some stage in setup. We can configure this manually to restore it.

Before we install the server proxy, we want to realize which port Ghost will use for this internet site. Run the subsequent command to get the information of your net utility:

ghost ls 

The above command will display an output that looks like this:

ghost ls code output

In the example above, the port quantity is 2368. Note down this port’s wide variety.

Setting Up A Proxy

You need to configure your server to redirect all the incoming visitors to the given port. This step is different for Nginx and OpenLiteSpeed servers. If you are not positive which server is set up on your gadget, you may test this inside the RunCloud dashboard after which observe the instructions corresponding to your server.

setup proxy for ghost cms

For Nginx

Go back to the RunCloud dashboard, open your net utility, and go to the Nginx Config menu. Click the “Create Config” button and comply with the stairs underneath.

  • For the “Type” option, ensure to pick the price “region.Root”.
  • For the “Config Name” choice, you could use the cost “ghost”.
  • For the “Config Content” textarea, reproduce and paste the text under. Make positive to alternate XXXX with the port quantity that we cited earlier.
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:XXXX;
Create Config for ngnix

You can click “Run and Debug” to see if there are any issues with this custom config. Click the “Add Config” button to finish it.

For OpenLiteSpeed

In the RunCloud dashboard, open the empty internet utility that we created within the Create An Empty Web App step and look for the “LiteSpeed Config” inside the aspect menu to open the configuration document.

setup OpenLiteSpeed

We want to edit a few traces on this file. Firstly, notice the name of the extprocessor – we will use this later.

Next, disable the existing configuration by including # before the type and address line.

After that, add the following traces beneath the commented lines. Don’t neglect to exchange xxxx with the port quantity that we mentioned in advance.

type                    proxy
address                 localhost:xxxx

At this stage, your configuration document has to look like this:

configuration file ghost cms

Next, scroll down and add the subsequent code snippet in your configuration document. Be careful not to stick it within the middle of a present config block. Replace the <my-ghost> with the name of the extprocessor that we referred to down earlier.

context / {
  type                    proxy
  handler                 <my-ghost>
  addDefaultCharset       off
}

At this point, your config record will appear like this:

change config

Click on “Update Config” to keep the settings.

Finally, we need to restart the OpenLiteSpeed carrier for the modifications to take effect. Open the server page in your RunCloud dashboard and search for the “Services” option inside the facet menu. On that web page, click on the “…” button subsequent to the OpenLiteSpeed server and click on “Restart”.

restart service

Log Into Your Ghost Dashboard

After setting up the proxy config, you may go to your website.

Go to https://example.com/ghost to configure the admin account. On this web page, you want to go into a few primary information inclusive of the call of the site and the login details of the admin.  

log in to ghost dashboard

After putting in place the admin account, you can log into the Ghost dashboard and begin publishing.

ghost cms dashboard

After Action Report

Ghost CMS is an effective cutting-edge publishing platform powered by means of Node.Js. RunCloud makes it easy to install and configure Ghost CMS. After following the stairs mentioned in this text, you may be able to install your own CMS and begin publishing content material.

After set up, you may hold mastering extra approximately Ghost-CLI commands and tutorials to customize your Ghost weblog.

If you’re bored with handling your very own servers – test out RunCloud, a simple but effective control panel for cloud servers. RunCloud is constructed for builders who need to recognize delivering superb paintings, not managing their infrastructure.

Dananjaya
Dananjaya

He is the Best Premium cookies provider and also the Owner of mmozape and more 5+ Free Premium Cookies websites. He does blogging and traveling in his free time.

Leave a Reply

Your email address will not be published. Required fields are marked *