Cloud-init builder
Generate a valid #cloud-config for a new Linux server. Everything runs in your browser β nothing you type is sent anywhere.
Users
Files to write
cloud-config.yaml
#cloud-config
hostname: "web-1"
timezone: "UTC"
package_update: true
package_upgrade: true
packages:
- "curl"
- "git"
- "ufw"
- "fail2ban"
users:
- default
- name: "deploy"
shell: "/bin/bash"
groups: ["sudo"]
sudo: "ALL=(ALL) NOPASSWD:ALL"
swap:
filename: "/swapfile"
size: 1073741824
runcmd:
- "ufw default deny incoming"
- "ufw default allow outgoing"
- "ufw allow 22/tcp"
- "ufw allow 80/tcp"
- "ufw allow 443/tcp"
- "ufw --force enable"
- "systemctl enable --now fail2ban"
- ! No SSH key added β you would have to rely on the default user and password.
- ! SSH (22/tcp) is always kept open when the firewall is enabled.
Using it
How to apply this configuration
Paste the YAML as user data wherever your provider or hypervisor accepts cloud-init. cloud-init applies it on the first boot of a fresh image.
On a bashrack VPS, ordering lets you set the SSH keys, username and password (the same keys and user as above). The order form doesn't take arbitrary user data, so apply the rest β packages, swap, firewall, fail2ban and your commands β by running the equivalent commands over SSH once the server is up, or use one of the deploy guides.
Not sure how big the server should be? Try the VPS size advisor.