Reference
Backend API / Single Droplet
Run the API on a single Droplet with DNS, firewall, and optional reserved IP handling.
Overview
Variant overview
Run the API on a single Droplet with DNS, firewall, and optional reserved IP handling.
Manifest file
Edit backend-api-vm.environment.yaml to change the scenario.
Rendered output
OPSd renders the manifest into OpenTofu under rendered/backend-api-vm.
Supported changes
The variant defines which add, remove, and scale operations are supported.
Good fit
You need host-level access; you want a simple VM baseline; the team owns the server lifecycle
Tradeoff
More operating responsibility sits with the team from the start.
What gets created for this setup
This diagram shows the result you get after rendering the selected variant.
Infrastructure shape
Before you start
Shared setup is covered in Installation and the Introduction. This section lists the minimum things you need before the first render for DigitalOcean.
- Installation install the shared OPSd CLI.
- Introduction understand the workflow boundary and required toolchain.
- Have an SSH key ready for the Droplet.
Initialize this variant
Use this path when the team wants a simple VM baseline and is comfortable owning the host.
Initialization sequence
opsd list blueprints
opsd init blueprint backend-api backend-api-vm.environment.yaml --variant vm
opsd validate manifest backend-api-vm.environment.yaml
opsd render manifest backend-api-vm.environment.yaml --output rendered/backend-api-vm
cd rendered/backend-api-vm
tofu init
tofu plan
# review the rendered output before planning
cd rendered/backend-api-vm
tofu init
tofu plan Edit the manifest
The supported changes are still manifest-first, but host-level changes are now part of the operating model.
Supported change commands
Add a managed database
Add a supported managed database entry.
opsd add database postgres backend-api-vm.environment.yaml --id primary-db Add a support node
Add a bastion or helper node and remove it again if needed.
opsd add node vm backend-api-vm.environment.yaml --id bastion --role bastion --profile s-1vcpu-1gb Remove a support node
Drop a helper node when the variant supports removal.
opsd remove node backend-api-vm.environment.yaml bastion Edit, validate, render
# edit backend-api-vm.environment.yaml
# validate the config before rendering
opsd validate manifest backend-api-vm.environment.yaml
# render the updated output and review it
opsd render manifest backend-api-vm.environment.yaml --output rendered/backend-api-vm
cd rendered/backend-api-vm
# plan and apply only after the diff is clear
tofu plan
tofu apply Supported changes
These examples come from the variant capability map and show the supported add, remove, and scale operations for this setup.
Add a managed database
Add a supported managed database entry.
opsd add database postgres backend-api-vm.environment.yaml --id primary-db Add a support node
Add a bastion or helper node and remove it again if needed.
opsd add node vm backend-api-vm.environment.yaml --id bastion --role bastion --profile s-1vcpu-1gb Remove a support node
Drop a helper node when the variant supports removal.
opsd remove node backend-api-vm.environment.yaml bastion Changes are not active yet
Editing the manifest changes the desired state. To make it real, validate the manifest, render the updated output, and then run `tofu apply` against the rendered directory.
opsd validate manifest backend-api-vm.environment.yaml
opsd render manifest backend-api-vm.environment.yaml --output rendered/backend-api-vm
cd rendered/backend-api-vm
tofu plan
tofu apply Operational boundary
These are the constraints that define the supported shape for this variant.
- Single Droplet is the base shape.
- Managed database is optional, not part of the default path.
- Move to a database-backed blueprint when state becomes first-class.
Related variants
Use the scenario overview to compare the other supported variants for the same blueprint.