{"id":1869,"date":"2026-09-05T09:35:45","date_gmt":"2026-09-05T04:05:45","guid":{"rendered":"https:\/\/cpanelfree.com\/blog\/how-to-setup-lightweight-kubernetes-k3s-ubuntu-vps\/"},"modified":"2026-09-05T12:58:27","modified_gmt":"2026-09-05T07:28:27","slug":"how-to-setup-lightweight-kubernetes-k3s-ubuntu-vps","status":"publish","type":"post","link":"https:\/\/cpanelfree.com\/blog\/how-to-setup-lightweight-kubernetes-k3s-ubuntu-vps\/","title":{"rendered":"How to Set Up Lightweight Kubernetes (K3s) on a Budget Linux Cloud VPS"},"content":{"rendered":"<h2>Demystifying Kubernetes: Why Standard K8s Fails on Budget VPS<\/h2>\n<p>Full enterprise Kubernetes distributions (such as kubeadm, OpenShift, or EKS) are designed for massive multi-node corporate data centers. Running standard Kubernetes requires separate control plane nodes, dedicated etcd clusters, extensive overlay networking daemons, and at least 4GB to 8GB of idle RAM just to bootstrap the control plane before launching a single application pod.<\/p>\n<p><strong>K3s<\/strong> is a fully compliant, certified CNCF lightweight Kubernetes distribution created by Rancher Labs (SUSE). By packaging the control plane, Kubelet, Flannel CNI, CoreDNS, local path storage provisioners, and Traefik ingress controller into a <strong>single lightweight 100MB binary<\/strong>, K3s reduces memory consumption to under 512MB RAM. This enables developers and DevOps engineers to run production Kubernetes clusters, GitOps pipelines, and microservices on an affordable $4\u2013$10\/month cloud VPS.<\/p>\n<p>In this comprehensive hands-on tutorial, we will install K3s on Ubuntu 24.04\/22.04 LTS, configure <code>kubectl<\/code> management on local workstations, deploy containerized microservice deployments with PersistentVolumeClaims, and configure automated Traefik ingress routing with SSL.<\/p>\n<h2>Step 1: Installing K3s Control Plane on Ubuntu VPS<\/h2>\n<p>Installing K3s requires only a single official curl execution script that configures systemd daemons and network bridges automatically:<\/p>\n<pre><code># Update package list and install curl\nsudo apt update &amp;&amp; sudo apt install -y curl\n\n# Install K3s control plane with Traefik enabled\ncurl -sfL https:\/\/get.k3s.io | sh -\n\n# Verify K3s systemd service status\nsudo systemctl status k3s --no-pager\n\n# Confirm node readiness via kubectl\nsudo k3s kubectl get nodes<\/code><\/pre>\n<h2>Step 2: Configuring kubectl Access for Unprivileged Users &amp; Remote Laptops<\/h2>\n<p>By default, K3s stores its kubeconfig at <code>\/etc\/rancher\/k3s\/k3s.yaml<\/code> with restricted root permissions. Grant access to your standard user account:<\/p>\n<pre><code># Create local kube configuration directory\nmkdir -p ~\/.kube\nsudo cp \/etc\/rancher\/k3s\/k3s.yaml ~\/.kube\/config\nsudo chown $(id -u):$(id -g) ~\/.kube\/config\nchmod 600 ~\/.kube\/config\n\n# Verify kubectl command works without sudo\nkubectl get pods -A<\/code><\/pre>\n<p>To manage your K3s cluster from your local desktop laptop, copy <code>~\/.kube\/config<\/code> to your computer and replace <code>127.0.0.1<\/code> with your VPS server&#8217;s public IPv4 address.<\/p>\n<h2>Step 3: Deploying a Scalable Web Application with Deployment &amp; Service<\/h2>\n<p>Create a production deployment manifest <code>webapp.yaml<\/code> running 3 replicated Nginx web app pods with an internal ClusterIP service:<\/p>\n<pre><code>apiVersion: apps\/v1\nkind: Deployment\nmetadata:\n  name: web-app-deployment\n  labels:\n    app: web-app\nspec:\n  replicas: 3\n  selector:\n    matchLabels:\n      app: web-app\n  template:\n    metadata:\n      labels:\n        app: web-app\n    spec:\n      containers:\n      - name: nginx-web\n        image: nginx:alpine\n        ports:\n        - containerPort: 80\n        resources:\n          limits:\n            memory: \"64Mi\"\n            cpu: \"250m\"\n---\napiVersion: v1\nkind: Service\nmetadata:\n  name: web-app-service\nspec:\n  selector:\n    app: web-app\n  ports:\n  - protocol: TCP\n    port: 80\n    targetPort: 80<\/code><\/pre>\n<p>Apply the manifest to the cluster:<\/p>\n<pre><code>kubectl apply -f webapp.yaml\nkubectl get pods -l app=web-app<\/code><\/pre>\n<h2>Step 4: Exposing Microservices via Traefik Ingress Controller<\/h2>\n<p>K3s includes the Traefik Ingress controller out of the box. Create <code>ingress.yaml<\/code> to route public HTTP traffic from your domain to the internal service:<\/p>\n<pre><code>apiVersion: networking.k8s.io\/v1\nkind: Ingress\nmetadata:\n  name: web-app-ingress\n  annotations:\n    ingress.class: traefik\nspec:\n  rules:\n  - host: k8s.example.com\n    http:\n      paths:\n      - path: \/\n        pathType: Prefix\n        backend:\n          service:\n            name: web-app-service\n            port:\n              number: 80<\/code><\/pre>\n<p>Deploy the ingress router:<\/p>\n<pre><code>kubectl apply -f ingress.yaml<\/code><\/pre>\n<h2>Step 5: Installing Helm 3 Package Manager for Kubernetes<\/h2>\n<p>Helm simplifies deploying complex enterprise applications (such as Redis, PostgreSQL, WordPress, or Prometheus) using pre-packaged charts:<\/p>\n<pre><code># Download and install Helm 3 binary\ncurl https:\/\/raw.githubusercontent.com\/helm\/helm\/main\/scripts\/get-helm-3 | bash\n\n# Add Bitnami official chart repository\nhelm repo add bitnami https:\/\/charts.bitnami.com\/bitnami\nhelm repo update\n\n# Install a production-ready Redis cluster via Helm in 10 seconds\nhelm install my-redis bitnami\/redis --set auth.password=\"StrongRedisPass2026!\"<\/code><\/pre>\n<h2>Standard Kubernetes (K8s) vs Lightweight K3s Benchmark<\/h2>\n<table style=\"width: 100%;border-collapse: collapse;margin: 20px 0;border: 1px solid #334155\">\n<thead>\n<tr style=\"background-color: #0f172a;color: #38bdf8\">\n<th style=\"padding: 12px;border: 1px solid #334155\">Feature \/ Metric<\/th>\n<th style=\"padding: 12px;border: 1px solid #334155\">Lightweight K3s (Rancher)<\/th>\n<th style=\"padding: 12px;border: 1px solid #334155\">Standard Kubernetes (K8s \/ EKS)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background-color: #1e293b;color: #f8fafc\">\n<td style=\"padding: 10px;border: 1px solid #334155\"><strong>Idle RAM Consumption<\/strong><\/td>\n<td style=\"padding: 10px;border: 1px solid #334155\"><strong>~350 MB to 512 MB<\/strong><\/td>\n<td style=\"padding: 10px;border: 1px solid #334155\">~3.5 GB to 6.0 GB<\/td>\n<\/tr>\n<tr style=\"background-color: #0f172a;color: #f8fafc\">\n<td style=\"padding: 10px;border: 1px solid #334155\"><strong>Installation Complexity<\/strong><\/td>\n<td style=\"padding: 10px;border: 1px solid #334155\"><strong>1 Single Command (30 seconds)<\/strong><\/td>\n<td style=\"padding: 10px;border: 1px solid #334155\">Multi-step manual node bootstrapping<\/td>\n<\/tr>\n<tr style=\"background-color: #1e293b;color: #f8fafc\">\n<td style=\"padding: 10px;border: 1px solid #334155\"><strong>Included Ingress &amp; Storage<\/strong><\/td>\n<td style=\"padding: 10px;border: 1px solid #334155\"><strong>Pre-packaged Traefik &amp; Local Path<\/strong><\/td>\n<td style=\"padding: 10px;border: 1px solid #334155\">Requires separate manual installs<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Deploying Persistent Volume Storage with Local-Path Provisioner<\/h2>\n<p>K3s includes Rancher&#8217;s lightweight <code>local-path<\/code> storage class by default, allowing containerized stateful workloads (such as MySQL, PostgreSQL, or Redis) to dynamically request persistent host disk storage without requiring complex external SAN\/NFS arrays:<\/p>\n<pre><code>apiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n  name: database-pvc\nspec:\n  accessModes:\n    - ReadWriteOnce\n  storageClassName: local-path\n  resources:\n    requests:\n      storage: 10Gi<\/code><\/pre>\n<h2>Automating Application Scaling with Horizontal Pod Autoscaler (HPA)<\/h2>\n<p>K3s includes the lightweight metrics-server out of the box. Automatically scale pod replicas up to 10 when CPU utilization exceeds 75%:<\/p>\n<pre><code># Enable Horizontal Pod Autoscaling on web-app-deployment\nkubectl autoscale deployment web-app-deployment --cpu-percent=75 --min=2 --max=10\n\n# Inspect active autoscaler metrics\nkubectl get hpa<\/code><\/pre>\n<h2>Essential K3s Operational Commands Cheat Sheet<\/h2>\n<ul>\n<li><code>kubectl get pods -A -o wide<\/code>: View all running pods, container IPs, and host node bindings.<\/li>\n<li><code>kubectl logs -f deployment\/web-app-deployment<\/code>: Stream real-time container log output across all pod replicas.<\/li>\n<li><code>kubectl top nodes &amp;&amp; kubectl top pods<\/code>: Inspect exact real-time CPU and memory consumption per pod.<\/li>\n<\/ul>\n<div style=\"background-color: #0f172a;border-left: 4px solid #38bdf8;padding: 18px 24px;margin: 30px 0;border-radius: 8px\">\n<h3 style=\"color: #38bdf8;margin-top: 0\">Recommended Related Technical Guides<\/h3>\n<ul style=\"margin-bottom: 0;color: #cbd5e1\">\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/how-to-run-docker-docker-compose-cheap-linux-vps\/\" style=\"color: #38bdf8;text-decoration: underline\">Running Docker and Docker Compose on Cheap Linux VPS<\/a><\/li>\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/how-to-setup-grafana-prometheus-server-monitoring-vps\/\" style=\"color: #38bdf8;text-decoration: underline\">Setting Up Prometheus and Grafana Monitoring on Linux VPS<\/a><\/li>\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/how-to-automate-git-deployment-github-actions-vps\/\" style=\"color: #38bdf8;text-decoration: underline\">Automating CI\/CD Deployments with GitHub Actions<\/a><\/li>\n<\/ul>\n<\/div>\n<div style=\"background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);color: #ffffff;padding: 28px;border-radius: 12px;margin: 35px 0;text-align: center\">\n<h3 style=\"color: #ffffff;margin-top: 0;font-size: 22px\">Deploy High-Performance Kubernetes Nodes on CpanelFree<\/h3>\n<p style=\"color: #e0f2fe;font-size: 15px;max-width: 650px;margin: 0 auto 18px auto\">Orchestrate microservices and container clusters with dedicated enterprise CPU cores, NVMe storage, and 100% free hosting options.<\/p>\n<p>  <a href=\"https:\/\/cpanelfree.com\/\" style=\"background-color: #ffffff;color: #0284c7;font-weight: 700;padding: 12px 28px;border-radius: 8px;text-decoration: none;display: inline-block\">Get Free Cloud Hosting Today &rarr;<\/a>\n<\/div>\n<div style=\"border-left: 4px solid #38bdf8;border-radius: 8px;padding: 20px;margin: 30px 0\">\n<h3 style=\"margin-top: 0;color: #38bdf8;font-size: 18px;display: flex;align-items: center\">\n        <span style=\"margin-right: 8px\">\ud83d\udd17<\/span> Recommended Related Technical Guides:<br \/>\n    <\/h3>\n<ul style=\"margin: 10px 0 0 0;padding-left: 20px;line-height: 1.8\">\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/how-to-get-free-cloud-vps-forever\/\" style=\"color: #38bdf8;text-decoration: none;font-weight: 600\">How to Get a Free Cloud VPS Forever (Oracle, Google Cloud, AWS Free Tier)<\/a><\/li>\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/oracle-cloud-always-free-vps-setup-guide\/\" style=\"color: #38bdf8;text-decoration: none;font-weight: 600\">Oracle Cloud Always Free VPS: Step-by-Step Setup &amp; ARM Ampere Guide<\/a><\/li>\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/best-cheap-cloud-vps-providers\/\" style=\"color: #38bdf8;text-decoration: none;font-weight: 600\">Top 7 Best Cheap Cloud VPS Providers in 2026 (Under $5\/Month)<\/a><\/li>\n<li><a href=\"https:\/\/cpanelfree.com\/blog\/how-to-host-forgejo-gitea-private-git-server-vps\/\" style=\"color: #38bdf8;text-decoration: none;font-weight: 600\">How to Self-Host Forgejo &amp; Gitea Lightweight Private Git Server on Ubuntu VPS<\/a><\/li>\n<li><a href=\"https:\/\/cpanelfree.com\/#plans\" style=\"color: #10b981;text-decoration: none;font-weight: 600\">Explore $0 Free cPanel Web Hosting Plans (NVMe SSD, AutoSSL)<\/a><\/li>\n<\/ul>\n<\/div>\n<div style=\"background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(59, 130, 246, 0.15) 100%);border-radius: 12px;padding: 25px;margin: 30px 0;text-align: center\">\n<h3 style=\"color: #38bdf8;margin-top: 0;font-size: 20px\">Deploy Fast, Reliable Web Hosting on CpanelFree<\/h3>\n<p style=\"color: #94a3b8;font-size: 14px;line-height: 1.6;max-width: 600px;margin: 0 auto 15px\">\n        Get genuine cPanel control, unmetered NVMe SSD storage, and free AutoSSL at $0 cost forever.\n    <\/p>\n<p>    <a href=\"https:\/\/cpanelfree.com\/#plans\" style=\"display: inline-block;background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);color: #ffffff;padding: 10px 22px;border-radius: 6px;text-decoration: none;font-weight: bold;font-size: 14px\">Claim Free Hosting Account<\/a>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Demystifying Kubernetes: Why Standard K8s Fails on Budget VPS Full enterprise Kubernetes distributions (such as kubeadm, OpenShift, or EKS) are designed for massive multi-node corporate data centers. Running standard Kubernetes requires separate control plane nodes, dedicated etcd clusters, extensive overlay networking daemons, and at least 4GB to 8GB of idle RAM just to bootstrap the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2501,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[88],"tags":[],"class_list":["post-1869","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud-vps"],"_links":{"self":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts\/1869","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/comments?post=1869"}],"version-history":[{"count":2,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts\/1869\/revisions"}],"predecessor-version":[{"id":2301,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts\/1869\/revisions\/2301"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/media\/2501"}],"wp:attachment":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/media?parent=1869"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/categories?post=1869"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/tags?post=1869"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}