What is a Machine?
In Uncloud, a machine is any Linux server (VM, bare metal, or cloud instance) that has been added to your cluster. Machines are the compute resources where your containers run. Each machine:- Runs Docker for container execution
- Has the
uncloudddaemon and Corrosion database installed - Gets a unique
/24subnet from the cluster address space - Participates in the WireGuard mesh network
- Maintains a complete copy of cluster state
Unlike Kubernetes nodes, Uncloud machines are completely equal peers. There are no master or worker roles - every machine can accept commands and manage the cluster.
Machine Lifecycle
Initializing the First Machine
When you initialize a new cluster on the first machine:- Install dependencies - Installs Docker if not already present
- Create system user - Creates
unclouduser and group for service isolation - Install binaries - Downloads
unclouddanduncloud-corrosionto/usr/local/bin - Generate keys - Creates WireGuard private/public key pair
- Allocate subnet - Assigns
10.210.0.0/24subnet to the first machine - Configure services - Creates systemd units and starts services
- Setup networking - Configures WireGuard interface and Docker bridge
- Initialize database - Creates Corrosion database with initial cluster state
- Deploy Caddy - Starts Caddy reverse proxy container
- Register cluster domain - Reserves
*.xxxxxx.uncld.devsubdomain
The first machine gets IP
10.210.0.1/24 and becomes the initial entry point in your cluster config at ~/.config/uncloud/.Adding More Machines
To add another machine to your cluster:- A new subnet is allocated (e.g.,
10.210.1.0/24for the second machine) - WireGuard keys are exchanged with existing machines
- The new machine establishes tunnels to existing peers
- Corrosion syncs the complete cluster state to the new machine
- The new machine is added as an alternative entry point in your local config
- Caddy is deployed in global mode, automatically starting on the new machine
The new machine only needs to connect to one existing machine initially. It will learn about all other machines through state synchronization and establish tunnels automatically.
Listing Machines
View all machines in your cluster:- Machine name and state (Up, Down, Unknown)
- Mesh network address (e.g.,
10.210.0.1/24) - Public IP address
- WireGuard endpoints for connectivity
Removing Machines
To remove a machine from the cluster:- Stops all containers running on the machine
- Removes the machine from cluster state
- Other machines remove WireGuard tunnels to it
- Updates are propagated through Corrosion
Subnet Allocation
Uncloud uses a simple subnet allocation scheme within the10.210.0.0/16 address space.
How Subnets are Assigned
Each machine gets a/24 subnet that provides:
- 1 IP for the machine itself (
.1) - 253 IPs for containers (
.2to.254) .0is the network address.255is the broadcast address
- First machine:
10.210.0.0/24(IP:10.210.0.1) - Second machine:
10.210.1.0/24(IP:10.210.1.1) - Third machine:
10.210.2.0/24(IP:10.210.2.1) - And so on…
Container IP Assignment
Containers running on a machine get IPs from that machine’s subnet. For example, on the first machine (10.210.0.0/24):
- First container:
10.210.0.2 - Second container:
10.210.0.3 - Third container:
10.210.0.4 - And so on up to
10.210.0.254
Each machine can run up to 253 containers. This is typically more than sufficient for practical deployments.
Machine Roles and Placement
While all machines are equal peers in the control plane, you can influence where containers run using placement constraints.Service Placement
When deploying services, you can specify which machines should run containers:Global Services
Some services (like Caddy) run in global mode, automatically deploying one container to every machine:Machine State and Health
Machines can be in several states:- Up - Machine is reachable and healthy
- Down - Machine is not responding (offline, network issue, or daemon stopped)
- Unknown - State cannot be determined
If a machine goes down, containers on other machines continue running normally. Services in global mode won’t have a container on the down machine, but other replicas remain available.
Adding Machines Behind NAT
Uncloud works seamlessly with machines behind NAT or firewalls. The WireGuard mesh uses NAT traversal techniques to establish connections. Requirements:- Outbound UDP port 51820 must be allowed
- At least one machine should have a public IP (for initial bootstrapping)
- If all machines are behind NAT, you may need to configure port forwarding
WireGuard uses a 25-second keepalive interval to maintain tunnels through NAT devices and firewalls.
Machine Configuration
Machine configuration is stored in:- Cluster state (Corrosion database) - Machine metadata, IPs, keys
- Local systemd units - Service configuration at
/etc/systemd/system/ - Local config files - WireGuard config, Docker bridge settings
Checking Daemon Status
On any machine, you can check service status:Resource Requirements
Minimum requirements per machine:- OS: Linux (Ubuntu 20.04+, Debian 11+, or similar)
- RAM: 512 MB (1 GB+ recommended)
- CPU: 1 core (2+ recommended)
- Disk: 10 GB (more if running stateful services)
- Network: Outbound UDP port 51820 for WireGuard
Uncloud itself uses about 150 MB of RAM per machine, leaving the rest available for your containers.
Further Reading
Networking
Deep dive into WireGuard mesh and routing
Services
Learn how services are deployed across machines
Machine Management
Add, list, update, and remove machines
Architecture
Understand the overall system design
