Skip to main content
Deploy a simple static website on a Vers VM using nginx. You’ll create a VM, install nginx, write an HTML page, and see it live — all in a few minutes.

Prerequisites

Step 1: Create the project

Create a new folder for your project if you don’t already have one.
mkdir static-site
cd static-site
vers init

Step 2: Launch the VM

vers run --vm-alias static-site
Verify it’s running:
vers status
You should see your VM in a Running state.

Step 3: Connect and install nginx

vers connect
Inside the VM:
# Set up DNS for outbound internet access
echo 'nameserver 8.8.8.8' > /etc/resolv.conf

# Install nginx
apt-get update && apt-get install -y nginx

Step 4: Create your static site

Still inside the VM, replace the default nginx page with your own HTML:
cat > /var/www/html/index.html << 'EOF'
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>My Vers Site</title>
  <style>
    * { margin: 0; padding: 0; box-sizing: border-box; }
    body {
      font-family: system-ui, -apple-system, sans-serif;
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 100vh;
      background: #0a0a0a;
      color: #fafafa;
    }
    .container {
      text-align: center;
      padding: 2rem;
    }
    h1 { font-size: 3rem; margin-bottom: 1rem; }
    p { font-size: 1.25rem; color: #888; }
  </style>
</head>
<body>
  <div class="container">
    <h1>Hello from Vers</h1>
    <p>This static site is running on a Vers VM with nginx.</p>
  </div>
</body>
</html>
EOF

Step 5: Start nginx and verify

# Start nginx
systemctl start nginx

# Verify it's serving your page
curl -s http://localhost | head -5
You should see the first few lines of your HTML. Now exit the VM:
exit

Step 6: View it in your browser

Your site is live at:
https://<vm-id>.vm.vers.sh
Replace <vm-id> with your VM’s ID (shown in vers status). Vers terminates TLS at the proxy, so your VM serves plain HTTP but browsers see HTTPS — no cert setup needed.
If your VM ID is vm-abc123, the URL would be https://vm-abc123.vm.vers.sh. Port 80 is one of the default routed ports.

Step 7: Make a change

Connect back to the VM and update the page:
vers connect
sed -i 's/Hello from Vers/My Static Site is Live/' /var/www/html/index.html
Refresh your browser — the change is instant. No build step, no deploy pipeline. Exit when done:
exit

What you learned

  • Creating a Vers VM and connecting via SSH
  • Installing and running nginx inside a VM
  • Serving a static HTML page accessible over HTTPS
  • Making live edits to a running site

Next steps