Skip to main content

Introduction

This guide covers deploying Gin applications on Shard Cloud. Gin is a high-performance HTTP web framework for Go.

Creating Your Project

Ensure you have Go installed. Download from go.dev.

Initialize Project

Basic Gin Application

Create a main.go file:
main.go
Gin listens on port 80 which is required for web applications on Shard Cloud.

Building Your Application

Go applications must be compiled before deployment:
This creates a binary named app that can run on Shard Cloud.

Shard Cloud Configuration

Create a .shardcloud file:
.shardcloud
Go applications are memory-efficient. 256MB is often sufficient for simple APIs.

Deploying

1

Build Your Application

Run GOOS=linux GOARCH=amd64 go build -o app main.go to create the Linux binary.
2

Prepare Your Files

Ensure you have:
  • app (compiled binary)
  • .shardcloud
3

Create ZIP Archive

Compress your files into a .zip file.
4

Upload to Shard Cloud

Go to Shard Cloud Dashboard and upload your project.

Advanced Example: REST API with Routes

main.go

Additional Resources

Visit the official Gin documentation for more information.

Troubleshooting

Ensure you compiled with GOOS=linux GOARCH=amd64 for the Shard Cloud environment.
Make sure your application uses port 80.