{"id":748,"date":"2026-07-30T02:00:18","date_gmt":"2026-07-30T02:00:18","guid":{"rendered":"https:\/\/virtualserversvps.com\/blog\/?p=748"},"modified":"2026-08-06T22:18:01","modified_gmt":"2026-08-06T22:18:01","slug":"how-to-set-up-a-kubernetes-cluster-on-a-vps-a-practical-step-by-step-guide-with-k3s-for-small-deployments","status":"publish","type":"post","link":"https:\/\/virtualserversvps.com\/blog\/how-to-set-up-a-kubernetes-cluster-on-a-vps-a-practical-step-by-step-guide-with-k3s-for-small-deployments\/","title":{"rendered":"K3s on a Single VPS: A Lightweight Kubernetes Cluster for Small Deployments"},"content":{"rendered":"<p class=\"wp-block-paragraph\">Kubernetes is the de facto standard for container orchestration, but a full kubeadm install with etcd, kubelet, and multiple control-plane components is heavy for a single VPS. K3s packages the control plane, the kubelet, and the container runtime into one binary under 100 MB and runs comfortably in 512 MB of RAM. For a small deployment \u2014 a side project, a CI runner, or a low-traffic application \u2014 K3s gives you a real Kubernetes cluster without the resource tax.<\/p>\n\n<p class=\"wp-block-paragraph\">Before you start, make sure the VPS you are installing on has enough CPU and memory for both the control plane and your workloads. If you are unsure what to provision, <a href=\"https:\/\/virtualserversvps.com\/#providers\">compare VPS plans side by side<\/a> in our comparison table and pick an instance with at least 1 GB of RAM and 2 vCPUs. K3s will run on less, but your applications need headroom too.<\/p>\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n<ul class=\"wp-block-list\"><li>A VPS running Ubuntu 22.04\/24.04 or Debian 12, with at least 1 GB of RAM<\/li><li>A domain name and a DNS A record pointing to the server (needed for ingress and TLS)<\/li><li><code>kubectl<\/code> installed on your local machine<\/li><\/ul>\n\n<h2 class=\"wp-block-heading\">Step 1: Install K3s<\/h2>\n\n<p class=\"wp-block-paragraph\">The installer registers a systemd service and starts the cluster immediately:<\/p>\n\n<pre class=\"wp-block-code\"><code>curl -sfL https:\/\/get.k3s.io | sh -<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">Check that the node reports Ready:<\/p>\n\n<pre class=\"wp-block-code\"><code>sudo k3s kubectl get nodes<\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">Step 2: Configure kubectl on Your Local Machine<\/h2>\n\n<p class=\"wp-block-paragraph\">The kubeconfig file lives at <code>\/etc\/rancher\/k3s\/k3s.yaml<\/code> on the server. Copy it locally and replace the <code>server:<\/code> address with your server&#8217;s public IP or domain so your workstation can reach the API. The file contains a CA certificate and an admin token, so keep permissions tight:<\/p>\n\n<pre class=\"wp-block-code\"><code>sudo cat \/etc\/rancher\/k3s\/k3s.yaml\n# change: server: https:\/\/127.0.0.1:6443\n# to:     server: https:\/\/YOUR_SERVER_IP:6443\nchmod 600 k3s.yaml\nkubectl --kubeconfig k3s.yaml get nodes<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">If the API port is not reachable, allow 6443 through the firewall: <code>sudo ufw allow 6443\/tcp<\/code>. For anything beyond a lab, restrict that rule to your own IP address instead of leaving it open to the internet.<\/p>\n\n<h2 class=\"wp-block-heading\">Step 3: Deploy a Sample Application<\/h2>\n\n<p class=\"wp-block-paragraph\">Create a Deployment and a Service. Save this manifest as <code>app.yaml<\/code>:<\/p>\n\n<pre class=\"wp-block-code\"><code>apiVersion: apps\/v1\nkind: Deployment\nmetadata:\n  name: demo\nspec:\n  replicas: 2\n  selector:\n    matchLabels:\n      app: demo\n  template:\n    metadata:\n      labels:\n        app: demo\n    spec:\n      containers:\n        - name: demo\n          image: nginx:alpine\n          ports:\n            - containerPort: 80\n---\napiVersion: v1\nkind: Service\nmetadata:\n  name: demo\nspec:\n  selector:\n    app: demo\n  ports:\n    - port: 80\n      targetPort: 80<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">Apply it and wait for the pods to start:<\/p>\n\n<pre class=\"wp-block-code\"><code>kubectl apply -f app.yaml\nkubectl rollout status deployment\/demo<\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">Step 4: Expose It with an Ingress<\/h2>\n\n<p class=\"wp-block-paragraph\">K3s ships with Traefik as the default ingress controller, so no extra install is needed. Create an Ingress resource that routes your domain to the service:<\/p>\n\n<pre class=\"wp-block-code\"><code>apiVersion: networking.k8s.io\/v1\nkind: Ingress\nmetadata:\n  name: demo\nspec:\n  rules:\n    - host: app.example.com\n      http:\n        paths:\n          - path: \/\n            pathType: Prefix\n            backend:\n              service:\n                name: demo\n                port:\n                  number: 80<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">Point the DNS A record at the VPS IP, and within a minute Traefik starts serving the app. K3s bundles cert-manager, so adding an annotation to the Ingress requests a Let&#8217;s Encrypt certificate automatically.<\/p>\n\n<h2 class=\"wp-block-heading\">Step 5: Monitor the Cluster<\/h2>\n\n<p class=\"wp-block-paragraph\">K3s includes metrics-server out of the box, so <code>kubectl top<\/code> works immediately. It shows real CPU and memory usage per node and per pod, which is the fastest way to spot a container that is silently eating the whole VPS:<\/p>\n\n<pre class=\"wp-block-code\"><code>kubectl top nodes\nkubectl top pods -A<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">For a quick health sweep, <code>kubectl get events --sort-by=.lastTimestamp<\/code> lists recent scheduler and runtime events, and <code>kubectl describe pod &lt;name&gt;<\/code> shows why a pod is stuck in CrashLoopBackOff or Pending.<\/p>\n\n<h2 class=\"wp-block-heading\">Step 6: Persist Data with a Volume<\/h2>\n\n<p class=\"wp-block-paragraph\">Pods are ephemeral: when a pod is deleted, everything written to its container filesystem disappears with it. For stateful workloads such as a database, mount a hostPath volume or a Longhorn volume so the data survives pod restarts:<\/p>\n\n<pre class=\"wp-block-code\"><code>volumes:\n  - name: data\n    hostPath:\n      path: \/var\/lib\/demo-data\ncontainers:\n  - name: demo\n    image: nginx:alpine\n    volumeMounts:\n      - name: data\n        mountPath: \/data<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">On a single node a hostPath is fine; if you later join more nodes, move to Longhorn (bundled with K3s) so volumes can follow pods across the cluster.<\/p>\n\n<h2 class=\"wp-block-heading\">Step 7: Back Up etcd<\/h2>\n\n<p class=\"wp-block-paragraph\">K3s snapshots its embedded datastore to <code>\/var\/lib\/rancher\/k3s\/server\/db\/snapshots<\/code> on a schedule you configure with the <code>--etcd-snapshot-schedule-cron<\/code> server flag. Always take a manual snapshot before upgrading the cluster:<\/p>\n\n<pre class=\"wp-block-code\"><code>sudo k3s etcd-snapshot save\nsudo k3s server --cluster-reset  # disaster recovery path<\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">Scaling Later<\/h2>\n\n<p class=\"wp-block-paragraph\">When one node is not enough, join additional servers or agents using the token in <code>\/var\/lib\/rancher\/k3s\/server\/node-token<\/code>. The single-node setup you start with upgrades cleanly to a multi-node cluster, so there is no migration penalty for beginning small.<\/p>\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n<p class=\"wp-block-paragraph\">K3s turns a modest VPS into a production-grade Kubernetes cluster with a single command and a fraction of the memory footprint of a full distribution. Start small, back up etcd before every change, and scale out only when your workloads justify the extra nodes. If you are choosing hardware for the cluster, see the <a href=\"https:\/\/virtualserversvps.com\/#providers\">full specs and pricing<\/a> in our comparison table to match the right VPS to your node count.<\/p>","protected":false},"excerpt":{"rendered":"<p>Kubernetes is the de facto standard for container orchestration, but a full kubeadm install with etcd, kubelet, and multiple control-plane components is heavy for a single VPS. K3s packages the&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":2,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-748","post","type-post","status-publish","format-standard","hentry","category-performance-optimization"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v26.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>K3s on a Single VPS: A Lightweight Kubernetes Cluster for Small Deployments - Virtual Servers VPS Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/virtualserversvps.com\/blog\/how-to-set-up-a-kubernetes-cluster-on-a-vps-a-practical-step-by-step-guide-with-k3s-for-small-deployments\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"K3s on a Single VPS: A Lightweight Kubernetes Cluster for Small Deployments\" \/>\n<meta property=\"og:description\" content=\"K3s on a Single VPS: A Lightweight Kubernetes Cluster for Small Deployments\" \/>\n<meta property=\"og:url\" content=\"https:\/\/virtualserversvps.com\/blog\/how-to-set-up-a-kubernetes-cluster-on-a-vps-a-practical-step-by-step-guide-with-k3s-for-small-deployments\/\" \/>\n<meta property=\"og:site_name\" content=\"Virtual Servers VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-30T02:00:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-08-06T22:18:01+00:00\" \/>\n<meta name=\"author\" content=\"Virtual-Servers-Vps-Editor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Virtual-Servers-Vps-Editor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/how-to-set-up-a-kubernetes-cluster-on-a-vps-a-practical-step-by-step-guide-with-k3s-for-small-deployments\/\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/how-to-set-up-a-kubernetes-cluster-on-a-vps-a-practical-step-by-step-guide-with-k3s-for-small-deployments\/\",\"name\":\"K3s on a Single VPS: A Lightweight Kubernetes Cluster for Small Deployments - Virtual Servers VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#website\"},\"datePublished\":\"2026-07-30T02:00:18+00:00\",\"dateModified\":\"2026-08-06T22:18:01+00:00\",\"author\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0\"},\"breadcrumb\":{\"@id\":\"https:\/\/virtualserversvps.com\/blog\/how-to-set-up-a-kubernetes-cluster-on-a-vps-a-practical-step-by-step-guide-with-k3s-for-small-deployments\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/virtualserversvps.com\/blog\/how-to-set-up-a-kubernetes-cluster-on-a-vps-a-practical-step-by-step-guide-with-k3s-for-small-deployments\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/how-to-set-up-a-kubernetes-cluster-on-a-vps-a-practical-step-by-step-guide-with-k3s-for-small-deployments\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/virtualserversvps.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"K3s on a Single VPS: A Lightweight Kubernetes Cluster for Small Deployments\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#website\",\"url\":\"https:\/\/virtualserversvps.com\/blog\/\",\"name\":\"Virtual Servers VPS Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/virtualserversvps.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0\",\"name\":\"Virtual-Servers-Vps-Editor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g\",\"caption\":\"Virtual-Servers-Vps-Editor\"},\"sameAs\":[\"https:\/\/virtualserversvps.com\/blog\"],\"url\":\"https:\/\/virtualserversvps.com\/blog\/author\/virtualserversvps\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"K3s on a Single VPS: A Lightweight Kubernetes Cluster for Small Deployments - Virtual Servers VPS Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/virtualserversvps.com\/blog\/how-to-set-up-a-kubernetes-cluster-on-a-vps-a-practical-step-by-step-guide-with-k3s-for-small-deployments\/","og_locale":"en_US","og_type":"article","og_title":"K3s on a Single VPS: A Lightweight Kubernetes Cluster for Small Deployments","og_description":"K3s on a Single VPS: A Lightweight Kubernetes Cluster for Small Deployments","og_url":"https:\/\/virtualserversvps.com\/blog\/how-to-set-up-a-kubernetes-cluster-on-a-vps-a-practical-step-by-step-guide-with-k3s-for-small-deployments\/","og_site_name":"Virtual Servers VPS Blog","article_published_time":"2026-07-30T02:00:18+00:00","article_modified_time":"2026-08-06T22:18:01+00:00","author":"Virtual-Servers-Vps-Editor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Virtual-Servers-Vps-Editor","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/virtualserversvps.com\/blog\/how-to-set-up-a-kubernetes-cluster-on-a-vps-a-practical-step-by-step-guide-with-k3s-for-small-deployments\/","url":"https:\/\/virtualserversvps.com\/blog\/how-to-set-up-a-kubernetes-cluster-on-a-vps-a-practical-step-by-step-guide-with-k3s-for-small-deployments\/","name":"K3s on a Single VPS: A Lightweight Kubernetes Cluster for Small Deployments - Virtual Servers VPS Blog","isPartOf":{"@id":"https:\/\/virtualserversvps.com\/blog\/#website"},"datePublished":"2026-07-30T02:00:18+00:00","dateModified":"2026-08-06T22:18:01+00:00","author":{"@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0"},"breadcrumb":{"@id":"https:\/\/virtualserversvps.com\/blog\/how-to-set-up-a-kubernetes-cluster-on-a-vps-a-practical-step-by-step-guide-with-k3s-for-small-deployments\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/virtualserversvps.com\/blog\/how-to-set-up-a-kubernetes-cluster-on-a-vps-a-practical-step-by-step-guide-with-k3s-for-small-deployments\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/virtualserversvps.com\/blog\/how-to-set-up-a-kubernetes-cluster-on-a-vps-a-practical-step-by-step-guide-with-k3s-for-small-deployments\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/virtualserversvps.com\/blog\/"},{"@type":"ListItem","position":2,"name":"K3s on a Single VPS: A Lightweight Kubernetes Cluster for Small Deployments"}]},{"@type":"WebSite","@id":"https:\/\/virtualserversvps.com\/blog\/#website","url":"https:\/\/virtualserversvps.com\/blog\/","name":"Virtual Servers VPS Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/virtualserversvps.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/82a299a8284a66ff49f97c74684724a0","name":"Virtual-Servers-Vps-Editor","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/virtualserversvps.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d820b15f1cd028e97610d9adf536df7be5cb6423869967037d468d5355fa003f?s=96&d=mm&r=g","caption":"Virtual-Servers-Vps-Editor"},"sameAs":["https:\/\/virtualserversvps.com\/blog"],"url":"https:\/\/virtualserversvps.com\/blog\/author\/virtualserversvps\/"}]}},"_links":{"self":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/748","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/comments?post=748"}],"version-history":[{"count":2,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/748\/revisions"}],"predecessor-version":[{"id":811,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/posts\/748\/revisions\/811"}],"wp:attachment":[{"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/media?parent=748"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/categories?post=748"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/virtualserversvps.com\/blog\/wp-json\/wp\/v2\/tags?post=748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}