Skip to main content
If you have Go installed, you can install and run Gate directly using Go’s toolchain. This is ideal for developers or those who want to build from source.

Prerequisites

Ensure you have the following installed:

Go

Version 1.24.1 or laterDownload from go.dev/doc/install

Git

For cloning the repository (optional)Install from git-scm.com
Verify your installation:
go version
# Expected: go version go1.24.1 or later

Quick Install

Install Gate globally using go install:
go install go.minekube.com/gate@latest
This will:
  • Download the Gate source code
  • Compile the binary
  • Install it to $GOPATH/bin/gate (typically ~/go/bin/gate)
Make sure $GOPATH/bin is in your PATH:
echo 'export PATH="$HOME/go/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Run Gate:
gate

Run Without Installation

You can run Gate directly without installing using go run:
go run go.minekube.com/gate@latest
This is perfect for:
  • Testing Gate without installing
  • Running different versions side-by-side
  • CI/CD pipelines
  • Development environments
Go downloads and caches modules locally, so subsequent runs are much faster.

Install Specific Version

Install a specific version or commit:
go install go.minekube.com/[email protected]

Build from Source

For development or custom builds:
1

Clone the repository

git clone https://github.com/minekube/gate.git
cd gate
2

Install dependencies

go mod download
This downloads all required dependencies specified in go.mod.
3

Build the binary

go build -o gate gate.go
For a production build with optimizations:
CGO_ENABLED=0 go build \
  -ldflags="-s -w -X 'go.minekube.com/gate/pkg/version.Version=custom'" \
  -o gate gate.go
Flags explained:
  • CGO_ENABLED=0 - Static binary without C dependencies
  • -s -w - Strip debug info (smaller binary)
  • -X - Set version information
4

Run the binary

./gate
5

(Optional) Install to PATH

sudo mv gate /usr/local/bin/
# or for user install:
mkdir -p ~/.local/bin
mv gate ~/.local/bin/

Cross-Compilation

Build Gate for different platforms:
GOOS=linux GOARCH=amd64 go build -o gate-linux-amd64 gate.go

Development Workflow

For active development:
1

Clone and enter directory

git clone https://github.com/minekube/gate.git
cd gate
2

Run in development mode

go run gate.go
This rebuilds automatically when you run the command.
3

Run tests

go test ./...
4

Format code

go fmt ./...
5

Check for issues

go vet ./...
See the Developers Guide for comprehensive development documentation.

Module Information

Gate’s Go module details:
module go.minekube.com/gate

go 1.24.1
View all dependencies:
go list -m all
Update dependencies:
go get -u ./...
go mod tidy

Using Gate as a Library

You can also import Gate as a library in your own Go projects:
package main

import (
    "go.minekube.com/gate/pkg/edition/java/proxy"
)

func main() {
    // Create and configure Gate proxy programmatically
    // See API documentation for details
}
Add to your project:
go get go.minekube.com/gate@latest

Troubleshooting

Go is not installed or not in your PATH.
  1. Install Go from go.dev/doc/install
  2. Add Go to your PATH:
    export PATH=$PATH:/usr/local/go/bin
    
$GOPATH/bin is not in your PATH.Add it to your shell profile:
echo 'export PATH="$HOME/go/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Gate requires Go 1.24.1 or later.Update Go:
# Download latest from go.dev
go version
Check your internet connection and proxy settings:
go env GOPROXY
# Should show: https://proxy.golang.org,direct
Clear module cache and retry:
go clean -modcache
go mod download
Update and tidy dependencies:
go get -u ./...
go mod tidy
go mod verify

Performance Optimization

For production builds, use these optimizations:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
  -a \
  -ldflags='-s -w -extldflags "-static"' \
  -tags netgo \
  -o gate \
  gate.go
Benefits:
  • Fully static binary (no external dependencies)
  • Smaller binary size (stripped symbols)
  • Better portability
  • Suitable for containers (distroless, scratch)

Verify Installation

Check that Gate is installed correctly:
gate --version
Expected output:
Gate 0.42.2

Next Steps

Quick Start

Get your proxy running

Configuration

Customize Gate settings

Developers Guide

Contribute to Gate or build plugins

Binary Installation

Install pre-built binaries instead

Build docs developers (and LLMs) love