Ratel Docs
Self-host

Deploy to your cloud

Create a VM with Ratel on AWS, Google Cloud, Azure, DigitalOcean or Hetzner, with deploy.sh or a one-click button.

One command from your laptop

curl -fsSL https://raw.githubusercontent.com/ratel-ai/ratel/main/deploy.sh | sh

deploy.sh finds the cloud you are logged in to. With several, it asks, or takes --cloud.

CloudHow it finds your login
AWSaws sts get-caller-identity
Google CloudThe account and project of gcloud
Azureaz account show
DigitalOceanDIGITALOCEAN_TOKEN or doctl
HetznerHCLOUD_TOKEN or hcloud

It uses OpenTofu (tofu), or Terraform when OpenTofu is not installed. It creates:

  • One Ubuntu 24.04 LTS VM with 2 vCPU or more, 8 GB of RAM and 30 GB of disk or more.
  • A firewall, a static IP and a dedicated SSH key.

It shows the plan and a rough monthly cost per size, and asks before it creates anything. Then it runs the installer on the VM and prints how to open the console. The modules are in deploy/terraform/.

Access modes

  • --access public (default): Caddy with TLS and a login. Ports 80 and 443 are open to all, or only to the --allow-cidr ranges (for example a VPN). With --allow-cidr, Caddy uses its own CA, because Let's Encrypt cannot reach port 80. SSH is open only to your current IP. The certificate is for --domain, or for <ip>.sslip.io with no domain. The login password is printed once, and stays only on your laptop, in ~/.ratel/deploy/<name>/login.
  • --access private: no web port. SSH is open to your current IP and the --allow-cidr ranges. Reach the console through a tunnel:
ssh -i ~/.ratel/deploy/ratel/id_ed25519 -N -L 3000:127.0.0.1:3000 ratel@<ip>

Options

Pass them after sh -s --:

OptionWhat it does
--cloudaws, gcp, azure, digitalocean or hetzner.
--region, --sizeWhere the VM runs and how big it is.
--nameDefault ratel. Use one per deploy, for more than one.
--version, --refPassed to install.sh. Default: the latest release.
--domain, --allow-cidrSee Access modes.
--iac terraform|tofuForce Terraform or OpenTofu.
--yesAsk nothing.

Status, upgrade and destroy

The state, the SSH key and the password stay on your laptop in ~/.ratel/deploy/<name>/ (owner-only). The other commands need no flags:

curl -fsSL https://raw.githubusercontent.com/ratel-ai/ratel/main/deploy.sh | sh -s -- status
curl -fsSL https://raw.githubusercontent.com/ratel-ai/ratel/main/deploy.sh | sh -s -- up   # upgrade to the latest release
curl -fsSL https://raw.githubusercontent.com/ratel-ai/ratel/main/deploy.sh | sh -s -- destroy
  • up on an existing deploy reruns install.sh on the VM over SSH, with --version or the latest release. A deploy made with --ref <branch> stays on that branch. If your IP changed, it first opens SSH to the new one.
  • destroy deletes the VM, its disk with all Ratel data and its IP, then the local state. Back up first.

One-click deploy

Each button opens your cloud's console with Ratel's template, in your account. Nothing is created until you confirm there.

The VM runs install.sh, as deploy.sh does. Pick the public mode (Caddy with TLS and a login for user ratel, with the password that you type) or the private mode (no web port, an SSH tunnel). The template's version parameter (default latest) sets the release. Its ref parameter builds a branch or commit from source instead.

CloudButtonWhat it opens
AWSLaunch StackCloudFormation quick-create, with deploy/cloudformation/ratel.yaml (default VPC, t3.large, Elastic IP)
AzureDeploy to AzureA custom deployment, with deploy/azure/azuredeploy.json (its own network, Standard_B2ms, static IP)
Google CloudOpen in Cloud ShellCloud Shell, with a tutorial that runs ./deploy.sh up --cloud gcp

The password is in the user data of the VM (AWS) or in its custom data (Azure), base64-encoded. Anyone who can read the VM's configuration in your account can read it. Use deploy.sh when that matters: it gives the VM only the hash.

On this page