#1 My Website - GetSetUI.com

August 18th 2024 | 3 min read

85 |  4

Logo

Local Ghost CMS setup

Hello Everyone,
Welcome back to my blog πŸ™.
I hope you are all safe and that this blog finds you in good health ️🫢.

Introduction

I know most of us have a dream or wish to have our own websites to share our learnings or whatever we want.
Isn't it?
Of course Yes,
Even I had the same wish to have my own blogging website and successfully launched my website recently. So, in this blog, I would like to share my learnings during the entire process.

One exciting thing about my website,
Do you know how much it cost for me?
Honestly, it didn't cost mean anything except the time I spent creating it.

Content Management System (CMS)

For any blogging website,
What are the most important things?
One is CONTENT and to manage your content, you need a
CONTENT MANAGEMENT SYSTEM where you can access your content and do whatever you want to do.

We have many CMS tools available like WordPress, Ghost, etc.
In my Blogging site, I am using Ghost CMS.

Ghost CMS setup

Install the ghost-cli

npm install ghost-cli@latest -g

Then create a directory where you want to put your content and install Ghost local

mkdir <ghost-cms>
cd ghost-cms

ghost install local

This will create a local setup for Ghost and you can access your site http://localhost:2368/ghost
Once you open your website, you can see a dashboard something like this

Dashboard

Click on New Post and write your blog; all your published blogs will be displayed on clicking Posts.

But, Where do the posts get stored?

SQLite3 gets installed with your local Ghost Setup and all your blog posts get stored in /content/data/  along with images.

But there is an issue with the images. As Images are stored in your local it will have the URL pointing to your local so whenever you deploy it, the URLs for those are broken. so, Ghost CMS provides you with different adapters to handle such cases.

For more information of the adapters, Please refer   here .

In my personal blogging site, I have used a git adapter to store my images in a GitHub repo and get the links from there.

Also, I push my content/data to a GitHub repo and persist it there.

We are sorted with our local ghost CMS setup.
Now, let's get to know how to access the content.

Accessing the Ghost Content

The published blogs can be accessed through an API which Ghost CMS provides.
Firstly, you need to create a key to access your APIs.

You can get your access key, in your Ghost admin portal under the settings
once you have created it, you can access the APIs.
Ghost CMS provides different APIs and that is clearly mentioned in this link.

Other Important commands

  • ghost stop to stop Ghost
  • ghost start to start Ghost
  • ghost log views logs
  • ghost ls to list all running Ghost blogs

Here we go, That’s it folks for this short blog.
I hope everyone liked this blog.
If Yes, please share it with your friend.

For more exciting content on Frontend, Please do follow me 🎯.

via GIPHY

Thanks a lot, Everyone πŸ™.
Until Next time,
Happy Learning πŸ“–βœοΈ.

Abhishek Kovuri, UI developer