Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk10 min

How to Set Up a K3s Kubernetes Cluster on an Ubuntu VPS

Build a working K3s cluster on Ubuntu VPS instances. This guide covers unique hostnames, resource minimums, firewall ports, server installation, K3S_URL and K3S_TOKEN agent joins, kubectl verification, and common failures.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To build a working K3s cluster on Ubuntu, prepare one or more VPS instances with unique hostnames, install K3s on one machine as the server, copy its node token, and run the installer on each additional machine with K3S_URL and K3S_TOKEN. Finish by running kubectl get nodes on the server and confirming that every machine is Ready.

This guide covers a single-node cluster and a server-plus-agent cluster. It uses the K3s installation method documented for Ubuntu, while clearly separating official minimum resources from higher practical recommendations.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What you are building

K3s is a lightweight Kubernetes distribution designed to run a Kubernetes control plane and workloads with fewer operating-system and memory requirements than a conventional full distribution. In a basic installation, one VPS runs the K3s server. That server provides the Kubernetes API and, when no agents are added, can also schedule workloads itself.

The K3s documentation describes a single-node server installation as a fully functional Kubernetes cluster. Adding agents gives you separate worker nodes, but it does not turn a small VPS into a highly available control plane. High availability requires multiple server nodes and additional design work, including embedded etcd networking.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

The procedure below assumes freshly provisioned Ubuntu LTS VPS instances and shell access with root privileges or an account that can use sudo. The same commands are suitable for Ubuntu 24.04 K3s deployments, provided the VPS image and provider kernel support the required networking features.

Before you install: requirements and planning

Choose the cluster shape

  • Single-node test cluster: one VPS runs the server and workloads. It is the shortest path to a working cluster and is suitable for learning, development, and small experiments.
  • Server plus agents: one VPS runs the server and one or more additional VPS instances run agents. The server remains the point where you administer the cluster; workloads can be scheduled on agents.
  • Multiple servers for high availability: this is a different architecture. Server-to-server etcd ports and a stable endpoint must be planned before installation. Do not treat several independent single-node installations as one HA cluster.

Operating system and privileges

Use an Ubuntu LTS image on every node. You need root access or a user that can run the installer and read files under /var/lib/rancher/k3s with sudo. Perform operating-system updates, SSH hardening, and provider-level access controls according to your environment before exposing the Kubernetes API.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Give every node a unique hostname

K3s requires each machine to have a unique hostname. Check the current value with:

hostnamectl

If two VPS instances have the same hostname, cluster membership can be corrupted or nodes can appear to replace one another. Correct the name before installing K3s. For example:

sudo hostnamectl set-hostname k3s-server
sudo reboot

Use a different value, such as k3s-agent-1, on each agent. If changing the operating-system hostname is not possible, set a unique K3S_NODE_NAME for each node when installing it. The value must be unique within this cluster.

CPU and memory minimums

The published K3s configuration minimums are:

Node role CPU minimum RAM minimum What the figure excludes
Server 2 cores 2 GB Memory and CPU consumed by Kubernetes workloads, logging, storage, and monitoring
Agent 1 core 512 MB Memory and CPU consumed by workloads scheduled on the agent

These are minimum configuration values, not a promise that every workload will run well. A third-party Ubuntu 24.04 guide recommends about 4 GB of RAM for a practical single-node test setup. Treat that as a recommendation for headroom, not as an official K3s requirement. A cluster running a database, an ingress controller, metrics, or several application containers can need considerably more capacity.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Network reachability and required ports

Open only the traffic your design needs, at both the VPS provider firewall and the host firewall if one is enabled. The following ports are the important K3s paths:

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
Port Protocol Direction and purpose When it is needed
6443 TCP Kubernetes API server; all nodes must be able to reach the server Always required for a server-and-agent cluster
8472 UDP Flannel VXLAN traffic between nodes Required when using the default Flannel VXLAN backend
10250 TCP Kubelet metrics and related node communication Needed when metrics-server is used
51820 UDP Flannel WireGuard backend traffic Optional; use if you select the WireGuard backend
51821 UDP Additional Flannel WireGuard backend traffic Optional; use if you select the WireGuard backend
2379-2380 TCP Embedded etcd communication between server nodes Only for an HA embedded-etcd design; not required for a single server
5001 and 6443 TCP Embedded registry mirror traffic Only when the embedded registry mirror is enabled

