CLI
LabPod ships as a single binary with four command surfaces:
labpod server- starts the HTTP server.labpod admin <subcommand>- bootstrap and break-glass operations.labpod env [--all]- prints this host’s explicit configuration overrides, configuration problems, and detected runtime choices;--alladds every supported setting. See Environment variables.labpod whoami,labpod servers,labpod ws,labpod template,labpod image,labpod fs,labpod token,labpod api, andlabpod skill- client commands that talk to the LabPod service running on the same host. See Client commands below.
Each example is a separate action. Copy the command for the action you want to perform.
labpod --version(print the build version (a release tag such as v0.x.y for released builds))labpod --help(print usage)
Database path resolution
Section titled “Database path resolution”Every command that opens SQLite resolves the database path in this order:
- CLI
--db <path>(placed after the subcommand) LABPOD_DBenvironment variable in the current processLABPOD_DBauto-loaded from/etc/labpod/labpod.envlabpod.dbin the current working directory
For installed admin commands, use sudo on sudo-based hosts. On Rocky/RHEL systems where you
usually work in a root shell, use the root-shell tab instead:
sudo labpod admin --db /var/lib/labpod/labpod.db list-users# Run these as rootlabpod admin --db /var/lib/labpod/labpod.db list-users# or:sudo labpod admin list-users # auto-reads /etc/labpod/labpod.env# Run these as root# or:labpod admin list-users # auto-reads /etc/labpod/labpod.envCheck which path a command would use:
labpod admin db-pathsudo labpod admin db-path# Run these as rootlabpod admin db-pathlabpod server
Section titled “labpod server”labpod server [--db <path>] [--port <port>] [--dev]| Flag | Default | Notes |
|---|---|---|
--db <path> | From env / labpod.db | Override the database path |
--port <port> | 24680 | Override LABPOD_PORT |
--dev | off | Enable localhost CORS, ephemeral JWT secret |
The installed systemd service runs:
/usr/local/bin/labpod serverConfiguration comes from /etc/labpod/labpod.env. See
Environment variables for the full list.
Client commands
Section titled “Client commands”Client commands run only on the LabPod host, through the installed /usr/local/bin/labpod.
Run them as a regular Linux user, without sudo - there is no login step. The CLI connects to a
root-owned Unix socket, where the server reads your Linux UID from the kernel and maps it to your
LabPod account. There is no --server URL, no saved alias, no password, session file, PAT, or TLS
option to supply - a remote server URL is rejected as a usage error. Work with a LabPod server on
another host from a browser or LabPod Connect instead.
Who am I, and what can this host build?
Section titled “Who am I, and what can this host build?”labpod whoamilabpod servers hardware
whoami shows the Linux account the socket authenticated. If that account exits with code 3,
either it has no LabPod account yet or its account setup needs an administrator’s attention - there
is no client-side account-enable command. servers hardware reports this host’s NVIDIA driver,
maximum CUDA runtime, and each GPU’s model/VRAM/compute capability - pair it with labpod ws capacity (your current quota and free headroom) before creating a GPU workspace.
Workspaces
Section titled “Workspaces”labpod ws listlabpod ws get <workspace-id>labpod ws capacitylabpod ws recommend --template tmpl-pytorch-jupyterlab --gpu-use-case mediumlabpod ws create --template tmpl-pytorch-jupyterlab --name train1 --gpu-count 1labpod ws status <workspace-id>(saved-definition image readiness)labpod ws pull <workspace-id>(request Download; returns without waiting)labpod ws build <workspace-id>(request Build; returns without waiting)labpod ws start <workspace-id>labpod ws start <workspace-id> --use-previous-image(explicitly use the previous prepared image)labpod ws launchers <workspace-id>labpod ws launcher start <workspace-id> jupyterlabpod ws launcher stop <workspace-id> jupyterlabpod ws logs <workspace-id> --tail 200labpod ws logs <workspace-id> --launcher jupyter --tail 200(a launcher’s captured stdout/stderr)labpod ws rename <workspace-id> --name train2labpod ws ports <workspace-id>labpod ws port add <workspace-id> streamlit --container-port <free-slot>labpod ws monitor <workspace-id>(one-shot CPU/MEM/GPU/process snapshot)labpod ws stop <workspace-id>labpod ws delete <workspace-id> --yes
Create, image preparation, Start, and app launch are separate commands, matching the web
workflow. ws create saves a stopped workspace with its own definition; it sends only the resource
flags you set, so the template defaults fill in the rest. ws recommend asks the server for the
same safe defaults the web composer shows, without reserving anything. If a Create response is
lost, the CLI prints an idempotency key; repeat the exact same command with
--idempotency-key <key> to get the original workspace instead of a duplicate.
Then check ws status. Its state is ready, download_required, build_required, stale
(the saved local recipe changed since the image was last prepared), or image_missing. ws pull and ws build
prepare the workspace’s own saved image or recipe, not the current source template, and return
immediately with a preparation record. Follow its operation_id using labpod image pulls <id>
or labpod image builds <id>, according to the returned kind. An existing active preparation
can have a different kind from the action you requested. Recheck ws status before ws start. Start never pulls or builds;
--use-previous-image explicitly starts the previously prepared image with the current saved
settings. Run labpod ws --help for the complete flag list.
ws logs without --launcher shows the container’s raw stdout/stderr. With --launcher <name> it
shows the bounded, persistent output LabPod captured for that configured app (the same feed as the
workspace page’s View app logs), which stays readable even while the workspace is stopped;
manually started processes and extra-app ports are not captured this way. Both log sources are
owner-only, because app output can contain credentials: administrators and superusers can observe
and (as root) force-stop another user’s workspace, but cannot read its logs.
Workspace definitions, export, and import
Section titled “Workspace definitions, export, and import”Each workspace keeps its own saved definition: the image or build recipe, apps, resources, folders, and environment it uses on the next Start. Edit it with revision-checked commands:
labpod ws definition schema workspace > workspace.schema.jsonlabpod ws definition schema bundle > bundle.schema.jsonlabpod ws definition get <workspace-id>(settings plus revision)labpod ws definition save <workspace-id> --file definition.jsonlabpod ws definition files <workspace-id> --json(exact saved bytes, even malformed JSON)labpod ws definition patch <workspace-id> --file patch.json(explicit file writes and removals)labpod ws validate <workspace-id>(check saved files without side effects)labpod ws export <workspace-id> --out recipe.tar(portable recipe bundle)labpod ws import preview recipe.tar --jsonlabpod ws import commit recipe.tar --file workspace.json --review-revision <revision>
For the files, field rules, limits, and validation errors used by ws definition, ws export,
and ws import, see Workspace definition files.
ws definition schema workspace|bundle exports the running server’s exact embedded JSON Schema.
It needs the running service and your authenticated host-local account, but no workspace ID;
default output and --json are identical. Schema checks cover structure; ws validate also
checks domain and policy rules on saved files.
ws definition save takes {"expected_revision": "<revision from get>", "workspace": {...}} with
the complete edited settings. If the files changed after your read, the save is rejected with
definition_conflict instead of overwriting them; read again and reapply your edit. Saving while
the workspace runs is allowed and affects the next Start only. ws rename uses the same
revision-checked save.
ws export writes the saved bundle.json, README.md, and build context. It excludes instance
settings, project data, and the workspace home, needs no image build, and refuses to overwrite an
existing file unless you add --force. ws import preview reviews a bundle without changing
anything; ws import commit then creates an independent stopped workspace from that reviewed
content, without adding a reusable template, downloading, building, or starting anything.
Preview returns a workspace object and review_revision. Save just that workspace object as
workspace.json for commit. If you edit it, preview again with --file workspace.json, then use
the final preview’s resolved workspace and review_revision. Commit must receive the same tar
and settings that were reviewed.
To run one non-interactive command in a running workspace you own, put the container command
after --:
labpod ws exec <workspace-id> -- nvidia-smi -Llabpod ws exec <workspace-id> --timeout 600 -- bash train_prep.sh
Workspace execution is owner-only, including for administrators. It has a 300-second default
timeout, a 600-second maximum, and a 256 KiB output limit. Detach long jobs with nohup or
setsid, then inspect their output with ws logs or labpod fs read.
Templates and images
Section titled “Templates and images”labpod template listlabpod template get <template-id>labpod template dockerfile <template-id>(print a clone/import’s Dockerfile)labpod template clone tmpl-pytorch-jupyterlab --name my-copylabpod template export tmpl-pytorch-jupyterlab --out bundle.tarlabpod template import bundle.tar --build-laterlabpod image listlabpod image status <template-id>labpod image pull <template-id> --waitlabpod image pull --image quay.io/org/image:tag --wait(any registry-qualified image)labpod image pullslabpod image build <template-id> --waitlabpod image buildslabpod image overviewlabpod image prune --yes
Use template create --file <spec.json|-> and template edit <id> --file <patch.json|-> when
automating template definitions; - reads JSON from standard input. A template you import or
clone is active for you immediately; a Dockerfile-backed copy still needs its image built before a
workspace from it can start. template dockerfile <id> --set --file <path> replaces the Dockerfile
in a clone’s own editable build context (a global template’s Dockerfile is read-only - clone it
first). template import rejects bundles larger than 1 MiB before uploading them.
Bundles use schema version 2. Version 1 bundles are no longer imported; re-export them from a
current LabPod server, or update schema_version to 2 and remove the retired requires_eula
field. A bundle’s terms_url is an informational link to the publisher’s terms, not an
acceptance step.
image pull and image build operate in your own rootless Podman store: LabPod has no shared
or root-owned image cache, so every account downloads or builds its own copy. image pull --image
accepts any image reference that names its registry explicitly (for example docker.io/... or
ghcr.io/...); LabPod has no registry allowlist. Access to an image and the right to use its
software remain your or your institution’s responsibility.
These template-keyed commands manage catalog images. They do not prepare a workspace: a workspace
uses its own saved recipe, so prepare it with ws pull or ws build, then start it. Local-only
managed recipes such as MATLAB and MS Code Serve-Web are built in each researcher’s own account
after the administrator enables the recipe.
LabPod has no root/shared image scope and no user-to-root promotion request. Root cannot use the image list, pull, build, delete, or prune commands. These workflows will not be supported for simplicity; publish a reusable image through an external registry instead.
File transfer (labpod fs)
Section titled “File transfer (labpod fs)”Move files between the local Linux account and the server’s file roots - useful for staging inputs
or collecting results from a script or agent without going through the browser file manager.
Addresses are <root>/<path>; labpod fs roots lists the root ids you can address (work maps to
/work inside your workspaces).
labpod fs rootslabpod fs ls work/exp1labpod fs upload dataset.tar.gz work/exp1/(trailing ”/” keeps the local file name)labpod fs download work/exp1/results.ckpt(refuses to overwrite without —force)labpod fs archive work/exp1 exp1.tar.gz(a directory as tar.gz)labpod fs rm work/exp1 --recursive --yes
download and archive write local files and, like template export, do not accept --json.
Every fs operation is audited server-side.
Personal access tokens
Section titled “Personal access tokens”Personal access tokens (PATs) are for a separate, deliberate integration that calls the LabPod
HTTP API from another host - the host-local CLI itself never uses or stores one. Create, list, and
revoke them with labpod token:
labpod token create --name ci-runner(prints the token ONCE)labpod token create --name nightly --expires 30(custom expiry in days (1-365; default 90))labpod token listlabpod token revoke <token-id>
A new token’s secret is printed once at creation and is never stored on the server, so copy it
right away. Use it from the calling script or agent, not from labpod:
curl -H "Authorization: Bearer labpod_pat_..." https://lab-gpu.example.local/api/workspacesIf one-time token output fails, the CLI exits 1 and identifies the created token by name and ID.
Use labpod token list, then labpod token revoke <token-id> before creating a replacement. If
the creation response is interrupted, a token may already exist: find it by the requested name
with the same list/revoke flow. The CLI never retries creation or revokes automatically; the
secret cannot be retrieved again.
A token carries the same permissions as the user who created it - it drives that user’s own workspaces, templates, and images, and never administrator operations. A PAT cannot mint or revoke tokens; issuing, listing, and revoking always authenticates as the signed-in browser session or the host-local socket itself.
You can also review and revoke your tokens in the browser under Settings → API tokens, which flags any token expiring within seven days. Creating a token is CLI-only, because the secret is shown a single time and never persisted.
Raw API passthrough
Section titled “Raw API passthrough”labpod api GET /api/usage/melabpod api PATCH /api/users/kim --body '{"display_name":"Kim"}'labpod api POST /api/workspaces --body @create.json
labpod api <METHOD> <path> sends one peer-authenticated request to a supported /api/* endpoint
and prints the raw response - the escape hatch for anything without a dedicated ws/template/
image wrapper. There are no confirmation prompts, so a raw DELETE deletes immediately.
Streaming endpoints (terminal, live monitor/event streams) are refused; use the --wait wrappers
and ws monitor instead. It cannot bootstrap credentials: POST /api/auth/login and password
changes are rejected on this socket.
JSON output and exit codes
Section titled “JSON output and exit codes”Add --json to a client command when a script needs the raw API response:
labpod ws list --jsonlabpod ws create --template tmpl-pytorch-jupyterlab --json
template export, ws export, fs download, and fs archive are the exceptions, because each
writes a local file instead of printing JSON. Exit codes are 0 for success, 1 for an API, network, or output error (or
an aborted confirmation), 2 for invalid command usage, and 3 when the current Linux account has
no LabPod account or its account setup is incomplete.
Human-readable output, raw responses, JSON, logs, Dockerfiles, help, version output, and command completion receipts report output write failures on stderr and exit 1, including partial writes or a closed pipe. A server action, transfer, export, or skill installation may already have finished; inspect its state before retrying. Human-readable template import stops before commit if its preview summary cannot be printed.
Installing the CLI agent skill
Section titled “Installing the CLI agent skill”labpod skill install is local-only: it installs the CLI-usage skill embedded in the binary into an
LLM agent’s skills directory, without contacting the server.
labpod skill install --agent claude(-> ${CLAUDE_CONFIG_DIR:-~/.claude}/skills)labpod skill install --agent codex(-> ${CODEX_HOME:-~/.codex}/skills)labpod skill install --path /path/to/skills
Exactly one of --agent or --path is required, and it refuses to overwrite an existing skill
unless you add --force.
labpod admin
Section titled “labpod admin”labpod admin [--db <path>] <subcommand> [args]| Subcommand | What it does |
|---|---|
migrate | Apply any pending database schema migrations (idempotent) |
create-user <name> | Create a LabPod account; provisions Linux account if absent |
set-password <name> | Rotate the LabPod password (DB only, not the Linux password) |
revoke-tokens <name> | Revoke all of a user’s API tokens (break-glass; a password reset also does this) |
list-users | Print all users with their superuser flag and PROVISIONING_CLEANUP_REQUIRED status |
db-path | Print the resolved database path for this invocation |
doctor | Check host prerequisites and report what to fix; --hami-runtime runs only the explicit GPU-sharing test (see GPU configuration) |
tls-fingerprint | Print SHA-256 fingerprint of the serving TLS certificate |
update <status|check|apply> | Show, refresh, or apply the latest LabPod release |
backup --out <path> | One-shot snapshot to an explicit file |
backup [--dir <dir>] --retention <N> | Timestamped snapshot in --dir or the configured backup directory; prune to newest N |
checkpoint | Flush the offline WAL and close SQLite sidecars (stop labpod and backups first) |
restore <path> [--yes] | Copy a snapshot onto the live DB (stop service first) |
rollback list [--json] | List the retained pre-upgrade recovery sets and whether each one can be applied |
rollback apply <recovery-id> --yes | Restore a retained set’s binary, application files, and paired database |
template import <path.tar> (--owner <server_userid> | --global) | Import a host-local template bundle: disabled for review with --global, active for that user with --owner |
license show | Show the resolved trial or signed-license entitlement |
license request | Print the host activation request code |
license verify <file> | Validate a license file without installing it |
license install <file> | Verify and install a license file to LABPOD_LICENSE_PATH |
create-user and set-password read the password interactively or from stdin when piped:
New and changed LabPod passwords are normalized before validation. Regular accounts require 8–64
Unicode characters; root and superuser accounts require 12–64. Common passwords and easy
username or labpod derivatives are rejected, but there is no required mix of character classes.
Existing passwords are not invalidated by an upgrade.
The examples below use sudo for Ubuntu-style administration. If you are already in a root shell,
as is common on Rocky/RHEL systems, omit sudo.
Enter the password interactively:
sudo labpod admin set-password alice# Run these as rootlabpod admin set-password aliceFor automation, pipe the password instead:
printf '%s\n' 'new-password' | sudo labpod admin --db /var/lib/labpod/labpod.db set-password alice# Run these as rootprintf '%s\n' 'new-password' | labpod admin --db /var/lib/labpod/labpod.db set-password aliceLicense commands
Section titled “License commands”Without an installed signed license, LabPod runs under the built-in 90-day trial. License files are installed locally with the admin CLI:
(set -euo pipefailsudo labpod admin license verify ./license.licsudo labpod admin license install ./license.lic)# Run these as root(set -euo pipefaillabpod admin license verify ./license.liclabpod admin license install ./license.lic)Check status with sudo labpod admin license show, or generate an activation request with
sudo labpod admin license request. In a root shell, omit sudo.
The shipped binary handles local request, verification, installation, and status display.
Template import command
Section titled “Template import command”Use this when a bundle already exists on the LabPod host and you want to import it without going through the browser upload flow:
Import as a global workspace template:
sudo labpod admin template import ./template.tar --global# Run these as rootlabpod admin template import ./template.tar --globalOr import for a specific user instead:
sudo labpod admin template import ./template.tar --owner alice# Run these as rootlabpod admin template import ./template.tar --owner alice--global creates a global template that stays disabled until root reviews and enables it.
--owner creates a private template that is active for that Linux-backed LabPod user right away;
that user still prepares the image for each workspace before starting it.
Dockerfile bundles are not supported by the CLI because they require an image build. Import those
from the Workspace templates admin area (/admin/templates) instead.
Common flows
Section titled “Common flows”Fresh production bootstrap:
(set -euo pipefailsudo labpod admin --db /var/lib/labpod/labpod.db migratesudo labpod admin --db /var/lib/labpod/labpod.db set-password rootsudo systemctl enable --now labpod)# Run these as root(set -euo pipefaillabpod admin --db /var/lib/labpod/labpod.db migratelabpod admin --db /var/lib/labpod/labpod.db set-password rootsystemctl enable --now labpod)Inspect the running service:
systemctl status labpodjournalctl -u labpod -fcurl http://127.0.0.1:24680/api/healthcurl http://127.0.0.1:24680/api/versionsudo labpod admin doctor# Run these as rootlabpod admin doctorSee Environment variables and Runtime settings.