<p>I am trying to install Kubernetes on Ubuntu 16.04 VM, I tried this <a href="https://kubernetes.io/docs/getting-started-guides/kubeadm/" rel="nofollow noreferrer">https://kubernetes.io/docs/getting-started-guides/kubeadm/</a>, but the API server does not start.</p>

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

<p>Is there a good procedure on how to install Kubernetes on Ubuntu VM</p>

<p>You probably haven't set up the credentials for <code>kubectl</code>.</p>

<pre><code>sudo cp /etc/kubernetes/admin.conf $HOME/ &amp;&amp; sudo chown $(id -u):$(id -g) $HOME/admin.conf; if ! fgrep -q KUBECONFIG= $HOME/.bashrc; then echo 'export KUBECONFIG=$HOME/admin.conf' &gt;&gt; $HOME/.bashrc; fi;. $HOME/.bashrc
</code></pre>

<p>It takes <code>/etc/kubernetes/admin.conf</code> to the home directory and makes it readable by current user. Also adjusts <code>.bashrc</code> to set the <code>KUBECONFIG</code> environment variable to point to that <code>admin.conf</code>.</p>