K3s uses reverse tunnelling, so agents initiate outbound connections to the server. You generally do not need to open an inbound API port on every agent. You do, however, need node-to-node networking for the selected CNI backend, including UDP 8472 when the default VXLAN backend is in use.

A third-party Ubuntu 24.04 guide reports that UFW is not enabled by default on its systems. That is not a guarantee for every VPS image: check your own host with sudo ufw status and inspect the provider firewall. If UFW or another firewall is active, allow the required traffic deliberately rather than assuming the default policy is safe.

K3s quick start: install a single-node cluster

1. Connect to the server VPS

SSH to the VPS that will run the K3s server. Confirm the hostname, available resources, and that outbound HTTPS access works. The installer is downloaded over HTTPS, so a restrictive egress policy can prevent installation.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Run the K3s server installer

Execute the official installation script as root, or through sudo:

curl -sfL https://get.k3s.io | sh -

The script installs the K3s binary at /usr/local/bin/k3s, creates a systemd unit named k3s, and starts the service. The command does not pin a version in this form; check the current K3s documentation and stable channel before using it in a production build. Channel names and installer flags can change over time.

3. Check the service

Confirm that systemd considers the service running:

sudo systemctl status k3s --no-pager

If it is not active, view the recent log entries:

sudo journalctl -u k3s -n 100 --no-pager

Do not proceed to agents until the server starts cleanly. Common early causes are a hostname collision, blocked networking, insufficient memory, or a partially completed previous installation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

4. Verify the single-node cluster

On the server, run:

sudo kubectl get nodes

The output should show the server node with a Ready status. A single server is already a complete cluster; no agent is required for the Kubernetes API or for scheduling basic workloads.

Install server agent cluster: add worker nodes

1. Read the node-token on the server

K3s writes the token used to authenticate joining nodes to:

sudo cat /var/lib/rancher/k3s/server/node-token

Copy the complete value exactly. Treat it like a credential: do not put it in a public repository, shell history that other users can read, or an unprotected ticket. If the token is exposed, follow your operational process for rotating or replacing cluster credentials rather than continuing to distribute it.

2. Prepare each agent VPS

On every agent, set a unique hostname and verify that the agent can reach the server’s address on TCP 6443. Also verify the node-to-node path required by your networking backend. If the VPS provider assigns private addresses, prefer the address that is routable from every node and is permitted by the provider’s network policy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Install the agent with K3S_URL and K3S_TOKEN

Run this on each agent, replacing the placeholders with the server address and the token read in the previous step:

curl -sfL https://get.k3s.io | K3S_URL=https://<server-ip>:6443 K3S_TOKEN=<token> sh -

K3S_URL is the setting that tells the installer to configure an agent instead of another server. K3S_TOKEN authenticates the join request. Do not include angle brackets in the actual command; they indicate values you must supply.

If you cannot or do not want to change the operating-system hostname, provide a unique node name as well:

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
curl -sfL https://get.k3s.io | K3S_URL=https://<server-ip>:6443 K3S_TOKEN=<token> K3S_NODE_NAME=<unique-name> sh -

Each agent installation creates and starts its own systemd service. Check it with:

sudo systemctl status k3s-agent --no-pager

4. Confirm every node from the server

Return to the server and run:

sudo kubectl get nodes -o wide

Each joined machine should appear as a separate node and eventually reach Ready. The wider output is useful for seeing the node address and operating-system details while diagnosing connectivity.

kubectl access and the first verification checks

K3s supplies a kubectl-compatible command through the k3s kubectl wrapper. The server installation also makes kubectl available in the standard setup used by the installer. If an unprivileged account cannot read the cluster configuration, use sudo kubectl or configure access according to your organization’s kubeconfig policy rather than changing file permissions blindly.

Use these checks after the nodes become ready:

  1. List nodes: sudo kubectl get nodes. Every expected node should be present and Ready.
  2. List system pods: sudo kubectl get pods -A. This shows whether K3s’s networking and other system components are starting.
  3. Inspect a node that is not ready: sudo kubectl describe node <node-name>. Look at conditions and recent events.
  4. Read server logs: sudo journalctl -u k3s -n 100 --no-pager.
  5. Read agent logs on a worker: sudo journalctl -u k3s-agent -n 100 --no-pager.

