GoLand 2026.3 Help

Tutorial: deploy your application to a minikube cluster

In this tutorial, you will learn how to start a local Kubernetes cluster with minikube directly from GoLand and deploy a sample Go application to it. As part of this process, you will build the application, create a Docker image, and deploy it to minikube.

Running Kubernetes locally is especially useful for prototyping, testing deployments, and learning Kubernetes workflows. Using the Docker and Kubernetes support available in GoLand, you will be able to start the cluster, deploy resources, and inspect your application without leaving the IDE.

Before you start

Before you start, make sure that you have the following installed and configured:

Enable required plugins

The functionality used in this tutorial relies on the following plugin:

The plugin is bundled and enabled in GoLand by default. If the relevant feature is not available, make sure that you did not disable the plugin.

  1. Press Ctrl+Alt+S to open settings and then select Plugins.

  2. Find the required plugins and toggle them on.

To get started, create a sample Go project or open an existing Go project in GoLand.

Create a sample Go application

  1. Create a new Go project.

  2. Create a main.go file and add the following code:

    package main import ( "fmt" "net/http" ) func main() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "Hello from GoLand and minikube!") }) http.ListenAndServe(":8080", nil) }

Build the application

Before deploying the application to Kubernetes, you need to build it and package into a container image. In this tutorial, the go build command to compile the application source code and produce an executable file.

  1. Open the Terminal tool window: go to View | Tool Windows | Terminal or press Alt+F12.

  2. Run the following command to build the application:

    go build -o app .
  3. Make sure that the app executable file appears in the project root.

Containerize the application

In this step, you will package the built application into a Docker image. Kubernetes will run this image later as a container in a pod.

Create a Dockerfile

  1. In the Project tool window Alt+1, right-click the project root, point to New, and click File.

  2. In the New File… dialog, type Dockerfile and press Enter.

    If prompted, agree to add the file to Git.

  3. Paste the following code to the new Dockerfile:

    FROM golang:1.26-alpine AS builder WORKDIR /app COPY go.mod ./ RUN go mod download COPY . . RUN go build -o server . FROM alpine:latest WORKDIR /app COPY --from=builder /app/server . EXPOSE 8080 ENTRYPOINT ["./server"]

The created Dockerfile contains instructions for building a Docker image in two stages. The first stage compiles the Go application. The second stage copies the compiled executable file to a lightweight Alpine Linux image.

When you start a container from the image, Docker runs the ./server command, which starts the Go application.

Build the Docker image

  1. In the gutter inside the Dockerfile, click The Run on Docker icon and select New Run Configuration.

    Create a new Dockerfile run/debug configuration from the editor
  2. In the Edit Run Configuration dialog, specify go-minikube-app in the Image tag field and go-minikube in the Container name field. Then, click Run.

GoLand creates a Dockerfile run configuration, which builds an image from the Dockerfile and then runs a container based on that image. To follow the whole process, open the Log tab in the Services tool window.

Push the log tab in the Services tool window

Connect to minikube

Now that you have a Docker image with your application, you need to start a local Kubernetes cluster to deploy it to. We will use minikube to run a local, single-node Kubernetes cluster directly from GoLand.

Start minikube with the Docker driver

  1. Open the Terminal tool window: go to View | Tool Windows | Terminal or press Alt+F12.

  2. Run the following command to start a local Kubernetes cluster and instruct minikube to use Docker as the virtualization driver:

    minikube start --driver=docker
  3. Verify that your cluster is up and running by using the command:

    minikube status

Using the Docker driver runs the minikube cluster inside Docker containers, providing a lightweight environment well suited for local development.

Add the minikube cluster to GoLand

  1. Open the Services tool window: go to View | Tool Windows | Services or press Alt+8.

  2. Select the Kubernetes node, click the Add Cluster button, and then select From Default Directory from the context menu.

    Adding a new cluster from the Kubernetes welcome screen in the Services tool window
  3. In the Add Clusters dialog, select minikube and click Add Clusters.

    The added cluster will become available in the Services tool window.

  4. In the Services tool window, right-click the minikube cluster and select Connect Cluster.

    Connect to the minikube cluster

At this point, GoLand is connected to the running minikube cluster and can display its Kubernetes resources. You can explore namespaces, nodes, and other cluster objects directly from the Services tool window.

Deploy the application

Earlier in the tutorial, you already built the application image locally. However, the minikube cluster cannot automatically access images from your local Docker daemon. You need to load the image into minikube to make it available.

Load the Docker image into minikube

  1. Open the Terminal tool window: go to View | Tool Windows | Terminal or press Alt+F12.

  2. Run the following command to build the container image in minikube:

    minikube image load go-minikube-app
  3. Validate that the go-minikube-app image is available in your cluster by running:

    minikube image ls | grep go-minikube-app

    You should see docker.io/library/go-minikube-app:latest in the output.

Now that the image is available in minikube, the next step is to describe how Kubernetes will run it. Let us create two Kubernetes manifests:

  • Deployment, which helps you run your container in a pod

  • Service, which exposes your app so that you can access it from your machine

Create a Deployment manifest

  1. In the Project tool window (Alt+1) , right-click the project name and select New | Kubernetes Resource.

  2. In the New Kubernetes Resource dialog, select the Deployment file type, specify go-minikube-deployment as the manifest name, and press Enter.

    Create a new Deployment

    If prompted, agree to add the file to Git.

  3. Replace the content of the resulting go-minikube-deployment.yaml file with the following code:

    apiVersion: apps/v1 kind: Deployment metadata: name: go-minikube spec: replicas: 1 selector: matchLabels: app: go-minikube template: metadata: labels: app: go-minikube spec: containers: - name: go-minikube image: go-minikube-app:latest imagePullPolicy: IfNotPresent ports: - containerPort: 8080
  4. On the floating toolbar, select the current cluster and namespace, then click Apply icon Apply to deliver the changes to the local cluster.

    The Apply button on the floating toolbar

Create a Service manifest

  1. In the Project tool window (Alt+1) , right-click the project name and select New | Kubernetes Resource.

  2. In the New Kubernetes Resource dialog, select the Service file type, specify go-minikube-service as the manifest name, and press Enter.

    If prompted, agree to add the file to Git.

  3. Replace the content of the resulting go-minikube-service.yaml file with the following code:

    apiVersion: v1 kind: Service metadata: name: go-minikube spec: type: NodePort selector: app: go-minikube ports: - port: 8080 targetPort: 8080
  4. On the floating toolbar, select the current cluster and namespace, then click Apply icon Apply to deliver the changes to the local cluster.

Access the application

  1. Open the go-minikube-deployment.yaml file in the editor.

  2. Click the Forward Ports inlay hint next to the - containerPort: 8080 property.

  3. In the Forward Ports dialog, leave the default values and click Forward.

  4. In the go-minikube-deployment.yaml file, click the Open in Browser inlay hint.

    Start of a new port-forwarding session in the Services tool window

    GoLand redirects you to your default browser, where you can check the Go application deployed in your local minikube cluster.

You have learned how to deploy a Go application to a local Kubernetes cluster using minikube and GoLand. This approach enables quick local testing and experimentation with Kubernetes without requiring a remote cluster.

Next steps

Learn how to work with Kubernetes from these topics:

14 October 2026