How to Deploy Go Gin to China?
Tags: go, gin, webdev, china
Published: 2021-03-18 22:38:42

---
canonical_url: https://www.21cloudbox.com/solutions/how-to-deploy-go-gin-in-production-server.html
---
# What is it Go Gin?
Gin is a web framework developed based on the Go language. It is an API like [Martini](https://github.com/go-martini/martini), but the performance is said to be 40x better than Martini's.

21YunBox provides a very simple Gin project deployment method. You can deploy on the 21YunBox by using the **Go** operating environment.

# How to Deploy a Go Gin Project to a Server?
1. Register to become a [21YunBox member](https://www.21yunbox.com/u/signup/)
2. On Gitee Fork [Go Gin launch template](https://gitee.com/eryiyunbox-examples/hello-gin)
3. Create a **Cloud Service** on 21YunBox, and allow 21YunBox to access your code base
4. Create with the following configuration

| Environment   | **`Go`**         |
| ------------- | :--------------: |
| Build Command | **`./build.sh`** |
| Start command | **`./app`**      |

Click **Advanced Configuration** to configure environment variables:

| KEY.     | VALUE   | Explanation                       |
| :------: | :-----: | :-------------------------------: |
| **PORT** | `10000` | 21YunBox default read port 10000  |


[Go Gin Startup Template](https://gitee.com/eryiyunbox-examples/hello-gin) is a real-time chat project implemented using Gin, using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events) (SSEs) to broadcast messages (not websockets).

When the deployment is successful, you can access the Gin project at `app_id.21yunbox.com`.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/68kyl6fo3uxzhc4p229k.png) *Go Gin live chat example screenshot*

<br>
# Why Choose 21YunBox?

> 21YunBox is a Cloud Service Platform based out of Beijing, China. We specialize in modern web hosting and automation solutions. This enables you to set up websites instantly.  

> **Have questions about hosting and deploying in China? Let us know, we are happy to help!** <hello@21YunBox.com> 

To learn about the differences between 21YunBox and these foreign (outside of China) cloud service platforms, please refer to:

* [21YunBox vs Heroku](https://launch-in-china.21yunbox.com/solutions/how-to-speed-up-heroku-in-china.html)
* [21YunBox vs Netlify](https://launch-in-china.21yunbox.com/blog/solutions/alternatives-to-netlify-in-china.html)
* [21YunBox vs Vercel](https://launch-in-china.21yunbox.com/solutions/how-to-speed-up-vercel-in-china.html)
* [21YunBox vs Gatsby Cloud](https://launch-in-china.21yunbox.com/solutions/how-to-speed-up-gatsby-cloud-in-china.html)
* [21YunBox vs Github Pages](https://launch-in-china.21yunbox.com/solutions/how-to-speed-up-github-pages-in-china.html)
* [21YunBox vs Surge.sh](https://launch-in-china.21yunbox.com/solutions/how-to-speed-up-surgesh-in-china.html)
* [Compare in terms of function and price: 21YunBox vs Heroku, Netlify, Vercel](https://www.21yunbox.com/compare-others/)

<br>
*This article's content originated [here](https://launch-in-china.21yunbox.com/solutions/how-to-deploy-go-gin-in-production-server.html)*

*For additional detail and future modifications, refer the original post.*