Use the commands from the server for cluster-wide inspection. An agent’s local service status can be healthy even when a firewall prevents it from completing registration or networking with other nodes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting a node that will not join

The node never appears

  • Confirm the agent service is installed and running with sudo systemctl status k3s-agent.
  • Check that K3S_URL points to the correct server address and includes port 6443.
  • Test TCP reachability from the agent to the server using the network tools available on your image, and inspect both provider and host firewall rules.
  • Read the agent journal for token, certificate, DNS, or connection errors.

The node appears but remains NotReady

A node can register with the API and still fail to become ready if its overlay network cannot communicate. Recheck UDP 8472 for the default Flannel VXLAN backend, or the WireGuard ports if you selected that backend. Confirm that every node can reach the addresses K3s advertises, rather than only the server’s public SSH address.

Two nodes seem to overwrite each other

Stop and correct the hostname collision. Every machine must have a unique hostname, or a unique K3S_NODE_NAME. Remove and reinstall the affected node only after recording what workloads and data it carries; deleting cluster state casually can create a larger recovery problem.

The server runs out of memory

The published minimum is not a workload budget. Stop unnecessary test workloads, inspect memory consumption on the VPS, and resize the server if the control plane and applications compete for RAM. A practical single-node test recommendation of about 4 GB RAM provides more headroom than the official 2 GB server minimum, but application requirements should determine the final size.

UFW blocks traffic

Check the actual firewall state rather than relying on the default of a particular image:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo ufw status verbose

If it is active, add rules that match your topology for TCP 6443, the required node-to-node overlay traffic, and any optional metrics, WireGuard, etcd, or registry ports you intentionally use. Keep administrative SSH access available while changing rules, and verify from a second session.

Version, upgrades, and production boundaries

The one-line installer tracks the channel selected by the installer environment and can change as K3s releases change. Before pinning a version or automating installation, consult the current K3s documentation for the stable channel, supported Ubuntu releases, installer variables, and upgrade procedure. Do not infer current version numbers or flags from an older tutorial.

For a production cluster, decide how you will back up application data and cluster state, patch Ubuntu, rotate credentials, monitor disk and memory, and recover a failed VPS. A single-node cluster has a single control-plane failure domain. Agents improve workload placement options but do not provide control-plane availability.

Practical deployment checklist

  • Every VPS runs an Ubuntu LTS image and has root or sudo access.
  • Every node has a unique hostname, or a unique K3S_NODE_NAME.
  • The server has at least 2 CPU cores and 2 GB RAM; each agent has at least 1 core and 512 MB RAM, excluding workload usage.
  • Around 4 GB RAM is considered a practical third-party recommendation for a single-node Ubuntu 24.04 test, not an official minimum.
  • TCP 6443 is reachable by all nodes.
  • UDP 8472 is open between nodes when using the default Flannel VXLAN backend.
  • Metrics, WireGuard, embedded etcd, and registry ports are opened only when those features are enabled.
  • The server installer completed and the k3s service is active.
  • The token was read from /var/lib/rancher/k3s/server/node-token and protected.
  • Each agent was installed with the correct K3S_URL and K3S_TOKEN.
  • kubectl get nodes on the server lists every expected node as Ready.

What success looks like

A successful first deployment is not defined by the installer returning without an error. It is defined by the server service running, agents registering with unique identities, the overlay network passing traffic, and kubectl get nodes showing the intended inventory in Ready state. Start with one server, verify that single-node cluster, then add agents one at a time so a hostname, firewall, token, or routing mistake is easy to isolate.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Can I use one Ubuntu VPS for a complete K3s cluster?

Yes. A single K3s server is a fully functional cluster and can run workloads without an agent. It still has one control-plane and one VPS failure domain.

Where is the K3s agent join token?

On the server, read /var/lib/rancher/k3s/server/node-token with sudo cat. Protect the value and pass it to the agent installer through K3S_TOKEN.

Which ports must be open for a basic K3s installation?

TCP 6443 must be reachable from nodes to the server, and UDP 8472 must pass between nodes when the default Flannel VXLAN backend is used. Other ports depend on metrics, WireGuard, embedded etcd, or registry features.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.