How to install and setup Ghost CMS

Share this item:

install and setup Ghost CMS

Table of Contents

Ghost CMS is a popular open-source content management system designed for bloggers who want to create and publish high-quality content on the web. It is known for its simplicity, speed, and flexibility, making it a great choice for bloggers who want to focus on creating great content without worrying about the technical details.

In this step-by-step guide, we’ll walk you through the process of installing and setting up Ghost CMS on either Ubuntu or cPanel, two popular web hosting platforms. We’ll cover everything from the minimum system requirements to troubleshooting common installation issues, so even if you’re new to web development, you can follow along and get started with Ghost CMS in no time.

Whether you’re looking to start a new blog or migrate your existing blog to Ghost CMS, this guide will provide you with all the information you need to get started. So let’s dive in!

Requirements

Before we dive into the installation process, it’s important to ensure that your system meets the minimum requirements for running Ghost CMS. Here are the system requirements for Ghost CMS:

  • Operating System: Ubuntu 16.04 or later, or cPanel
  • Processor: Dual-core 1.0 GHz or faster
  • RAM: 1 GB or higher
  • Storage: 2 GB or higher

In addition to the minimum system requirements, you will need to install the following software and tools:

  • Node.js: Ghost CMS is built on top of Node.js, a popular JavaScript runtime that allows you to run JavaScript code outside of a web browser. We recommend installing the latest version of Node.js to ensure compatibility with Ghost CMS.
  • Nginx or Apache: Ghost CMS requires a web server to function. We recommend using either Nginx or Apache, two popular web servers that are well-supported by Ghost CMS.
  • MySQL or MariaDB: Ghost CMS requires a database to store its data. We recommend using either MySQL or MariaDB, two popular relational databases that are well-supported by Ghost CMS.

Once you have installed these software and tools, you’re ready to proceed with the installation process. In the next section, we’ll walk you through the step-by-step process of installing Ghost CMS on Ubuntu or cPanel.

Installation on Ubuntu

In this section, we’ll walk you through the process of installing Ghost CMS on Ubuntu. Follow these steps carefully to ensure a successful installation:

Step 1: Install Node.js

First, you need to install Node.js on your Ubuntu server. You can install it using the following command:

sudo apt-get update
sudo apt-get install nodejs

Step 2: Install Nginx

Next, you need to install Nginx, a popular web server that is well-supported by Ghost CMS. You can install it using the following command:

sudo apt-get install nginx

Step 3: Install MySQL

Ghost CMS requires a database to store its data. We recommend using MySQL, a popular relational database that is well-supported by Ghost CMS. You can install it using the following command:

sudo apt-get install mysql-server

Step 4: Create a new MySQL user and database

Next, you need to create a new MySQL user and database for Ghost CMS. You can do this using the following commands:

sudo mysql -u root -p
CREATE DATABASE ghost;
CREATE USER 'ghostuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON ghost.* TO 'ghostuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Be sure to replace ‘password’ with a strong password of your choosing.

Step 5: Download and install Ghost CMS

Next, you need to download and install Ghost CMS on your Ubuntu server. You can do this using the following commands:

sudo mkdir -p /var/www/ghost
cd /var/www/ghost
sudo wget https://ghost.org/zip/ghost-latest.zip
sudo unzip ghost-latest.zip -d ghost
cd ghost
sudo npm install --production

Step 6: Configure Ghost CMS

Next, you need to configure Ghost CMS to use your MySQL database. You can do this by editing the config.production.json file:

sudo nano /var/www/ghost/ghost/config.production.json

Change the following lines:

code"database": {
    "client": "sqlite3",
    "connection": {
        "filename": "/var/www/ghost/content/data/ghost.db"
    }
},

to:

code"database": {
    "client": "mysql",
    "connection": {
        "host": "localhost",
        "user": "ghostuser",
        "password": "password",
        "database": "ghost",
        "charset": "utf8"
    }
},

Be sure to replace ‘password’ with the password you chose in step 4.

Step 7: Start Ghost CMS

Finally, you can start Ghost CMS using the following command:

sudo NODE_ENV=production npm start --production

