Knowledge Base
MilesWeb / Cloud Servers

Easy Setup of Ghost Publishing Platform with Node.js Hosting from MilesWeb Cloud

Approx. read time : 3 min

The post covers the below points:

A simple but powerful Node.js-based publishing platform, Ghost allows people to share their stories with the global audience. Being a completely free and an open source project for blogs, it is available to be used by anyone. Ghost makes blogging easy as well as fun with a set of special tools.  Additionally, it offers great design and is customizable as per your preferences and requirements.

Below are the simple steps for deploying your Ghost project smoothly within the MilesWeb PaaS:

Create an Environment

1. Login to your MilesWeb cloud app and click on New Environment button at the top of the dashboard.

2. In the dialog box displayed select the Node.js tab, where the NodeJS application server is selected by default. Next, add MySQL database and mention the required resource limits for the environment by moving the sliders, give name to your environment (e.g. ghost), and click the Create button.

3. It will take just a minute for your environment to be created.

 

Add Project

1. Ghost is an open-source project and so, can be easily taken from its repository at GitHub: you simply have to press Clone or download button and copy the corresponding link.

2. Go back to the MilesWeb cloud app dashboard, open Deployment Manager > Git/SVN tab and click Add Repo button. Paste the copied link in the above step in the URL field, give a name to your application (e.g. ghost) and press Add button.

3. After adding the Ghost repository to Deployment Manager, click on Deploy to button.

4. Select your environment as it appears and press Deploy.

Your project will require just a minute to build and deploy, so be patient.

In addition, you can set up deployment hooks and automatic deploy (view the corresponding links for the instructions).

Connect MySQL Database

Now it’s time to connect to MySQL with the help of phpMyAdmin.

1. For accessing the admin panel, just click on Open in browser button just near your SQL Database Node.

2. Input your login details sent to your email while creating MySQL node and press the Go button.

3. Click the Databases tab in the phpMyAdmin, mention the database name (e.g. ghost), and create MySQL database by clicking on Create button.

4. The MySQL that is created will be displayed in the list of available databases.

Configure Your Node.js Server

Click on Config button next to the application server layer to change the Node.js configuration files within the MilesWeb cloud app dashboard:

1. Change URL and server sections in the /home/jelastic/ROOT/core/server/config/defaults.json file by replacing <environment URL> with the actual link to your environment and <internal IP of Node.js container> with actual IP address of your Node.js node.

2. Change sections url and database in the /home/jelastic/ROOT/core/server/config/env/config.production.json file:

Replace:

  • <internal IP of MySQL container> with actual IP address of your MySQL container
  • <DB user from email>  and <DB pass from email> with login details sent to you by email while creating MySQL node
  • <DB name> with the actual database name that was created in Create MySQL database section (ghost, in our case).

3. Change the url section pasting the actual link to your environment in the /home/jelastic/ROOT/core/server/config/env/config.development.json file:

{“url”: “<environment URL>“}

4. Use Web SSH to connect with Node.js server:

Then execute the below commands one by one for installing database migration tool for the query builder – knex, for MySQL:

Move to ROOT directory:

Initialize your database based on your init scripts:

5. After performing the previous steps successfully, all the key tables will be created and displayed in the following way:

6. Lastly, update the Node.js server by using Restart nodes button for application of the changes.

Thus, you have successfully hosted your Ghost application within the MilesWeb cloud platform powered by Jelastic. For starting with it, you simply need to launch it by clicking on Open in browser button.

Congratulations! Now you can also reap the benefits of the Ghost application right from creating and running your online publications powered up by MilesWeb PaaS. Don’t miss to give it a try for 30 days free cloud trial at MilesWeb.

Pallavi Godse
Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.
Need help? We’re always here for you.
Register Your Free Domain Name
OFFER EXPIRES IN
04
min
59
sec