Skip to content

Deploy Gin App on Seenode | Gin Hosting & Deployment Guide

This guide explains how to deploy your existing Gin application to seenode.

Before you begin, ensure you have:

  • A seenode account at cloud.seenode.com
  • Git configured on your machine
  • Existing Gin project ready to deploy

Your main.go file should create a Gin server that listens on the PORT environment variable, defaulting to 80 if not set. This allows seenode to correctly route traffic to your application.

main.go
package main
import (
"fmt"
"os"
"github.com/gin-gonic/gin"
)
func main() {
r := gin.Default()
r.GET("/", func(c *gin.Context) {
c.String(200, "Hello, Welcome to seenode 👋")
})
port := os.Getenv("PORT")
if port == "" {
port = "80"
}
r.Run(fmt.Sprintf(":%s", port))
}

Make sure your go.mod lists gin-gonic/gin as a dependency:

go.mod
module your-gin-project
go 1.21
require github.com/gin-gonic/gin v1.9.1

Run

go mod tidy
to create your go.sum file.

  1. Push to Git

    Commit your project and push it to GitHub or GitLab.

  2. Create a Web Service

    From the seenode Dashboard, create a new Web Service and connect your Gin project’s Git repository.

  3. Configure Build & Start

    seenode will attempt to detect these automatically. Configure:

    • Build Command:
      go build -o app main.go
    • Start Command:
      ./app
    Configure Build & Start: Port field
  4. Choose Pricing Tier

    Select your preferred instance size and create your service.

  5. Deploy

    Click Create Web Service and watch logs until your web service is live.

  6. Success

    Once complete, your Gin application will be accessible via your service’s URL.

If you don’t have a Gin project yet:

Option 1: Use our Template (Recommended)

Option 2: Create from Gin Docs + seenode Setup

Follow the official Gin documentation to create a new project, then return here for seenode-specific deployment steps.

seenode-Specific Setup Steps:

  1. Create Go module: go mod init your-project
  2. Install Gin: go get github.com/gin-gonic/gin
  3. Configure to listen on port 80

Now that your Gin application is deployed, here are some things you might want to do next: