---
title: "Deploying a Simple Go/Gin Application on Heroku"
description: "A Go/Gin REST API deploys to Heroku with three files beyond the source: go.mod/go.sum (cleaned with go mod tidy) and a one-line Procfile."
url: "https://swe.quest/articles/deploying-a-simple-go-gin-application-on-heroku-3b0ebc70afe1a20c"
canonical: "https://www.heroku.com/blog/deploying-simple-go-gin-application-on-heroku/"
source: "Heroku Engineering"
published: "2025-05-22"
difficulty: "medium"
kind: "How-to"
reading_minutes: 6
tags: ["go","deployment","cloud"]
---

# Deploying a Simple Go/Gin Application on Heroku

A post on [Heroku Engineering](https://swe.quest/sources/heroku.md), published 2025-05-22, 6 min read, How-to. Original: [https://www.heroku.com/blog/deploying-simple-go-gin-application-on-heroku/](https://www.heroku.com/blog/deploying-simple-go-gin-application-on-heroku/)

## Summary

A Go/Gin REST API deploys to Heroku with three files beyond the source: go.mod/go.sum (cleaned with go mod tidy) and a one-line Procfile. The walkthrough covers installing Go 1.24, initializing a module, adding Gin, testing endpoints locally with curl, creating the app with the Heroku CLI, and pushing via the git remote so the Go buildpack compiles the binary. If the service is unreachable after deploy, point the Procfile at the built binary (./bin/go-gin) instead of \`go run main.go\`, then verify with \`heroku logs --tail\`.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Go](https://swe.quest/tags/go.md) (Languages)
- [Deployment](https://swe.quest/tags/deployment.md) (Reliability & operations)
- [Cloud platforms](https://swe.quest/tags/cloud.md) (Infrastructure)

## Prerequisites

- Go modules basics ([easy posts on Go](https://swe.quest/tags/go.md?difficulty=easy))
- Git

## Keywords

Heroku, Gin, Heroku CLI, Procfile, Go buildpack

## Related posts

- [How to setup a blog with Hugo and Deno Deploy](https://swe.quest/articles/how-to-setup-a-blog-with-hugo-and-deno-deploy-7b19707c0d32a809.md): Deno · 2022-04-27 · Medium · 5 min read · CI/CD, Deployment, CDN & edge, JavaScript
  A Hugo static site can be published on Deno Deploy by building it in GitHub Actions and serving the generated public directory with Deno's standard-library file server, imported directly by URL with no download or compile step.
- [Introducing deployctl, the command line interface for Deno Deploy](https://swe.quest/articles/introducing-deployctl-the-command-line-interface-for-deno-deploy-f471a4c6be1d0b1b.md): Deno · 2024-03-15 · Medium · 9 min read · Deployment, Serverless, Developer tools, TypeScript
  deployctl is a CLI for managing the full lifecycle of Deno Deploy projects from the terminal: deploying, renaming projects, inspecting deployments, streaming logs, monitoring resource usage with \`deployctl top\`, promoting preview deployments to production, and deleting deployments or projects.
- [How to Use pnpm on Heroku](https://swe.quest/articles/how-to-use-pnpm-on-heroku-b64d4748dc64db6e.md): Heroku Engineering · 2024-07-19 · Medium · 4 min read · JavaScript, Build systems, Deployment, Cloud platforms
  Heroku's Node.js buildpack now supports pnpm, and early adopters saw 10-40% faster installs than npm, thanks to pnpm's content-addressable store, symlinked dependencies and overlapping resolve/fetch/link stages.
- [Ready, steady, goa: our API setup](https://swe.quest/articles/ready-steady-goa-our-api-setup-f9a8a900b508af76.md): incident.io · 2025-08-11 · Medium · 10 min read · API design, Go, TypeScript, Developer productivity
  incident.io defines its HTTP API in Goa's design-first DSL, which generates net/http transport handlers, validation code, typed Go service interfaces, OpenAPI 3.0 specs and Go clients.
- [The quest for the five minute deploy](https://swe.quest/articles/the-quest-for-the-five-minute-deploy-9b91763fbfd58020.md): incident.io · 2025-07-22 · Medium · 9 min read · CI/CD, Go, Build systems, Caching, Developer productivity
  incident.io cut CI/CD times by moving from a hosted provider, where a cold Go build cache made compiling 15,000+ tests across 350+ packages the bottleneck, to Buildkite running on three self-hosted 48-vCPU servers.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
