Publishing exposes a running service through Teleport application access.
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'Prepare a service
Only port 8080 is currently supported. Configure your app to listen on that port and bind to an interface reachable from the beam, typically 0.0.0.0.
To start an isolated example server:
mkdir -p ~/preview
printf '<h1>Hello from a Beam</h1>\n' > ~/preview/index.html
python3 -m http.server 8080 --bind 0.0.0.0 --directory ~/previewThe Python server stays in the foreground. Leave that terminal open while publishing from another local terminal. For long-running work, use managed services rather than relying on an attached shell.
Serve only files intended for the preview. Do not point a web server at your home directory, repository root, credentials, or internal data.
Publish HTTP
Find the beam’s generated name with tsh beams ls. Replace my-beam with that name in the commands below.
tsh beams publish my-beamTeleport returns an authenticated HTTPS application URL. Use the returned URL rather than guessing it. Access is governed by Teleport permissions; this is not anonymous public hosting.
Publish TCP
To try TCP publishing instead of HTTP publishing, use a beam that has not already been published as HTTP. The service still needs to listen on port 8080. You can use the Python server above: Teleport forwards TCP traffic, and the client and server still speak HTTP over that connection.
tsh beams publish --tcp my-beamOn your workstation, run tsh apps ls and find the published application’s name. Replace my-tcp-app with that name (not its URL) and start a local proxy. Leave it running.
tsh proxy app --port=18080 my-tcp-appIn another terminal on the same workstation, request the example page through the local proxy. This check passes only if the request succeeds and returns the heading from the beam.
page=$(curl --fail --silent --show-error --max-time 10 http://127.0.0.1:18080/) &&
printf '%s\n' "$page" | grep -Fx '<h1>Hello from a Beam</h1>'Expect <h1>Hello from a Beam</h1> and a zero exit status. For a service that doesn’t speak HTTP, use its native client against 127.0.0.1:18080 and verify an expected response. Stop the local proxy with Ctrl-C when you’re done.
Lifetime and cleanup
The application depends on the running beam and service. Publishing does not save your files or keep the runtime alive indefinitely. Stop the example server with Ctrl-C when finished. To remove the beam:
tsh beams rm my-beamSave any required work through a phase build beam before removing it.