How to host Ghost Blog in China?
How to host Ghost Blog in China?


What is Ghost?

Ghost is a free and open source blogging tool developed based on NodeJS. It is also used to build and run modern blogs, magazines and periodicals.


How to Deploy Ghost

21YunBox provides a very simple Ghost deployment method. Since there are different scenerios, we have prepared two deployment solutions for you.


Solution 1: For Medium and Large Projects, the Best Performance Solution: Ghost + MySQL

Ghost blogs are generally used in conjunction with MySQL databases, which is also the combination suggested by Official Document

This solution is equipped with an independent MySQL database, the performance will be better, and it can support more users to read your blog at the same time!


Ghost Deployment

You can deploy Ghost to the server through the following steps:

  1. Signup on 21YunBox
  2. Create a MySQL database
  3. Click “Hosted Application” in the navigation menu, then select “Ghost”

In terms of choosing service configuration, Ghost official documentation suggests https://ghost.org/docs/hosting/#self-hosting Use at least 1GB RAM and 10GB cloud disk. If you choose a machine with fewer cloud disks for deployment, the deployment may fail.

4. Click Advanced Configuration and add the following environment variables:

Environment Variable Key Environment Variable Value  
NODE_ENV production  
url https://<app_id>.21yunbox.com  
database__client mysql  
database__connection__host MySQL host name  
database__connection__database MySQL database  
database__connection__user MySQL username  
database__connection__password MySQL user password  

For other Ghost environment variable configurations, please refer to Ghost official documentation: https://ghost.org/docs/config/#configuration-options

5. Click “Create Now”

Before you know it, your Ghost is deployed online and you can access it through https://<app_id>.21yunbox.com/ghost.

Ghost blog server deployed successfully!
Ghost blog server deployed successfully!


Operation Video

If you are not sure how to perform the above steps, you can watch the following operation video:

How to Deploy a Ghost Blog to a Server?


Solution 2: For Small and Medium-sized Projects, the most cost-effective solution is Ghost + SQLite

The Ghost blog also supports deployment schemes used in conjunction with SQLite databases. This is not an official recommendation combination. If it is a small or medium-sized project with a small number of users, this configuration is sufficient.


Ghost Deployment

You can deploy Ghost to the server through the following steps:

  1. Signup on 21YunBox
  2. Click “Hosted Application” in the navigation menu, then select “Ghost”

In terms of choosing the service configurations, Ghost official documentation suggests https://ghost.org/docs/hosting/#self-hosting Use at least 1GB RAM and 10GB cloud disk. If you choose a machine with fewer cloud disks for deployment, the deployment may fail.

3. Click Advanced Configuration and add the following environment variables:

Environment Variable Key Environment Variable Value
NODE_ENV production
url https://<APP_ID>.21yunbox.com

If additional configurations are needed, please refer to Ghost official documentation: https://ghost.org/docs/config/#configuration-options

In a matter of seconds, you will be able to access your deployment through https://<app_id>.21yunbox.com/ghost.

Ghost blog server deployed successfully!
Ghost blog server deployed successfully!

4. Click “Create Now”


Configure a Custom Domain Name

21YunBox provides a simple custom domain name configuration, when you complete ICP Filing. You will only need to add a custom domain name in “Settings”, and then change the main domain name by modifying the environment variable url, as follows:

Environment Variable Key Environment Variable Value
url https://www.your-domain.com


Configure Sending Mail Service

If you need to use Ghost to send mail, you can use a third-party mailing service provider, such as Mailgun, they support a quota of 10,000 emails per month.

Take Mailgun as an example. After you create an account and related Token, you can use the following environment variables to configure:

Environment Variable Key Environment Variable Value
mail__transport SMTP
mail__options__service Mailgun
mail__options__auth__user Sending email address configured in Mailgun
mail__options__auth__pass Password configured in Mailgun

If you use other sending mail service providers, you can refer to Ghost’s official documents to configure yourself https://ghost.org/docs/concepts/config/#mail.

When the configuration is complete, click “Update Configuration” in the upper right corner, 21YunBox will help you restart Ghost and configure the mail service



Ready to make your app work in China?

Get Started Questions? Talk to an expert.

Ready to try 21YunBox?

Get Started