Skip to main content
Deploy a simple API backend on a Vers VM using Python and FastAPI. You’ll create a VM, install dependencies, write an app, and see it respond to requests — 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.

Step 2: Launch the VM

Verify it’s running:
You should see your VM in a Running state.

Step 3: Connect and install dependencies

Inside the VM:

Step 4: Write the app

Still inside the VM, create a simple API:

Step 5: Start the server and verify

You should see JSON responses:
Now exit the VM:

Step 6: View it in your browser

Your API is live at:
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. FastAPI also gives you interactive API docs for free:
Port 8000 is one of the default routed ports. Make sure your server binds to :: (dual-stack) rather than 0.0.0.0 so Vers can route to it.

Step 7: Make a change

Connect back to the VM and add a new endpoint:
Refresh the /docs page in your browser — the new endpoint appears automatically. Exit when done:

What you learned

  • Creating a Vers VM and connecting via SSH
  • Installing Python packages and running a FastAPI server
  • Serving an API accessible over HTTPS
  • Using FastAPI’s auto-generated docs on a Vers VM
  • Making live changes to a running app

Next steps