<p>When I run <code>kubectl run</code> ... or any command I get an error message saying</p>

<pre><code>The connection to the server localhost:8080 was refused - did you specify the right host or port?
</code></pre>

<p>What exactly is this error and how to resolve it?</p>

<p>In my case, working with minikube I had not started minikube. Starting minikube with</p>

<pre><code>minikube start
</code></pre>

<p>fixed it.</p>
