Running Minikube in AWS EC2 (Ubuntu)

If you are studying Kubernetes and having a hard time running Minikube on an EC2 Instance, you are not alone. I had a hard time doing it when it was my first time.

Below are the steps (and some comments) that I took to help me run Minikube on my EC2 Instance.

Installation of Minikube on EC2 Ubuntu

1. Run a public EC2 Server with the following setup

AMI Ubuntu Server 18.04 LTS (HVM), SSD Volume Type
Instance Type t2.micro
Storage 8 GB (gp2)
Tags – Key: Name
– Value: Minikube
Security Group Name: Minikube Security Group
– SSH,
Later we will be editing this.
Key Pair Create your own keypair.
You will need this to SSH to your EC2 Instance

The above setup is within the AWS Free Tier so you could try Minikube on EC2 without spending money. But you can run Minikube on a bigger instance if you like.

2. SSH into your created EC2 Instance using your keypair.

ssh [email protected]<ipv4_public_ip> -i <keypair>.pem

3. Install kubectl

curl -LO$(curl -s
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl

4. Install Docker

sudo apt-get update && \
    sudo apt-get install -y

Minikube requires Docker.

5. Install Minikube

curl -Lo minikube && chmod +x minikube && sudo mv minikube /usr/local/bin/

6. Check Minikube Version

minikube version

We have now successfully installed Minikube!

Let’s test it!

Running Minikube on EC2 Ubuntu

Become a root user.

sudo -i

If you are not comfortable running commands as root, you must always add sudo before the commands minikube and kubectl.

2. Start Minikube

minikube start --vm-driver=none

Do not worry about the warning. As long as you see the message ‘Kubectl is now configured to use the cluster.’ you have successfully ran Minikube.

Note: In the Install Minikube documentation from it says that you need to enable virtualization by accessing the computer’s BIOS. For EC2 Instances we do not have access to the BIOS since AWS EC2 instance is a Virtual Machine. Thus we are using the --vm-driver=none tag. No need to install a Hypervisor (VirtualBox or KVM)

3. Check the status of Minikube

minikube status

If you see the status as ‘running’ then we can now run kubectl commands.

4. Let us run our first container

kubectl run hello-minikube --port=8080

5. Expose the container ports so that we can access it.

kubectl expose deployment hello-minikube --type=NodePort

6. Find where port 8080 in container exposed in EC2 Instance port.

kubectl get services

Note: Port 30263 is the EC2 Instance Port where the Port 8080 of the container is exposed.

The EC2 Instance Port changes each time you expose a port, you may have been given a different value than what I have.

kubectl get services command shows the list of services and their exposed ports.

Let us check by accessing this via a web browser on our local computer. But first we need to edit our EC2 Security Group.

7. Edit Security Group of the EC2 Instance to be access

The goal is for us to be able to access the EC2 Instance Port (30263 for me) via the internet.

EC2 >> (Network & Security) Security Groups >> Minikube Security Group >> Ingress

Press Edit. Then Add Rule.

Add the following.

Type Custom TCP Rule
Protocol TCP
Port Range 30263 (the port given to you by the kubectl get services command)
Source Custom (Accessible via the internet)

Click Save.

8. Access the our container via the EC2 Instance Port on a web browser.

The address is <ipv4_public_ip>:<ec2_port>.

My EC2 Instance has an IPv4 Public IP of And since my hello-minikube port 8080 is exposed on port 30263, the address that I placed on my browser is

See the request_uri of the page displayed by the web browser, it says that I am accessing via port 8080.

I accessed my container deployment using Chrome on my laptop. You can use any web browser you like (Safari, Internet Explorer, Edge, Firefox, etc.)

Now that we know that we can access our container, let us finish this and clean up.

9. Delete the exposed service (port)

kubectl delete services hello-minikube

10. Delete the deployed container (hello-minikube)

kubectl delete deployment hello-minikube

Stopping Minikube/Shutting Down the Cluster

minikube stop

I hope the above helps when you want to use Minikube on EC2 Ubuntu.

If there are errors, comments, suggestions, or clarifications you can comment them below.

17 thoughts on “Running Minikube in AWS EC2 (Ubuntu)”

  1. Hi! Thank you so much for such an easy-to-follow article! It helped me to get my first minikube up and running on a free EC2 instance without any problem.

    1. I’d suggest you throw in 4 gigs of RAM to the instance and try again. This seem to have worked for me (apparently)!

  2. One step is missing in this procedure.
    In order to forward the traffic to the service you must run:
    $ kubectl port-forward –address svc/hello-minikube 30263:80
    (with the appropriate port)
    Otherwise, you will get connection refused

  3. Thank you for this tutorial. I was able to start minikube but encountered this error on one of the steps.
    # kubectl run hello-minikube – –port=8080
    error: failed to discover supported resources: Get http://localhost:8080/apis/apps/v1?timeout=32s: dial tcp connect: connection refused
    Do you have any suggestions?

  4. Great article. Thanks for that. One thing though: when working with Ubuntu 18.04, I had to install CRI using the instructions at:

    And this action was taken because when minikube was started it output some warnings – one of which was this warning: [WARNING IsDockerSystemdCheck]: detected “cgroupfs” as the Docker cgroup driver. The recommended driver is “systemd”. Please follow the guide at

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.