WireGuard VPN on Aruba Cloud
Deploy a production-ready WireGuard VPN server on Aruba Cloud. All configuration is handled by cloud-init — no manual SSH required after deployment.
Provider version: arubacloud/arubacloud
~> 1.0| Terraform: ≥ 1.9
Introduction
WireGuard is a modern, high-performance VPN protocol built into the Linux kernel. It is simpler, faster, and more secure than OpenVPN or IPsec. This example deploys a WireGuard server that your devices can connect to for encrypted internet access or private network tunneling.
Common use cases:
- Secure remote access to your Aruba Cloud VMs without exposing extra ports
- Route all device traffic through a trusted Aruba Cloud IP
- Split-tunnel access to private VPC resources
Architecture Overview
A single CloudServer VM runs the wg-quick@wg0 systemd service. The WireGuard server keys are generated on first boot by cloud-init. Clients connect over UDP 51820. SSH is restricted to your admin IP; no HTTP/HTTPS ports are opened.
Infrastructure Created
| Resource | Name pattern | Description |
|---|---|---|
arubacloud_project | wg-prod | Project container |
arubacloud_vpc | wg-prod-vpc | Virtual Private Cloud |
arubacloud_subnet | wg-prod-subnet | Basic subnet |
arubacloud_securitygroup | wg-prod-vm-sg | VM security group |
arubacloud_securityrule | wg-prod-vm-ssh | SSH ingress (admin CIDR) |
arubacloud_securityrule | wg-prod-wg-udp | WireGuard UDP ingress |
arubacloud_elasticip | wg-prod-vm-eip | VM public IP |
arubacloud_blockstorage | wg-prod-boot | 20 GB boot disk |
arubacloud_keypair | wg-prod-keypair | SSH public key |
arubacloud_cloudserver | wg-prod-vm | WireGuard VM |
VM Sizing Recommendation
| Use case | vCPU | RAM | Disk | Flavor |
|---|---|---|---|---|
| Personal VPN | 1–2 | 2–4 GB | 20 GB | CSO2A4 (default) |
| Team VPN (10–50 users) | 2 | 4 GB | 20 GB | CSO2A4 |
| High-throughput | 4 | 8 GB | 20 GB | CSO4A8 |
WireGuard is extremely CPU-efficient — a CSO2A4 VM comfortably handles 50+ concurrent clients.
Estimated Monthly Cost
| Resource | Spec | Est. cost/mo |
|---|---|---|
| CloudServer VM | CSO2A4 — 2 vCPU / 4 GB | ~€20 |
| Boot disk | 20 GB Performance | ~€3 |
| Elastic IP | — | ~€5 |
| Total | ~€28/mo |
Requirements
- Terraform ≥ 1.9
- ArubaCloud Terraform Provider
~> 1.0 - ArubaCloud account with OAuth2 credentials
- An SSH key pair