Overview
The Tembo self-hosted stack runs as a single NixOS virtual machine. All services sit behind nginx on port 80:
Tembo distributes a pre-built NixOS custom image to your Google Cloud project. You create a Compute Engine VM from that image, configure VPC firewall rules, and configure a single JSON file. No OS setup or image building is required on your end.
Prerequisites
Before you begin, you need:- A GCP project with billing and the Compute Engine API enabled
- Permission to manage project IAM, instances, and VPC firewall rules
- The
gcloudCLI authenticated to your project, or equivalent access in Cloud Shell - The trusted public IP ranges that need browser or SSH access
Step 1: Request Access
To get started with Tembo self-hosted, you need a license key and access to the Tembo custom image. Book a demo with the Tembo team to get set up: Once you have a license key, contact Tembo to have the image shared with your Google Cloud project. You will need to provide:- Your license key
- Your Google Cloud project ID
- Your preferred region (for example,
us-central1)
The image contains no embedded secrets. Initial configuration is written to
/var/lib/tembo/config.json at first boot by the tembo-config-seed service.Step 2: Configure OS Login
The Tembo image uses OS Login. Enable it before connecting to the VM and grant operators OS administrator access. This role permits SSH access andsudo.
Prefer granting access to a group:
enable-oslogin=TRUE to each VM’s metadata, as shown in the launch command below.
IAM changes can take several minutes to propagate. If your first SSH or
sudo attempt fails immediately after granting the role, wait briefly and retry.Step 3: Create a Compute Engine VM
VM requirements
For the best sandbox performance, use an Intel machine type that supports nested virtualization, such as
n2-standard-8 or c3-standard-22. Avoid E2, AMD (N2D/C2D/T2D), and Arm machine types. The Tembo image includes the enable-vmx license, so /dev/kvm is available automatically on compatible machine types.Via the Google Cloud CLI
Set the project and zone you will use:--enable-nested-virtualization because it is enabled by the image.
Via the Google Cloud console
- Go to Compute Engine > VM instances and select Create instance
- Choose your preferred region and zone
- Under Machine configuration, select the N2 series and choose n2-standard-8 or larger
- Under Boot disk, select Change, then choose Custom images and select the Tembo image shared with your project
- Set the boot disk size to at least 256 GB and select Balanced persistent disk
- Under Advanced options > Metadata, add
enable-osloginwith the valueTRUE - Under Networking, add the network tag
tembo-self-hostedand ensure the VM has an external IPv4 address - Select Create
Step 4: Configure VPC Firewall Rules
VPC firewall rules control inbound traffic to Compute Engine VMs. Create rules that target thetembo-self-hosted network tag:
Ports 3999 and 8888 are only needed during initial setup. You can remove those rules after configuration is complete.
Via the Google Cloud CLI
default, replace default with its name. You can also create these rules in the console under VPC network > Firewall.
Step 5: Connect and Validate the VM
Connect using OS Login:sudo -n id should report uid=0(root), and /dev/kvm should exist.
Step 6: Run the Installer and Configure the VM
6a: Run the install workflow
Find the VM’s external IP address:6b: Configure /var/lib/tembo/config.json
After the installer finishes, open the VS Code server to edit the configuration file:
/var/lib/tembo/config.json. Ensure these keys are present and correct:
Use the exact origin that users will enter in their browsers. Do not use a Tailscale address, an internal service port, or a VS Code forwarded URL such as
http://<vm-external-ip>:8888/proxy/....
After saving, restart the application services:
tembo-ts-api, tembo-ts-cron, and agent workers on every boot. Manual edits are preserved—the seed writes only values that are missing or empty.
Step 7: Verify the Install
Open a browser and navigate to:tembo-ts-agent-X, X is the number of the agent you chose to provision during installation. For example, three agents create tembo-ts-agent-1, tembo-ts-agent-2, and tembo-ts-agent-3.
Troubleshooting
SSH connects and immediately closes
Confirm that OS Login is enabled on the project or VM and that your identity hasroles/compute.osAdminLogin:
A port is unreachable
Confirm that the VM has thetembo-self-hosted network tag and that the matching firewall rule includes your current public IP. From the VM, confirm that the service is listening locally:
Auth 404 on sign-up
Symptom:POST http://<vm-external-ip>:3000/api/auth/sign-up/email returns 404.
Cause: You are reaching the Next.js frontend directly on port 3000 and bypassing nginx. The /api/auth/* handler does not exist at that port.
Fix: Access the app through nginx on port 80:
tembo-self-hosted target tag.
401 after sign-up
Symptom: Sign-up succeeds but all subsequent API requests return 401. Cause: Billing is enabled by default. Without Stripe configured, organization creation fails silently, leaving the user with no active organization. Fix: Confirmbilling.enabled: false is set in the API environment in config.json. Contact Tembo support if this was not set in the distributed image.
Sign-in loops or cookie issues
Symptom: Sign-in redirects back to the login page, or cookies are not set. Cause:api.base or frontend.url in config.json does not match the URL you are accessing in the browser. Better Auth uses these values for trusted origins and cookie domain validation.
Fix: Edit /var/lib/tembo/config.json and set both keys to the exact origin you are using in the browser. Do not use links from the VS Code Ports panel; those links route through port 8888. Restart the application services:
/dev/kvm is missing
Recreate the VM using a compatible Intel machine type such as N2 or C3. The image already enables nested virtualization; unsupported E2, AMD, and Arm machine types cannot expose KVM.
Services not starting
tembo-config-seed service must complete before the API and agents start. If the API fails immediately at boot, check:
VM not reachable after launch
- Confirm the VM is in a Running state in the Google Cloud console.
- Verify the VM has an external IPv4 address.
- Verify the VPC firewall rules allow port 80 and target the
tembo-self-hostednetwork tag.