A few things you should know

  1. Make sure npm and nodejs are installed.
  2. If you want to use MySql, make sure mysql is also installed.

Install Ghost

ghost install

After installation, do "ghost ls" to see if everything is running fine.

ghost ls

At this point, you can access ghost at http://localhost:2368

To access it over the domain or external IP, do following...

Next Install Nginx

Install Nginx using yum

sudo yum -y install nginx

Then vi a file in nginx directory sudo vi /etc/nginx/conf.d/ghost.conf and add following...

server {
    listen externa_ip:8000;
    
    location / {
        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:2368;

    }

    location ~ /.well-known {
        allow all;
    }

    client_max_body_size 50m;
}

Restart the Nginx using following command...

sudo service nginx restart

Now cd to ghost directory...

cd /var/www/ghost

Add following to config.production.json

{
  "url": "http://external_ip:8000",
  "server": {
    "port": 2368,
    "host": "127.0.0.1"
  },
  "database": {
    "client": "mysql",
    "connection": {
      "host": "localhost",
      "user": "root",
      "database": "ghost_prod"
    }
  },
  "mail": {
    "transport": "Direct"
  },
  "logging": {
    "transports": [
      "file",
      "stdout"
    ]
  },
  "process": "systemd",
  "paths": {
    "contentPath": "/var/www/ghost/content"
  }
}

Now restart your ghost session.

ghost restart

Now you should be able to access your admin dashboard at http://external_ip:8000/ghost/