You should now be able to access Ghost CMS by visiting http://your_server_ip_address:2368 in your web browser.

Congratulations! You have successfully installed Ghost CMS on Ubuntu. In the next section, we’ll walk you through the process of installing Ghost CMS on cPanel.

IV. Installation on cPanel

In this section, we’ll walk you through the process of installing Ghost CMS on cPanel. Follow these steps carefully to ensure a successful installation:

Step 1: Install Node.js

First, you need to install Node.js on your cPanel server. You can do this by logging into cPanel and navigating to the “Node.js” section under the “Software” heading. From there, you can select the latest version of Node.js and click “Install”.

Step 2: Install and configure Nginx

Next, you need to install and configure Nginx on your cPanel server. You can do this by logging into cPanel and navigating to the “Terminal” section under the “Advanced” heading. From there, you can use the following commands to install and configure Nginx:

sudo yum install nginx
sudo systemctl start nginx
sudo systemctl enable nginx
sudo mkdir -p /etc/nginx/conf.d/
sudo nano /etc/nginx/conf.d/ghost.conf

In the ghost.conf file, add the following configuration:

server {
    listen 80;
    server_name your_domain_name.com;
    location / {
        proxy_pass http://127.0.0.1:2368;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

Be sure to replace your_domain_name.com with your actual domain name.

Step 3: Install and configure MySQL

Ghost CMS requires a database to store its data. We recommend using MySQL, a popular relational database that is well-supported by Ghost CMS. You can install and configure MySQL on your cPanel server by logging into cPanel and navigating to the “MySQL® Databases” section under the “Databases” heading.

From there, you can create a new database and user, and grant the user all privileges on the database.

Step 4: Download and install Ghost CMS

Next, you need to download and install Ghost CMS on your cPanel server. You can do this by logging into cPanel and navigating to the “Terminal” section under the “Advanced” heading. From there, you can use the following commands:

sudo mkdir -p /home/your_username/ghost
cd /home/your_username/ghost
sudo wget https://ghost.org/zip/ghost-latest.zip
sudo unzip ghost-latest.zip -d ghost
cd ghost
sudo npm install --production

Be sure to replace your_username with your actual cPanel username.

Step 5: Configure Ghost CMS

Next, you need to configure Ghost CMS to use your MySQL database. You can do this by editing the config.production.json file:

sudo nano /home/your_username/ghost/ghost/config.production.json

Change the following lines:

jsonCopy code"database": {
    "client": "sqlite3",
    "connection": {
        "filename": "/home/your_username/ghost/content/data/ghost.db"
    }
},

to:

jsonCopy code"database": {
    "client": "mysql",
    "connection": {
        "host": "localhost",
        "user": "your_mysql_username",
        "password": "your_mysql_password",
        "database": "your_mysql_database",
        "charset": "utf8"
    }
},

Be sure to replace your_mysql_username, your_mysql_password, and your_mysql_database with your actual MySQL database credentials.

Step 6: Start Ghost CMS

Configuration

Now that you have installed Ghost CMS on either Ubuntu or cPanel, it’s time to configure it. Follow these steps to get started:

Step 1: Start Ghost CMS

First, you need to start Ghost CMS. You can do this by running the following command:

cd /path/to/ghost/
sudo npm start --production

Replace /path/to/ghost/ with the actual path to your Ghost CMS installation directory.

Step 2: Access Ghost CMS

Once Ghost CMS has started, you can access it by navigating to http://your_domain_name.com:2368 in your web browser. Be sure to replace your_domain_name.com with your actual domain name.

Step 3: Create an admin account

When you first access Ghost CMS, you will be prompted to create an admin account. Follow the instructions on the screen to create your account.

Step 4: Configure Ghost CMS settings

Once you have created your admin account, you can log in to Ghost CMS and configure its settings. From the Ghost CMS dashboard, you can customize your site’s title, description, logo, theme, and more.

Step 5: Start publishing

Now that you have installed and configured Ghost CMS, you’re ready to start publishing content! Use the Ghost CMS dashboard to create posts, pages, tags, and more. You can also configure your site’s navigation and other settings from the dashboard.

Congratulations, you have successfully installed and set up Ghost CMS! With its powerful features and intuitive interface, Ghost CMS makes it easy to create and manage a beautiful, professional-looking website or blog.

Themes and Plugins

One of the great things about Ghost CMS is its flexibility. You can easily customize your site’s appearance and functionality by installing themes and plugins. Here’s how to do it:

Themes

To install a theme in Ghost CMS, follow these steps:

Step 1: Choose a theme

First, choose a theme that you like. There are many free and paid themes available online, including on the official Ghost Marketplace.

Step 2: Download the theme

Once you have found a theme that you like, download it to your computer.

Step 3: Upload the theme

From the Ghost CMS dashboard, navigate to the “Design” section and click “Upload a theme”. Select the theme file that you downloaded in step 2 and upload it to Ghost CMS.

Step 4: Activate the theme

Once you have uploaded the theme, click the “Activate” button to activate it on your site.

Plugins

To install a plugin in Ghost CMS, follow these steps:

Step 1: Choose a plugin

First, choose a plugin that you want to install. There are many free and paid plugins available online, including on the official Ghost Marketplace.

Step 2: Download the plugin

Once you have found a plugin that you like, download it to your computer.

Step 3: Install the plugin

From the Ghost CMS dashboard, navigate to the “Labs” section and click “Upload a plugin”. Select the plugin file that you downloaded in step 2 and upload it to Ghost CMS.

Step 4: Activate the plugin

Once you have uploaded the plugin, click the “Activate” button to activate it on your site.

That’s it! With themes and plugins, you can easily customize your Ghost CMS site to suit your needs and preferences. There are many great themes and plugins available, so take some time to explore and find the ones that work best for you.

Launching Ghost CMS

Now that you have installed and configured Ghost CMS, it’s time to launch it so that your site is publicly accessible. Here’s how to do it:

Step 1: Stop Ghost CMS

If you followed the instructions in section III to install Ghost CMS on Ubuntu, you can stop Ghost CMS by pressing Ctrl + C in the terminal where Ghost CMS is running.

If you followed the instructions in section IV to install Ghost CMS on cPanel, you can stop Ghost CMS by navigating to the “Cron Jobs” section of cPanel and deleting the cron job that you created to start Ghost CMS.

Step 2: Set up a process manager

To launch Ghost CMS and keep it running in the background, you should set up a process manager. PM2 is a popular process manager that works well with Ghost CMS.

To install PM2, run the following command:

sudo npm install -g pm2

Step 3: Start Ghost CMS with PM2

To start Ghost CMS with PM2, run the following command:

cd /path/to/ghost/
pm2 start index.js --name "ghost"

Replace /path/to/ghost/ with the actual path to your Ghost CMS installation directory.

Step 4: Configure PM2 to start Ghost CMS on boot

To ensure that Ghost CMS starts automatically when your server reboots, you should configure PM2 to start Ghost CMS on boot. To do this, run the following command:

pm2 startup systemd

This will generate a command that you need to run as sudo. Copy the command and run it as sudo.

Step 5: Check that Ghost CMS is running

You can check that Ghost CMS is running by running the following command:

pm2 list

This will list all the processes that PM2 is managing, including Ghost CMS.

Step 6: Access your site

Once Ghost CMS is running, you can access your site by navigating to http://your_domain_name.com in your web browser. Be sure to replace your_domain_name.com with your actual domain name.

Congratulations, you have successfully launched Ghost CMS! Your site is now publicly accessible, and you can start publishing content and growing your audience.

Conclusion

Ghost CMS is a powerful and flexible platform that allows you to create and publish content on the web. With its simple and elegant interface, it’s easy to use, and with its powerful features, it’s capable of handling even the most demanding websites.

In this tutorial, we’ve covered how to install and set up Ghost CMS on Ubuntu and cPanel, as well as how to customize your site’s appearance and functionality with themes and plugins. We’ve also shown you how to launch Ghost CMS so that your site is publicly accessible.

We hope that this tutorial has been helpful and that you are now well-equipped to create and manage your own Ghost CMS site. If you have any questions or feedback, please feel free to leave a comment below. Thanks for reading!

Share this item:

1 1 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

Table of Contents

Related Posts