Skip to content

Quickstart

This guide gets you from zero to a running Minecraft server on Kubernetes in under five minutes. It assumes you have a working Kubernetes cluster and kubectl configured.

  1. Install the CRD

    Apply the MinecraftServer Custom Resource Definition to your cluster:

    Terminal window
    kubectl apply -f https://raw.githubusercontent.com/danihengeveld/mc-operator/main/manifests/crd/minecraftservers.yaml
  2. Install the operator with Helm

    Terminal window
    helm install mc-operator oci://ghcr.io/danihengeveld/charts/mc-operator \
    --version 1.0.0 \
    --namespace mc-operator-system \
    --create-namespace

    Wait for the operator to be ready:

    Terminal window
    kubectl rollout status deployment/mc-operator -n mc-operator-system
  3. Create a namespace for your servers

    Terminal window
    kubectl create namespace minecraft
  4. Deploy a Paper server

    Terminal window
    cat <<EOF | kubectl apply -f -
    apiVersion: mc-operator.dhv.sh/v1alpha1
    kind: MinecraftServer
    metadata:
    name: my-server
    namespace: minecraft
    spec:
    acceptEula: true
    server:
    type: Paper
    version: "1.20.4"
    jvm:
    initialMemory: "1G"
    maxMemory: "2G"
    resources:
    cpuRequest: "500m"
    memoryRequest: "2Gi"
    memoryLimit: "2Gi"
    storage:
    size: "10Gi"
    EOF
  5. Watch the server provision

    Terminal window
    kubectl get minecraftservers -n minecraft -w

    You will see the phase progress through Pending → Provisioning → Running. The first startup takes a few minutes as the server jar is downloaded.

  6. Connect to your server

    For a ClusterIP service (the default), use kubectl port-forward to test connectivity:

    Terminal window
    kubectl port-forward svc/my-server 25565:25565 -n minecraft

    Open Minecraft, add a server at localhost:25565, and connect.