Setup Minikube on AWS EC2 Instance

Setup Minikube on AWS EC2 Instance

ยท

1 min read

  • Connect to your AWS EC2 instance using SSH.

  • Update the instance packages.

  •   sudo apt update
    
  • Install Docker

  •   sudo apt -y install docker.io
    
  • Install Minikube and conntrack

  •   curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x ./kubectl && sudo mv ./kubectl /usr/local/bin/kubectl
      curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
      apt install conntrack
    
  • add the current user to the docker group and start a new shell with the updated group membership.

  •   sudo usermod -aG docker $USER && newgrp docker
    
  • Start Minikube

  •   minikube start --driver=docker
    

Complete Script

  • You can also run this script directly if you want :

  •   #!/bin/bash
      sudo su
      apt update
      apt -y install docker.io
      curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x ./kubectl && sudo mv ./kubectl /usr/local/bin/kubectl
      curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
      apt install conntrack
      usermod -aG docker $USER && newgrp docker
    
ย