Let’s start with some terminology:
A beam runtime is an ephemeral micro-VM that expires in 11 hours. Each beam has an identity, state and a virtual network. A phase is a versioned and layered images for beam runtimes. A phase holds filesystem state and its build instructions.
Beam runtimes and phases.
You can combine beams and phases to create reusable images, create forks and snapshots.
Let’s start an interactive build beam micro-VM that supports snaphots in /home folder.
Install the client tools and sign in
Beams is a Teleport project and uses official Teleport client tools.
The client tools include tsh to sign in and run commands, and tctl to administer your cluster if you have permission.
Cluster: example.beams.run. Edit this example to use your cluster name.
Install version 18.11.10 of the client:
Download and open the macOS installer, then follow its instructions.
curl -O https://cdn.teleport.dev/teleport-tools-18.11.10.pkg
open teleport-tools-18.11.10.pkgFor Linux x86-64, download and install the client tools:
curl -O https://cdn.teleport.dev/teleport-v18.11.10-linux-amd64-bin.tar.gz
tar -xzf teleport-v18.11.10-linux-amd64-bin.tar.gz
sudo ./teleport/installFor Windows x86-64, run these commands in PowerShell. Add the extraction directory ($env:LOCALAPPDATA\Teleport) to your user PATH to use tsh in future terminals; the last command adds it to this terminal's PATH.
Invoke-WebRequest -Uri https://cdn.teleport.dev/teleport-v18.11.10-windows-amd64-bin.zip -OutFile teleport.zip
Expand-Archive -Path teleport.zip -DestinationPath "$env:LOCALAPPDATA\Teleport" -Force
$env:Path += ";$env:LOCALAPPDATA\Teleport"Follow the official client tools install guide for other versions and architectures.
Check that you’re running v18.11.10 of the client with tsh version.
tsh versionI sign in without a password (e.g. a passkey).
tsh login --proxy='example.beams.run' --auth=passwordlessI have a password & MFA set up for my account:
Replace you@example.com with your Teleport username.
tsh login --proxy='example.beams.run' --user=you@example.comI sign in with SSO (e.g. Okta, GitHub, SAML).
tsh login --proxy='example.beams.run'Start a beam
tsh phase add workspaceThis command created the build beam and an associated phase with the same name. You can snaphshot versions in /home folder of this beam,
and phase workspace will add layer on each snapshot. Let’s give it a try:
mkdir -p ~/app
printf '<h1>Hello from my workspace</h1>\n' > ~/app/index.htmlSnapshot
tsh phase snapshotThis saves filesystem changes since the last edit and updates the associated phase workspace.
Once you are done, you can finalise the changes to the workspace phase.
tsh phase snapshot --finalThis command finalises the phase, shuts down and discards the build beam.
If you disconnect from the beam and did not run tsh phase snapshot --final, the changes will not be saved.
To reconnect back, use tsh beams ssh workspace.
Return to saved work
To start a new build beam, run:
tsh phase edit workspaceA fresh build beam contains the last saved filesystem of workspace.
Edit your files and run tsh phase snapshot --final inside that beam to save again.
When a snapshot is rejected
The default snapshot fails if you changed files outside the allowed paths. Inspect the rejected paths before deciding to omit them:
tsh phase snapshot --force--force leaves the running filesystem unchanged but excludes disallowed changes from the saved image. Those changes are lost when the beam is removed. See the snapshot exclusions.
For repeatable setup, copy stages, startup services, and phase.yaml, use the phase API reference.
When an edit is unavailable
You cannot start a second edit while a phase has an active build. Reconnect to that build with tsh beams ssh, or finish it before starting another.
You also cannot edit or save changes to a snapshot phase while it has snapshot descendants. This includes indirect descendants and snapshot builds still in progress. Rebuild and copy children alone do not prevent editing.
If descendants prevent an edit, fork the saved snapshot into a new phase:
tsh phase add workspace-v2 --fork-from=workspaceThe original and its dependents keep their existing contents and relationship.
You can read more on forks here.
Saving, disconnecting, and ending a build
| Action | Result |
|---|---|
tsh phase snapshot inside the build beam |
Saves allowed filesystem changes and keeps the beam running. |
tsh phase snapshot --final inside the build beam |
Saves successfully, then ends the build beam. Changes after capture are discarded. |
exit or Ctrl-D in the shell |
Disconnects. It does not save files or end the beam. |
tsh beams ssh <build-beam> from your local terminal |
Reconnects to the existing running workspace, including unsaved changes. |
tsh phase edit <phase> after the build ends |
Creates a fresh build beam from the phase’s last successful snapshot. |
beam expiry or tsh beams rm <build-beam> |
Removes the beam and discards unsaved changes. The phase’s last saved image remains available. |
Build beams expire after 11 hours. Check tsh beams ls for the expiry and identifier of a running beam. Save before that deadline. Expiry does not capture a final snapshot.