{"id":33610,"date":"2026-11-28T22:06:14","date_gmt":"2026-11-28T22:06:14","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=33610"},"modified":"2026-11-28T22:06:14","modified_gmt":"2026-11-28T22:06:14","slug":"minikube-tutorials-minikube-commands","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/minikube-tutorials-minikube-commands\/","title":{"rendered":"Minikube Tutorials: minikube commands"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><code>minikube config set memory 10000<\/code> sets the default memory for new minikube clusters. It does not resize a cluster that already exists. This page explains how <code>minikube config<\/code> works, how to actually change memory and CPUs on an existing cluster, how to check the allocation for each driver, and which minikube commands you will use every day.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">minikube config<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The command you provided, <code>minikube config set memory 10000<\/code>, will set the default memory allocation for new Minikube clusters to 10 gigabytes (10000 megabytes).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you have already started a Minikube cluster and want to update the memory allocation for that cluster, you can use the <code>minikube stop<\/code> and <code>minikube start<\/code> commands with the <code>--memory<\/code> flag, like this:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Stop the running Minikube cluster: <code>minikube stop<\/code><\/li>\n\n\n\n<li>Start the Minikube cluster with the desired memory allocation: <code>minikube start --memory=10000 <\/code>Replace <code>10000<\/code> with the desired memory allocation, in megabytes.<\/li>\n\n\n\n<li>Wait for Minikube to start. Depending on the size of the cluster and the resources available on your computer, this could take a few minutes.<\/li>\n\n\n\n<li>Verify that the memory allocation has been updated by running the following command:cCopy code<code>minikube ssh -- free -m <\/code>This command will log into the Minikube virtual machine and display the amount of memory that is currently available.<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Correction: stop and start does not resize an existing cluster<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The steps above suggest that running <code>minikube stop<\/code> and then <code>minikube start --memory=10000<\/code> changes the memory of an existing cluster. With current minikube versions this does not work. Memory, CPUs and disk size are fixed when the VM or container is created. If you pass a different <code>--memory<\/code> value to an existing profile, minikube keeps the old size and prints a warning like this:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">\u2757  You cannot change the memory size <span class=\"hljs-keyword\">for<\/span> an existing minikube cluster. Please first <span class=\"hljs-keyword\">delete<\/span> the cluster.<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">The working procedure is to delete the cluster and create it again with the new size:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">minikube <span class=\"hljs-keyword\">delete<\/span>\nminikube start --memory=<span class=\"hljs-number\">10000<\/span> --cpus=<span class=\"hljs-number\">4<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> <code>minikube delete<\/code> removes the cluster and everything in it: deployments, PersistentVolumes stored on the node, and images you loaded or built inside it. Export any manifests you need first, or keep your YAML in Git so you can reapply it with <code>kubectl apply -f<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How minikube config works<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>minikube config<\/code> stores default values in <code>~\/.minikube\/config\/config.json<\/code>. <code>minikube start<\/code> reads these defaults whenever you don&#039;t pass a flag. Flags on the command line always override the stored values.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># Set defaults for future clusters<\/span>\nminikube config set memory <span class=\"hljs-number\">8192<\/span>\nminikube config set cpus <span class=\"hljs-number\">4<\/span>\nminikube config set driver docker\nminikube config set kubernetes-version v1<span class=\"hljs-number\">.30<\/span><span class=\"hljs-number\">.0<\/span>\n\n<span class=\"hljs-comment\"># Read a single value<\/span>\nminikube config get memory\n\n<span class=\"hljs-comment\"># Show everything you have set<\/span>\nminikube config view\n\n<span class=\"hljs-comment\"># Remove a value and go back to minikube's built-in default<\/span>\nminikube config <span class=\"hljs-keyword\">unset<\/span> memory\n\n<span class=\"hljs-comment\"># List the accepted values for a property<\/span>\nminikube config defaults driver<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">When you set a resource value while a cluster exists, minikube warns that the change takes effect only after <code>minikube delete<\/code> and a new <code>minikube start<\/code>. This is the same rule as in the correction above.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Property<\/th><th>Example value<\/th><th>Notes<\/th><\/tr><\/thead><tbody><tr><td>memory<\/td><td><code>8192<\/code>, <code>8g<\/code>, <code>max<\/code><\/td><td>A plain number is read as megabytes. Units such as <code>mb<\/code> and <code>g<\/code> are accepted.<\/td><\/tr><tr><td>cpus<\/td><td><code>4<\/code>, <code>max<\/code><\/td><td>Number of virtual CPUs for the node.<\/td><\/tr><tr><td>disk-size<\/td><td><code>40g<\/code><\/td><td>Size of the node disk. Applies only when the cluster is created.<\/td><\/tr><tr><td>driver<\/td><td><code>docker<\/code>, <code>virtualbox<\/code>, <code>hyperkit<\/code>, <code>kvm2<\/code>, <code>hyperv<\/code>, <code>qemu<\/code><\/td><td>Which drivers are available depends on your OS.<\/td><\/tr><tr><td>kubernetes-version<\/td><td><code>v1.30.0<\/code>, <code>stable<\/code>, <code>latest<\/code><\/td><td>Kubernetes version for new clusters.<\/td><\/tr><tr><td>container-runtime<\/td><td><code>containerd<\/code>, <code>docker<\/code>, <code>cri-o<\/code><\/td><td>Runtime used inside the node.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> 10000 MB is about 9.8 GiB, not exactly 10 GB. To get a round figure, use <code>--memory=10g<\/code> or <code>--memory=10240<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Changing resources without losing your current cluster<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to keep the existing cluster while you try a larger one, create a second profile. Each profile is a separate cluster with its own resources and its own kubectl context.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Create a new profile with the size you want: <code>minikube start -p big --memory=10g --cpus=4<\/code><\/li>\n\n\n<li>Point kubectl at it. minikube switches the context for you on start, and you can switch back with <code>kubectl config use-context minikube<\/code>.<\/li>\n\n\n<li>Make <code>big<\/code> the default profile for later minikube commands: <code>minikube profile big<\/code><\/li>\n\n\n<li>List all clusters and their status: <code>minikube profile list<\/code><\/li>\n\n\n<li>When you no longer need the old cluster, delete it: <code>minikube delete -p minikube<\/code><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Verifying the memory allocation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>minikube ssh -- free -m<\/code> works well for VM drivers such as VirtualBox, Hyper-V, KVM2 and HyperKit, because the guest sees only its own RAM. With the <strong>Docker driver<\/strong> the node is a container, and <code>free<\/code> inside it usually reports the host&#039;s total memory rather than the container limit. Use the check that matches your driver:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># Value minikube recorded for the profile (works for every driver)<\/span>\ngrep -i <span class=\"hljs-string\">'\"Memory\"'<\/span> ~\/.minikube\/profiles\/minikube\/config.json\n\n<span class=\"hljs-comment\"># VM drivers: memory seen by the guest OS<\/span>\nminikube ssh -- free -m\n\n<span class=\"hljs-comment\"># Docker driver: container memory limit in bytes<\/span>\ndocker inspect minikube --format <span class=\"hljs-string\">'{{.HostConfig.Memory}}'<\/span>\n\n<span class=\"hljs-comment\"># What Kubernetes can schedule on the node<\/span>\nkubectl describe node minikube | grep -A <span class=\"hljs-number\">6<\/span> Allocatable<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">With <code>--memory=10000<\/code> on the Docker driver, <code>docker inspect<\/code> returns <code>10485760000<\/code>, which is 10000 \u00d7 1024 \u00d7 1024 bytes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Everyday minikube commands<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Command<\/th><th>What it does<\/th><\/tr><\/thead><tbody><tr><td><code>minikube start<\/code><\/td><td>Creates the cluster, or starts it again if it is stopped<\/td><\/tr><tr><td><code>minikube status<\/code><\/td><td>Shows the state of the host, kubelet, API server and kubeconfig<\/td><\/tr><tr><td><code>minikube stop<\/code><\/td><td>Stops the cluster and keeps its state<\/td><\/tr><tr><td><code>minikube pause<\/code> \/ <code>minikube unpause<\/code><\/td><td>Freezes Kubernetes to save CPU without stopping the node<\/td><\/tr><tr><td><code>minikube delete<\/code><\/td><td>Deletes the current profile&#039;s cluster<\/td><\/tr><tr><td><code>minikube delete --all --purge<\/code><\/td><td>Deletes every profile and the <code>~\/.minikube<\/code> folder<\/td><\/tr><tr><td><code>minikube kubectl -- get pods -A<\/code><\/td><td>Runs a kubectl that matches the cluster version<\/td><\/tr><tr><td><code>minikube dashboard<\/code><\/td><td>Opens the Kubernetes Dashboard in a browser<\/td><\/tr><tr><td><code>minikube addons list<\/code> \/ <code>minikube addons enable ingress<\/code><\/td><td>Lists or enables add-ons such as ingress and metrics-server<\/td><\/tr><tr><td><code>minikube service &lt;name&gt; --url<\/code><\/td><td>Prints a reachable URL for a NodePort or LoadBalancer Service<\/td><\/tr><tr><td><code>minikube tunnel<\/code><\/td><td>Gives LoadBalancer Services an external IP (keep it running in a separate terminal)<\/td><\/tr><tr><td><code>minikube image load myapp:1.0<\/code><\/td><td>Copies a local image into the cluster<\/td><\/tr><tr><td><code>eval $(minikube docker-env)<\/code><\/td><td>Points your Docker CLI at the Docker daemon inside the node (Docker runtime only)<\/td><\/tr><tr><td><code>minikube mount .\/src:\/data<\/code><\/td><td>Mounts a host folder into the node<\/td><\/tr><tr><td><code>minikube ip<\/code><\/td><td>Prints the node IP<\/td><\/tr><tr><td><code>minikube logs<\/code><\/td><td>Shows minikube and component logs for troubleshooting<\/td><\/tr><tr><td><code>minikube node add<\/code><\/td><td>Adds a worker node to the current profile<\/td><\/tr><tr><td><code>minikube update-context<\/code><\/td><td>Fixes a kubeconfig entry that points to a stale IP or port<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Common errors and fixes<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Symptom<\/th><th>Cause<\/th><th>Fix<\/th><\/tr><\/thead><tbody><tr><td>&quot;You cannot change the memory size for an existing minikube cluster&quot;<\/td><td>Resources are fixed when the cluster is created<\/td><td>Run <code>minikube delete<\/code>, then <code>minikube start --memory=...<\/code>, or create a new profile with <code>-p<\/code><\/td><\/tr><tr><td><code>minikube config get memory<\/code> shows the new value but the cluster has not changed<\/td><td>Config affects only clusters created afterwards<\/td><td>Delete the cluster and create it again<\/td><\/tr><tr><td>Requested memory is more than the system limit<\/td><td>You asked for more RAM than the host, or Docker Desktop, can give<\/td><td>Lower <code>--memory<\/code>, or raise the memory limit in Docker Desktop settings first<\/td><\/tr><tr><td>Requested memory is below the usable minimum<\/td><td>Value too small for Kubernetes to run<\/td><td>Use at least 2 GB. 4 GB or more is a realistic minimum once add-ons are enabled<\/td><\/tr><tr><td>Pods stuck in <code>Pending<\/code> with <code>Insufficient memory<\/code><\/td><td>Requests add up to more than the node can allocate<\/td><td>Lower the resource requests, or recreate the cluster with more memory<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Best practices<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Set <code>memory<\/code>, <code>cpus<\/code> and <code>driver<\/code> once with <code>minikube config set<\/code> so every new cluster is created the same way.<\/li>\n\n\n<li>Leave at least a few gigabytes for the host OS. Giving minikube all your RAM makes both the host and the cluster slow.<\/li>\n\n\n<li>Use <code>minikube stop<\/code> or <code>minikube pause<\/code> at the end of the day. Save <code>minikube delete<\/code> for when you need a clean cluster or a different size.<\/li>\n\n\n<li>Keep manifests in version control so deleting and recreating a cluster takes minutes.<\/li>\n\n\n<li>Use a separate profile for each experiment (<code>-p test<\/code>, <code>-p ingress-lab<\/code>) so one cluster doesn&#039;t break another.<\/li>\n\n\n<li>Remember that minikube is for local development and learning. For production behaviour such as error handling, see the <a href=\"https:\/\/www.devopsschool.com\/blog\/troubleshooting-guide-to-resolving-500-errors-in-kubernetes-production-environments\/\">500 errors troubleshooting guide<\/a>.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently asked questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">How do I increase memory for an existing minikube cluster?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run <code>minikube delete<\/code>, then <code>minikube start --memory=8g<\/code> (or another size). minikube cannot resize an existing cluster, so a stop and start with a new <code>--memory<\/code> flag only prints a warning.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What unit does minikube use for &#8211;memory?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A plain number is read as megabytes, so <code>--memory=4096<\/code> means 4096 MB. You can also add a unit, for example <code>--memory=4g<\/code>, or use <code>max<\/code> to give minikube as much memory as the driver allows.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Where does minikube config store its settings?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Global defaults set with <code>minikube config set<\/code> go in <code>~\/.minikube\/config\/config.json<\/code>. Settings for each cluster, including the memory actually used, are in <code>~\/.minikube\/profiles\/&lt;profile&gt;\/config.json<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why does free -m inside minikube show my host&#039;s total RAM?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">With the Docker driver the node is a container, and <code>free<\/code> reads host memory figures. Check the real limit with <code>docker inspect minikube --format &#039;{{.HostConfig.Memory}}&#039;<\/code> instead.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What is the difference between minikube stop and minikube delete?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>minikube stop<\/code> shuts down the node but keeps the cluster and its workloads, so you can start it again later. <code>minikube delete<\/code> removes the cluster completely. You need it before you can change memory, CPUs or disk size.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related tutorials<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/category\/containers-kubernetes\/kubernetes\/\">More Kubernetes tutorials<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/explained-kubernetes-jobs-and-cronjobs-with-example\/\">Kubernetes Job &amp; CronJob Explained: API Resource, YAML Example, and Use Cases<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/troubleshooting-guide-to-resolving-500-errors-in-kubernetes-production-environments\/\">Troubleshooting Guide to Resolving 500 Errors in Kubernetes Production Environments<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>minikube config set memory 10000 sets the default memory for new minikube clusters. It does not resize a cluster that already exists. This page explains how minikube&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4859],"tags":[4861],"class_list":["post-33610","post","type-post","status-publish","format-standard","hentry","category-kubernetes","tag-minikube"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/33610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=33610"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/33610\/revisions"}],"predecessor-version":[{"id":80396,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/33610\/revisions\/80396"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=33610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=33610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=33610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}