<p>How to fix this? I am trying to get the version of kubectl but says server not found. I have already installed kubernetes in my PC.</p>
<p><a href="https://i.stack.imgur.com/LjtYv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LjtYv.png" alt="enter image description here" /></a></p>

<p>You need to configure the KUBECONFIG which indicates the list of address and certs of k8s api servers, contexts and users.</p>
<p>Once you configure it correctly, kubectl can reach to the server.</p>
<p>The default path of kubeconfig is ~/.kube/config.
Also you can specify it using environment variable <code>KUBECONFIG</code> and <code>--kubeconfig</code> flag with <code>kubectl</code> cli.
ex:</p>
<pre><code>export KUBECONFIG=your_kubeconfig_file_path
kubectl config get-contexts
</code></pre>
