CLI Command Reference
The appliance CLI is the native ct binary at /usr/local/bin/ct. Use it for
appliance operations and for managing the companion CLI tools pack.
sudo ct <command> [options]
Use ct for all documented appliance operations. The companion tools pack is
managed through ct cli ...; if ct cli is unavailable, run ct version and
confirm that the appliance release includes the tools bridge before troubleshooting it.
Quick Reference
| Command | Description |
|---|---|
update [version] [options] | Upgrade to specified version (default: latest) |
rollback | Restore the previous compose configuration (not database data) |
postgres upgrade <ver> | Perform a PostgreSQL major version upgrade (14 → 18) with automatic backup and volume isolation |
postgres rollback | Revert a PostgreSQL major version upgrade back to the isolated pre-upgrade data directory |
doctor | Active appliance preflight health and sanity diagnostics |
security-mode [status|enable|disable] | Inspect or enforce hardened STIG compliance controls (.cta vault encryption and strict SFTP; requires hardware-bound Premium or Demo license on standard OVAs; see Application STIG Hardening) |
onboard --yes [options] | Bootstrap a RHEL 8.10 / Rocky 8.10 host into STIG edition (--install-hostd, --hostname, --license-file, --bundle, --dry-run) |
hostd [serve|priv-helper|probe|status] | Manage or inspect the zero-sudo STIG host control-plane broker (ct-hostd) and shell-free container probe (ctprobe) |
telemetry [status|enable|disable] | View, enable, or disable appliance-level telemetry and crash reporting |
logs [service] | Stream or tail appliance service container logs (-f, --tail) |
backup test <sftp-url> | Test remote SFTP backup destination connectivity, SSH host key, and read/write/delete permissions |
appliance export [destination] | Full appliance archive export (.cta) to local path, SFTP, or --upload to support (see Support Upload Procedures) |
appliance import <archive> | Full disaster recovery restore from archive (.cta) with TimescaleDB hooks |
appliance inspect <archive> [--verify] | Inspect archive metadata, row estimates, secrets vault status, and optional dump SHA-256 verification |
backup run / export / create | Create a full appliance archive (.cta); aliases for appliance export |
backup restore <archive> | Restore a full appliance archive (.cta); alias for appliance import |
backup schedule | Manage automated recurring backup schedule (.cta or db) with systemd timers |
cucm check-ports <ip> | Verify TCP/UDP reachability for essential CUCM ports (8443, 2748, 6970, 514) |
license [status|claim|request|apply|check|id] | Inspect license quota or activate a hardware-bound license (connected two-factor pairing or air-gapped .lic) |
db active-queries | Display real-time running non-idle PostgreSQL queries |
db backup | Create a database backup |
db restore [file] | Restore from a database backup |
db maintenance vacuum <tbl> [--full] | Vacuum one table (--full reclaims disk; locks the table) |
db maintenance compact | Docker cleanup + whole-database VACUUM FULL (locks every table) |
db data purge <tbl|group> <days> [--yes] | Purge old rows from a table or retention group |
db data purge truncate-debug --yes | TRUNCATE debug/webhook/discovery/phone-churn log tables (unbounded) |
db data purge truncate-telemetry --yes | TRUNCATE CUBE/XCC event logs only — keeps curri_events and call analytics (unbounded) |
db audit [--warn] [--table <name>] [--json] | Retention & capacity audit with per-table disk headroom projection (see Retention & Capacity Audit) |
db reclaim [table] [--before DATE] [--dry-run] | Return disk space: partition drop, pg_repack, or gated VACUUM FULL (see Reclaim Disk Space) |
db inspect size / db inspect tables | Read-only size and table-size inspection |
status [--verbose] | Application health, including the Purge & Disk Health section (see Application Status) |
diag show-tech [reason] | Collect a read-only diagnostic bundle for support (see Diagnostic Bundle) |
diag support-bundle [options] | Bounded, sanitized support report; optional policy-scoped upload (see Support Report) |
diag upload --file <path> | Upload diagnostic bundle, log, or .cta archive to support (see Support Upload Procedures) |
migrate status | Check migration progress |
migrate run | Execute pending migrations |
docker prune | Remove unused Docker resources |
certs <command> | Manage enterprise SSL/TLS certs, CSRs, CA trust store, or reset |
reset | Factory reset (deletes all data) |
users list | List users with IDs, emails, roles, and last-login times |
users reset-password <email> <new-password> | Reset an administrator password without sending email |
selfupdate | Update the native CLI itself |
completion [shell] | Generate shell tab completion script (bash, zsh, fish) |
syslog port [port] | Show or change the external UDP/TCP syslog receiver port |
postgres profile [small|medium|large|show] | Set the DB connection/pool sizing tier, or show detected host RAM/vCPUs and the applied/recommended profile (see PostgreSQL Connection Profile) |
postgres upgrade <version> [--dry-run] | Major PostgreSQL version upgrade with preflight validation, automated volume backup, and crash recovery (see PostgreSQL Major Version Upgrade) |
postgres rollback [--yes] | Roll back PostgreSQL major version to previous isolated volume (see PostgreSQL Rollback Plan) |
offline <command> | On-appliance air-gapped apply/list (see Offline / Air-Gapped Bundles) |
storage [status|enable|disable|load] | Show or change SeaweedFS object storage (see Object Storage) |
doctor [-v] [--json] | Run appliance health diagnostics, including the storage checks |
Native CLI tools bridge
The Go CLI can install and run a companion TypeScript tools pack without changing
which binary owns the ct command. The bridge is implemented but remains an
opt-in companion surface: the Go CLI stays on PATH and remains the customer
default.
Check the tools pack
Use status before changing anything. A missing tools pack is reported as
not installed and the status command returns successfully so it can be used in
diagnostic scripts. A present binary with a probe mismatch returns exit code 1.
sudo ct cli status
The output includes the managed path, last update time, engine, probe token, and tools version. The normal managed layout is:
/usr/local/bin/ct # Go customer CLI
<install>/.ct/tools/ct-ts # companion tools binary
<install>/.ct/tools/state.json # last successful install
<install>/.ct/tools-pin.json # optional pinned tools version
For a new appliance, the expected diagnostic output is:
cli-tools path: <install>/.ct/tools/ct-ts
cli-tools: not installed
Install with: ct cli update
After a successful install, status includes the engine, probe, and version:
cli-tools path: <install>/.ct/tools/ct-ts
cli-tools last: <UTC timestamp>
cli-tools engine: typescript
cli-tools probe: calltelemetry-ts-cli-v1
cli-tools version:<installed-version>
Install or refresh the tools pack
# Install or refresh the companion tools
sudo ct cli update
# Preview the target without downloading or changing files
sudo ct cli update --check
# Install a specific companion version
sudo ct cli update --version 0.12.20
# Install and persist a version pin for later updates
sudo ct cli update --version 0.12.20 --pin
# Ignore an existing pin and use the floating latest version
sudo ct cli update --latest
--check and --dry-run are equivalent. --latest and --version are
mutually exclusive. An explicit ct cli update fails if the installer,
checksum, or post-install probe fails; do not treat a failed probe as a usable
tools installation.
Run companion commands
Use run for a one-shot command and preserve the command's exit code:
sudo ct cli run -- network status
sudo ct cli run -- version
The command after -- is required. Use the interactive shell when the installed
tools build provides it:
sudo ct cli shell
If the shell is unavailable or behaves differently on an older tools build,
use ct cli run -- <command> [args...] instead.
Tools refresh during ct update
An appliance update runs the Go self-update first, then refreshes the companion tools pack. In production and UAT, a tools install, checksum, or probe failure hard-fails the overall update so the appliance does not continue with a broken CLI toolchain.
The following are lab/test escape hatches only:
| Variable | Effect |
|---|---|
CT_CLI_TOOLS_REQUIRE=0 | Continue with a warning when the tools refresh fails |
CT_CLI_TOOLS_REQUIRE=1 | Explicitly require a successful tools refresh |
CT_SKIP_CLI_TOOLS_UPDATE=1 | Skip the tools refresh entirely |
CT_CLI_TOOLS_PATH | Override the managed companion binary path |
CT_TS_CLI_BASE_URL | Override the dual-publish tools feed |
CT_INSTALL_CT_PATH | Use a local install-ct.sh during refresh |
Do not use the warn-only or skip variables on a customer production appliance
unless Call Telemetry support explicitly directs it. Do not manually edit a
.ct/tools-require marker; the current CLI defaults to hard-fail and treats that
marker as informational.
Troubleshooting the tools bridge
| Symptom | Recovery |
|---|---|
ct: command not found | Repair or reinstall the native appliance CLI through the appliance installer. Then run ct version and ct cli status. |
ct cli status reports not installed | Run sudo ct cli update, then repeat sudo ct cli status. A missing tools pack is not itself a status failure. |
ct cli update cannot download the tools | Check outbound HTTPS and the release feed configured for the appliance, then retry sudo ct cli update. |
ct cli update or ct update fails with exit status 56, 55, 18, or 92 | The ~100 MB tools download was reset mid-transfer. A firewall, proxy, or antivirus/DPI device on the appliance's egress path is likely inspecting the download. Allowlist HTTPS to get.calltelemetry.com without content inspection, then retry sudo /usr/local/bin/ct cli update and re-run the update. |
ct cli update fails with exit status 5 or 6 | Proxy or DNS resolution failed. Check proxy variables under sudo (sudo env | grep -i proxy) and the appliance DNS configuration. |
| Checksum, installer, or post-install probe fails | Stop and do not run the tools binary. Verify the release/architecture feed and retry sudo ct cli update; include the exact error in the support ticket. Do not bypass checksum or probe validation. |
| Permission or path mismatch | Run with the same sudo boundary used for the appliance install. Confirm the resolved install directory and CT_CLI_INSTALL_DIR; use CT_CLI_TOOLS_PATH only in a lab or when support directs it. |
ct cli shell is unavailable | Some shipped tools builds do not include the full interactive shell. Use sudo ct cli run -- <command> [args...], for example sudo ct cli run -- network status. |
ct update stops after a tools error | This is the production/UAT hard-fail guard. Fix the installer/feed/probe issue, run sudo ct cli update, and retry the appliance update. Do not claim the appliance update completed. |
If a status probe is present but does not match the expected native probe token, leave the tools pack disabled and contact support. A probe mismatch indicates a wrong or incompatible binary, not a cosmetic warning.
Collect support evidence
Include the following output when opening a CLI support request:
sudo ct version
sudo ct cli status
Also include the exact command that failed, its exit code, the appliance release,
CPU architecture, and whether the failure occurred during ct update or an
explicit ct cli update. Redact passwords, access tokens, private keys, and
credentials embedded in URLs before sharing logs or terminal output.
Diagnostic Bundle (ct diag show-tech)
When support asks for a diagnostics bundle, run:
sudo ct diag show-tech
(sudo ct show-tech is the same collector.) It writes a
ct-show-tech-<timestamp>/ directory plus a .tar.gz next to it in the install
directory — attach the .tar.gz to the support case.
The bundle contains:
SUMMARY.md— findings first: prioritized flags (low disk, emergency disk-pressure purges, failed purge runs, WAL growth, table bloat), then a per-section collection status table.system/— disk usage (df, per-volume usage), running containers, container resource usage, and versions with image digests.db/— bounded read-only database snapshots: purge configuration, recent purge history, current activity (query text is never collected), database sizes, largest tables, migration tail, and SQL health engine output.flags.json/manifest.json— the same findings and section status in machine-readable form.
The collector is read-only and bounded: every section has a 30-second
timeout (--section-timeout), and a section that fails or times out is recorded
in the bundle instead of stopping the collection. It never collects call records
or query text and it skips write probes, so it is safe to run even when the disk
is nearly full.
| Option | Description |
|---|---|
--output DIR | Bundle directory (default <install>/ct-show-tech-<timestamp>) |
--no-archive | Skip the .tar.gz next to the bundle directory |
--section-timeout SEC | Per-section timeout (default 30) |
--pg-audit-timeout SEC | SQL health engine budget (default 240) |
--no-pg-audit | Skip the SQL health engine |
When the web UI's Download Logs button runs on an older appliance that does not carry this collector, the download falls back to the classic logs-only ZIP.
Support Report (ct diag support-bundle)
ct diag support-bundle writes a single bounded, sanitized report file for a
support case — service log windows, appliance status, and configuration keys
with values redacted — plus a coverage manifest that records what was collected:
sudo ct diag support-bundle --period 24h
| Option | Description |
|---|---|
--period 1h|24h|7d | Log window to collect (default 24h) |
--from / --to | Custom ordered UTC window, at most seven days |
--profile <name> | Named collection profile |
--upload | Upload the report under an appliance-scope support policy |
--unattended | Machine-readable JSON; authorizes with a scoped policy token from --credential-file |
--interactive-approval | Browser approval flow instead of unattended upload |
sudo ct diag support-bundle --upload --unattended --period 24h
For backward compatibility, ct diag show-tech with a report flag such as
--upload or --period still runs this support-report flow — shipped runbooks
keep working unchanged.
Diagnostic Upload (ct diag upload)
Upload an existing diagnostic bundle (.tar.gz), sanitized report (.log), or full Call Telemetry Archive (.cta) directly to Call Telemetry Support:
# Upload a full appliance archive (.cta) with 50 MB chunked multipart transport
sudo ct diag upload --file /var/backups/ct-appliance-20261110.cta
# Upload an existing show-tech tarball
sudo ct diag upload --file /home/calltelemetry/ct-show-tech.tar.gz
# Upload a sanitized support report
sudo ct diag upload --file /home/calltelemetry/show-tech.log
For full procedural steps, policy credentials, and browser approval instructions, see Appliance Support Upload Procedures.
Upgrade & Rollback
Update to Latest Version
sudo ct update
Update to Specific Version
sudo ct update 0.8.4-rc172
Update Options
| Option | Description |
|---|---|
--ignore-os-check | Continue past only the operating-system compatibility failure. This is a temporary upgrade workaround, not a long-term fix. |
--force-upgrade | Skip validation checks (RAM, disk, Docker version) |
--no-cleanup | Keep old images for troubleshooting |
Examples:
# Temporarily continue an upgrade after an OS compatibility failure
sudo ct update 0.8.6.26 --ignore-os-check
# Force upgrade bypassing checks
sudo ct update --force-upgrade
# Upgrade without cleanup
sudo ct update --no-cleanup
# Combine options
sudo ct update 0.8.4 --no-cleanup
System Requirements
The update command validates these requirements before proceeding:
- Operating system: AlmaLinux or RHEL
- RAM: Minimum 7GB (8GB for v0.8.4+)
- Disk: Minimum 10% free space
- Docker: Version 26 or higher
If the preflight reports an unsupported operating system (such as CentOS Stream 9) or unreachable package repositories, use
--skip-preflight (bypasses all preflight gates) or --ignore-os-check (bypasses only the OS check) only as a temporary workaround for the current upgrade. The
underlying OS remains unmodified. Plan to migrate the appliance to
AlmaLinux or RHEL for long-term supported upgrades. See
Appliance Backup & Disaster Recovery.
You can apply the workaround with the updater:
# Bypass all preflight safety gates
sudo ct update --skip-preflight
# Or bypass only the operating system check
sudo ct update --ignore-os-check
Rollback
Restore the previous docker-compose configuration from the most recent
pre-upgrade snapshot. This changes the application configuration only; restore
database contents separately with ct db restore.
sudo ct rollback
Snapshots are automatically created before each upgrade in
/home/calltelemetry/backups/.
Update the native CLI
The native CLI can be updated independently:
sudo ct selfupdate
User Management
Reset an Administrator Password
From the Call Telemetry installation directory, list the users to locate the account and confirm its exact email address:
sudo ct users list
The table includes each user's ID, email, primary role, complete role list, and last login.
Reset the selected account by email address:
sudo ct users reset-password 'admin@example.com' 'new-password'
The command requires exactly one email address and one new password, changes the password immediately, and does not send an email. Quote passwords that contain spaces or shell characters.
Syslog Receiver
Syslog remains an optional profile. Changing its port does not enable the
receiver. The appliance defaults to external UDP and TCP port 514; use a
different port, such as 5514, when the network or an existing service
requires it.
# Show the configured receiver port
sudo ct syslog port
# Set the external UDP and TCP receiver port
sudo ct syslog port 5514
The setting is saved in the appliance .env as SYSLOG_PORT. If syslog is
already enabled, the command recreates only ct-syslog-ingest so the new
mapping applies immediately. The service continues to listen on port 514
inside Docker.
Enable the optional profile separately when needed:
sudo ct syslog enable
The interactive TUI exposes the same setting under Tools → Syslog.
Database Operations
The ct db surface is organized into three semantic groups. Every legacy
command (ct db backup, ct db compact, …) keeps working unchanged as a
flat alias; the grouped form is preferred and carries risk hints in
ct help.
Database Maintenance (service-changing)
# Vacuum a single table (plain: safe, online)
sudo ct db maintenance vacuum cube_event_logs
# Vacuum with disk reclaim — locks the table for the duration
sudo ct db maintenance vacuum cube_event_logs --full
# Refresh planner statistics
sudo ct db maintenance analyze
# Docker cleanup + whole-database VACUUM FULL
sudo ct db maintenance compact
vacuum --full takes an exclusive lock on the target table and prompts for
confirmation on a terminal. compact runs VACUUM FULL on every table and
takes an exclusive lock on the whole database — run it in a maintenance
window. Both print per-table row counts and support
CT_DB_VACUUM_LOCK_TIMEOUT / CT_DB_COMPACT_LOCK_TIMEOUT lock budgets.
Database Data (backups and retention)
# Backup / restore
sudo ct db data backup
sudo ct db data restore /home/calltelemetry/backups/<file>.sql
# Timestamp purge (batched DELETE; supports retention groups)
sudo ct db data purge cdr_records 90 --yes
# List optimized and truncate groups
sudo ct db data purge-groups
Database Inspection (read-only)
sudo ct db inspect size # database size
sudo ct db inspect tables # per-table row counts and disk usage
sudo ct db inspect list # available backups
sudo ct db inspect report # comprehensive storage + database report
sudo ct db audit # retention & capacity audit with headroom projection
Retention & Capacity Audit (ct db audit)
ct db audit answers the two disk questions that matter on an appliance: is any
table past its configured retention or size limit, and how many days of growth
are left before the disk gets tight. It is fully read-only — safe to run at any
time.
sudo ct db audit # audit every monitored table
sudo ct db audit --warn # only tables that need attention
sudo ct db audit --table cdrcalls
sudo ct db audit --json # machine-readable output
TABLE ACTUAL SIZE MAX LIMIT SIZE USAGE OLDEST DATA RETENTION HEADROOM STATUS
cdrcalls 18.4 GB 25.0 GB ███████░░░ 73% 28d 30d 41d ✓ PASS
cube_event_logs 12.1 GB 10.0 GB ██████████ 121% 45d 30d 9d ✗ OVER SIZE
Disk: 21.0 GB used of 64.0 GB (33%) — headroom to 70%: 23.8 GB; sustainable pool: 19.0 GB
Projection: ~38d of write headroom at the current aggregate rate (512.0 MB/day)
HEADROOM is the number of days the table can keep growing at its measured
write rate before the data filesystem crosses 70% used. ∞ means the table is
not growing; -- means growth could not be measured. The estimate is
deliberately conservative: it measures each table's write rate two ways (insert
counters and the retained-data window), uses the larger figure, apportions each
table a share of the free space below 70%, and holds a 20% reserve out of the
projection. It reports sustainable days — it never prescribes a retention value
for you.
Statuses, worst first:
| Status | Meaning |
|---|---|
✗ OVER SIZE | Past its configured size limit |
✗ UNCONFIGURED | Over 50 MB with no retention policy at all — grows unbounded |
⚠ RETENTION EXCEEDED | Oldest row is older than the configured retention — purge is behind |
⚠ SIZE WARN | Above its warning threshold, under the hard limit |
⚠ PURGE STALLED | The purge engine has not touched the table in over 48 hours |
⚠ NO CHUNK POLICY | TimescaleDB hypertable without an automatic chunk-drop policy |
✓ PASS | Within size and retention limits |
Interactive what-if
When a terminal run of ct db audit flags a table that cannot hold its
configured retention, it offers a walkthrough, worst table first. For each
table you type a candidate retention in days, the projection re-runs instantly
(projected footprint, headroom share, sustainable days), and only after you
confirm yes/NO does anything change: the new retention is applied, the purge
engine catches the table up to it, and a reclaim is offered to hand the freed
space back to the filesystem. Declining at any prompt changes nothing.
The same remediation non-interactively:
sudo ct db audit --set-policy cube_event_logs --retention-days 30 --yes
--max-size-mb <mb> sets a size cap alongside the retention. --fix runs
guided remediation for every flagged table, and --dry-run previews the
actions without changing the database.
Reclaim Disk Space (ct db reclaim)
Deleting rows lets Postgres reuse the space internally, but df does not move
— ct db reclaim hands the space back to the filesystem. Per table, it picks
the safest method for the table's shape:
sudo ct db reclaim cube_event_logs --dry-run # print the plan, change nothing
sudo ct db reclaim cube_event_logs --yes
sudo ct db reclaim cdrcalls --before 2026-09-01 --yes
| Table shape | Method used |
|---|---|
| Partitioned table (the record tables on current releases) | Drop partitions that fully closed before --before YYYY-MM-DD — instant, needs no free space |
Ordinary table, pg_repack installed | Online rebuild — only a brief exclusive lock at the end |
Ordinary table, no pg_repack | VACUUM FULL — exclusive lock for the whole rewrite; runs only when free space is at least ~1.2× the table size |
Two safety rules apply on every path:
- Refused tables. System bookkeeping (
schema_migrations,oban_*,purge_*configuration/history,orgs,users) is refused outright — the application owns it. The record tables (cdrcalls,cmr_records,curri_events,reputation_signals,alarm_events) are never rewritten; on partitioned schemas reclaim them with--beforeinstead. - Free-space gate. A rewrite needs roughly a full copy of the table in free space, so it is refused up front rather than failing half-written. The refusal prints how much space is needed.
Every run prints the table size and the free space on the data filesystem
before and after, so you can see exactly what came back. While a long rewrite
runs, a monitor warns if free space drops — and Ctrl-C is safe: the rewrite
rolls back.
| Option | Description |
|---|---|
--dry-run | Print the method and fit check; change nothing |
-y, --yes | Skip the confirmation prompt (required for scripted drops) |
--before YYYY-MM-DD | Partition-drop cutoff for partitioned tables |
--no-repack | Never use pg_repack, even when installed |
--release-reserve | When nothing fits, release the emergency disk reserve and check again |
sudo ct db maintenance vacuum <table> --full (flat alias ct db vacuum <table> --full) runs the same engine.
Whole-Run CURRI Reclaim
sudo ct db reclaim --yes
With no table argument, ct db reclaim is a maintenance window for the CURRI
event tables. It stops the web service — CURRI is offline and CUCM applies
its External Call Control "call treatment on failure" setting to every call —
rewrites the CURRI tables smallest first so freed space can let the next table
fit, and always restarts web afterward. Run it in a maintenance window.
Backup
Create a timestamped SQL dump of the database:
sudo ct db backup
Only the 5 most recent backups are retained. Download critical backups before they are automatically purged.
Backups are stored in /home/calltelemetry/backups/ with format: calltelemetry_prod_YYYYMMDD_HHMMSS.sql.
Restore
Restore database from a backup file:
sudo ct db restore /home/calltelemetry/backups/calltelemetry_prod_20250119_143022.sql
Every command above also accepts the legacy flat form — sudo ct db backup,
sudo ct db restore, sudo ct db compact, sudo ct db vacuum <tbl>,
sudo ct db purge <tbl|group> <days>, sudo ct db size, sudo ct db tables
— with identical behavior. The grouped forms add semantic clarity and risk
hints; run sudo ct db or sudo ct help to see the full grouped layout.
PostgreSQL Major Version Upgrade
Fresh Call Telemetry OVA appliances ship with PostgreSQL 18 (calltelemetry/postgres:18 with TimescaleDB 2.30.2, pg_ivm 1.14, and pg_partman 5.4.3). Existing 0.8.6 appliances remain on PostgreSQL 14 during standard sudo ct update runs so routine software updates never trigger an unscheduled major database migration.
To upgrade an existing appliance from PostgreSQL 14 to PostgreSQL 18 during a maintenance window:
# 1. Validate free disk space and verify extension compatibility without stopping services
sudo ct postgres upgrade 18 --dry-run
# 2. Execute the PostgreSQL 14 -> 18 major version upgrade
sudo ct postgres upgrade 18 --yes
# Optional: exclude high-volume diagnostic/debug tables from pg_dump to accelerate the upgrade
sudo ct postgres upgrade 18 --skip-logs --yes
# 3. Verify database, TimescaleDB, migrations, and container health
sudo ct doctor
During ct postgres upgrade 18, the CLI:
- Creates a compressed SQL backup (
postgres-upgrade-<timestamp>.sql.gz). - Stops appliance containers and isolates the original PostgreSQL 14 volume at
postgres-data.v14-<timestamp>.bak. - Starts PostgreSQL 18, restores the database and extensions (
timescaledb,pg_ivm,pg_stat_statements,pgstattuple), updatesPOSTGRES_IMAGE_TAG=18in.env, and restarts all services.
To revert to the isolated pre-upgrade PostgreSQL data volume if needed:
sudo ct postgres rollback --yes
sudo ct doctor
Migration Status
Monitor migration progress:
# Check current status
sudo ct migrate status
# Watch continuously
sudo ct migrate watch
ct migrate watch continues polling until interrupted. Press Ctrl+C to stop
watching without changing migration state.
SQL Migration Status
View last 10 applied migrations directly from database:
sudo ct migrate history
Run Migrations
Execute all pending migrations:
sudo ct migrate run
Rollback Migrations
Rollback a specified number of migrations:
# Rollback last migration
sudo ct migrate rollback 1
# Rollback last 3 migrations
sudo ct migrate rollback 3
Long-Running Migrations & Live SQL Watch
Database migrations during version upgrades run with unlimited query and session timeouts (idle_in_transaction_session_timeout = 0) to prevent operations from aborting prematurely on large tables or index rebuilds.
If migrations take 3 minutes or longer during ct update or manual migration runs, the CLI automatically engages an active SQL monitor:
- Active SQL Activity: Displays queries currently executing in PostgreSQL, with query parameters automatically masked for privacy.
- Container CPU %: Shows real-time CPU utilization of the database container to verify that migrations are actively making progress.
PostgreSQL Connection Profile
ct postgres profile sets a t-shirt-sized connection and pool sizing
tier — PG_MAX_CONNECTIONS and the per-repo DB_*_POOL_SIZE env keys. It
does not choose memory settings. Show the current tier, detected host
sizing, and a recommendation:
sudo ct postgres profile show
show prints detected host RAM and vCPU count, the currently applied
profile, a recommended profile based on that RAM, the current
connection/pool values, and — if the applied profile no longer matches the
detected host RAM — a warning naming the exact command to fix it.
Apply a tier:
sudo ct postgres profile small # ~8GB hosts
sudo ct postgres profile medium # ~12GB hosts
sudo ct postgres profile large # ~16GB hosts
Applying a profile restarts the db container to pick up the new values.
The profile name selects connection/pool sizing only. PostgreSQL memory
settings (shared_buffers, work_mem, and the DB container's memory limit)
are derived from detected host RAM alone, independent of which profile
name is applied — there is no per-profile memory table. Every ct postgres profile <tier> run re-derives those memory settings from the host RAM
present at that moment, alongside the connection/pool values for the chosen
tier.
ct postgres profile manages the main, migration, call-control, background,
discovery, Oban, CDR-ingest, and SFTPD connection pools. The backend also
defines several lower-traffic pools that this command does not touch and
that keep their independent fixed defaults regardless of applied profile:
analytical-rollup (DB_ANALYTICAL_ROLLUP_POOL_SIZE, default 2), CUBE
telemetry (DB_CUBE_TELEMETRY_POOL_SIZE, default 2), maintenance DDL
(DB_MAINTENANCE_DDL_POOL_SIZE, default 2), reporting
(DB_REPORTING_POOL_SIZE, default 2), auth (DB_AUTH_POOL_SIZE, default 2),
post-call (DB_POST_CALL_POOL_SIZE, default 2), and XCC rollup
(DB_XCC_ROLLUP_POOL_SIZE, default 2). Set any of these directly in .env
if a specific workload needs a larger pool.
Resizing after a RAM increase
ct update, ct restart, and offline apply establish memory settings on
an appliance that has never been tuned. On one that already has them, those
commands deliberately do not change memory as a side effect of a version
bump — instead, if the tuned memory no longer matches detected host RAM,
they print an advisory naming the exact ct postgres profile <tier> command
to run. Applying a profile is the explicit, auditable step that re-derives
memory. To resize a running appliance after adding RAM in the hypervisor:
- Grow the VM's RAM allocation (and reboot the guest OS if the hypervisor requires it for the new RAM to be visible to the appliance).
- Run
sudo ct postgres profile <tier>for the tier that matches the new RAM total — for examplesudo ct postgres profile mediumafter growing an 8GB appliance to 12GB. - The command re-derives
shared_buffers/work_mem/the DB memory limit from the newly detected RAM, applies the tier's connection/pool sizing, and restarts thedbcontainer.
Confirm the result with sudo ct postgres profile show — the detected RAM,
applied profile, and recommendation should now agree, with no warning.
PostgreSQL Major Version Upgrade
The ct postgres upgrade command automates major PostgreSQL version upgrades (e.g. PostgreSQL 14 → 15) natively without requiring any manual file editing or docker commands.
Also available via aliases ct appliance upgrade-postgres <version> and ct db upgrade <version>.
Phase 1: Preflight Sizing & Extension Validation
Always run with --dry-run first to verify compatibility while services continue running:
# Verify target image, installed TimescaleDB extensions, and disk headroom without stopping services
sudo ct postgres upgrade 15 --dry-run
The preflight check:
- Verifies that the target image is officially supported and reachable (
14,15,16,17,18). - Checks that the host filesystem has sufficient free disk headroom (≥ 2.5x database size).
- Connects to the database and verifies TimescaleDB extension catalog status.
Phase 2: Fully Automated Execution
When preflight checks pass, execute the upgrade:
# Automated upgrade (creates backup, isolates old volume, applies override, boots PG 15, restores data)
sudo ct postgres upgrade 15
# Accelerated upgrade skipping voluminous diagnostic/debug logs
sudo ct postgres upgrade 15 --skip-logs --yes
| Flag | Description |
|---|---|
--dry-run | Validates target image, installed TimescaleDB extensions, and disk headroom without taking down services |
--skip-logs, --no-logs | Excludes debug event tables and user activity logs from the upgrade backup to accelerate completion |
--yes, -y | Confirms execution without interactive countdown prompt |
The automated execution pipeline:
- Downloads the official version override (e.g.
postgres-15.yaml) intodocker-compose.override.yml, saving the previous override topostgres-override.v<oldVer>-<ts>.bak. - Creates a pre-upgrade compressed backup into
/var/backups/. - Quiesces active services (
docker compose down). - Isolates the previous data volume into
postgres-data.v<oldVer>-<ts>.bak. - Starts the new PostgreSQL engine and executes
timescaledb_pre_restore(). - Restores the database with multi-core parallelism and re-enables background workers (
timescaledb_post_restore()). - Resumes all services and verifies
pg_isreadyhealth.
PostgreSQL Rollback Plan
If any unexpected application behavior occurs after upgrading, CallTelemetry provides an automated, zero-touch rollback command:
# Interactive rollback (discovers latest volume backup and prompts for confirmation)
sudo ct postgres rollback
# Non-interactive rollback (for automation or instant recovery)
sudo ct postgres rollback --yes
Also available via aliases ct appliance rollback-postgres and ct db rollback.
The rollback engine:
- Automatically discovers the newest preserved backup volume (
postgres-data.v<oldVer>-<ts>.bak). - Quiesces all running services (
docker compose down). - Preserves the aborted volume to
postgres-data.v<curVer>-aborted-<ts>.bakso no data is destroyed. - Swaps the previous data volume back into
postgres-data. - Reverts
docker-compose.override.ymlbyte-for-byte frompostgres-override.v<oldVer>-<ts>.bak. - Restarts all services (
docker compose up -d) and verifies database connectivity.
For moving to a new virtual machine or deploying a fresh OVA, use the Appliance Archive Workflow (ct appliance export → ct appliance import). See Appliance Backup & Disaster Recovery.
Appliance Archives & Disaster Recovery (ct appliance & ct backup)
CallTelemetry Appliance Archives (.cta) provide complete, self-contained disaster recovery bundles. While standard database dumps (ct db backup) only capture SQL tables, an appliance archive captures everything needed to reconstruct an appliance on a fresh host or migrate between virtual machines:
- Full Database Dump (
calltelemetry_prod.dump): Custom binary format export covering all PostgreSQL relational schemas, tables, and TimescaleDB hypertables. - Secrets Vault (
secrets.jsonorsecrets.env.enc): CapturesCLOAK_KEY, database passwords, web session credentials, and integration secrets. Instandardmode, the default archive is integrity-sealed but unencrypted, and secrets are stored insecrets/secrets.jsonwith SHA-256 manifest integrity. Supplying--encrypt,--passphrase-file, orCT_BACKUP_PASSPHRASEencrypts the entire.ctastream with AES-256-GCM and PBKDF2-HMAC-SHA-256 (600,000 iterations). Insecuremode, archive encryption is mandatory, and an export without passphrase material fails closed with exit status64. - Appliance Manifest (
manifest.json): Source version, git commit, table catalog estimates, and SHA-256 integrity checksums for every component. - Media & Object Storage (
media.tar.gz,seaweedfs-data.tar.gz): Included by default unless excluded with--skip-mediaor--skip-storage.
Appliance operations automatically maintain parity between the primary Docker Compose environment file (/home/calltelemetry/.env) and /etc/calltelemetry/.env. Restored secrets are safely synchronized across both locations during restoration.
Non-Blocking Row Estimation (Zero Table Locks)
To prevent locking or degrading performance on high-throughput production appliances (such as systems with 80M+ CDR rows), ct appliance export and ct appliance inspect query PostgreSQL's internal catalog statistics (pg_class.reltuples and pg_total_relation_size).
- Instantaneous metadata: Catalog statistics return in ~10ms with zero row scanning.
- No
COUNT(*)locking: Never issues sequential table scans or read locks on active production tables.
Table Progress & Diagnostic Session Logging
Both export and import operations provide real-time table-by-table progress reporting and comprehensive session diagnostic logging:
- Multi-step progress bars: Structured series tracking each operational phase (pre-restore catalog preparation, schema extraction, table data streaming, TimescaleDB worker restart).
- Session log file: Every operation writes raw tool output to
/var/calltelemetry/db_dumps/appliance-export-<timestamp>.logor/var/calltelemetry/db_dumps/appliance-restore-<timestamp>.log. - Actionable failure diagnostics: If an export or restore fails (e.g. disk exhaustion or network timeout), the CLI immediately presents the exact file path and the command to view it:
Followed by recommended next steps like runningcat /var/calltelemetry/db_dumps/appliance-restore-2026-09-04-123456.log
sudo ct doctor.
Export Appliance Archive (ct appliance export)
For detailed step-by-step procedures, architecture deep dives, and remote storage automation, see the dedicated Appliance Backup & Disaster Recovery guide.
Create a .cta disaster recovery archive: a CTAV2 envelope around a compressed tar payload. By default, the export packages the full PostgreSQL database (including policy history, call records, and TimescaleDB hypertables), the secrets vault, enterprise TLS certificates (./certs/), configuration files (seaweedfs-s3.json, Caddyfile), audio media assets (./media/), and SeaweedFS object storage:
# Default full-data export (standard mode: integrity-sealed, unencrypted; secure mode requires encryption)
sudo ct appliance export
# Encrypt the entire archive interactively (AES-256-GCM)
sudo ct appliance export /backups/calltelemetry-appliance-2026-09-04.cta --encrypt
# Read passphrase from a secured file (recommended for cron jobs, automation, and secure mode)
sudo ct appliance export /backups/appliance.cta --passphrase-file /root/.vault_passphrase
# Skip voluminous debug events and user activity logs while preserving all call records and schemas
sudo ct appliance export --skip-logs
# Configuration-only export: skip all call records, CURRI events, CDRs, Teams call data, and debug logs
sudo ct appliance export --skip-data
# Skip media files for a lightweight archive
sudo ct appliance export --skip-media
# Skip SeaweedFS storage volume
sudo ct appliance export --skip-storage
# Export and upload directly to remote SFTP storage
sudo ct appliance export sftp://backupuser@storage.example.com/backups/ \
--key /root/.ssh/id_ed25519 \
--host-key-sha256 SHA256:AbCdEf0123456789+/=
# Dry-run: inspect estimated tables, sizes, and row counts without dumping
sudo ct appliance export --dry-run
| Argument or Flag | Description |
|---|---|
--encrypt | Encrypt the entire .cta stream with AES-256-GCM (prompts interactively if no passphrase source or CT_BACKUP_PASSPHRASE is set; mandatory in secure mode) |
--passphrase-file <path> | Read encryption passphrase from a local 0600 file (enables full-stream AES-256-GCM) |
--skip-logs, --no-logs | Exclude diagnostic debug tables, webhooks, and user activity logs. Retains policy history and call records. |
--skip-data, --config-only, --no-data | Exclude policy history, call records, CURRI events, CDRs, Teams data, and logs. Creates a configuration-only archive. |
--skip-media, --no-media | Omit /home/calltelemetry/media directory (included by default) |
--skip-storage, --no-storage | Omit SeaweedFS S3 storage volume (included by default) |
destination | Local path or SFTP URL (sftp://... only; remote exports stage locally before upload) |
--host-key-sha256 <fp> | Pin expected SSH server host-key fingerprint (SHA256:...) for remote SFTP upload |
-i, --key <path> | Path to SSH private key for remote SFTP upload |
--upload | Stream the generated .cta archive directly to Call Telemetry Support using 50 MB chunked multipart transport (see Support Upload Procedures) |
--clean-local | Remove the local .cta archive during remote upload, including if the upload fails. Leave unset to retain a local recovery copy. |
--dry-run | Query catalog row estimates and report archive plan without creating files |
sudo ct backup run, sudo ct backup export, and sudo ct backup create function as direct aliases for ct appliance export.
Inspect Archive (ct appliance inspect)
Examine an archive's manifest, source version, estimated table row counts, certificates, configs, and secret keys without restoring (pass --verify to recompute database/calltelemetry_prod.dump SHA-256 against manifest.json):
sudo ct appliance inspect /backups/calltelemetry-appliance-2026-09-04.cta
sudo ct appliance inspect /backups/calltelemetry-appliance-2026-09-04.cta --verify
Example output:
=== CallTelemetry Appliance Archive Inspection ===
Archive: calltelemetry-appliance-2026-09-04.cta
Envelope: CTAV2 (format 2.0)
Cipher: AES-256-GCM (encrypted)
KDF: pbkdf2-hmac-sha256 (600000 iterations, 16-byte salt, 32-byte key)
Key Slots: 1: passphrase
Created At: Thu, 04 Sep 2026 12:00:00 UTC
Appliance Version: 0.8.7
Format Version: 1.0
Component Summary:
- Database: database/calltelemetry_prod.dump (4.12 GB, ~84.1M estimated records)
Format: pg_dump_custom (multi-core parallel restore compatible)
SHA-256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Key Tables (from pg_class catalog):
cdrcalls ~84,120,400 rows
cmr_records ~12,450,200 rows
cube_event_logs ~3,200,100 rows
curri_events ~850,000 rows
orgs ~12 rows
users ~45 rows
- Secrets Vault: secrets/secrets.env.enc (AES-256-GCM, PBKDF2-SHA256)
Keys Secured: CLOAK_KEY, POSTGRES_PASSWORD, SECRET_KEY_BASE, GUARDIAN_SECRET_KEY
- Certificates: certs/certs.tar.gz (3 files, 14 KB)
- Config Files: configs/configs.tar.gz (seaweedfs-s3.json, Caddyfile, 4 KB)
- Media Assets: media/media.tar.gz (48 files, 142 MB)
- S3 Storage: storage/seaweedfs-data.tar.gz (1.8 GB)
✓ Archive structure and manifest verified successfully.
sudo ct backup inspect <archive> functions as a direct alias for ct appliance inspect.
Restore Appliance Archive (ct appliance import)
Perform a full appliance restore from a .cta archive. This restores the database, reconfigures TimescaleDB hypertables, adopts credentials, restores enterprise certificates, configs, media assets, and SeaweedFS storage, and restarts all services.
# Interactive restore (prompts for confirmation, plus passphrase if the archive is encrypted)
sudo ct appliance import /backups/calltelemetry-appliance-2026-09-04.cta
# Automated non-interactive restore with passphrase file
sudo ct appliance import /backups/calltelemetry-appliance-2026-09-04.cta --passphrase-file /root/.vault_passphrase --yes
# Restore directly from remote SFTP storage
sudo ct appliance import sftp://backup_user@192.168.10.50/backups/calltelemetry-appliance-2026-09-04.cta \
--key /root/.ssh/id_ed25519 \
--yes
| Flag | Description |
|---|---|
--passphrase-file <path> | Read decryption passphrase from a local 0600 file |
--allow-unencrypted | In secure mode, explicitly permit importing an unencrypted standard-mode .cta archive |
--host-key-sha256 <fp> | Pin expected SSH server host-key fingerprint (SHA256:...) when importing from sftp:// |
--yes, -y | Skip interactive confirmation prompt |
--force | Bypass version compatibility check |
Automated 7-Step Restoration Sequence
- Unpacking & Manifest Verification: Validates archive integrity against embedded SHA-256 checksums across all components (database, secrets, certs, configs, media, storage).
- Pre-flight Decryption: When the archive is encrypted, verifies the passphrase and validates the sealed payload before taking down any running services. If the passphrase is wrong, no changes occur.
- Service Quiescing: Safely stops worker containers (
web,nats,jtapi-sidecar,ct-media,seaweedfs). - TimescaleDB Pre-Restore Hook: Terminates active PostgreSQL connections and executes
timescaledb_pre_restore()to disable background hypertable workers. - Database Restoration: Executes
pg_restore -vwith live table progress reporting and writes full diagnostics to the session log. - Asset Restoration & Credential Adoption: Restores configuration files (
seaweedfs-s3.json,Caddyfile), enterprise TLS certificates (./certs/), audio media (./media/), and SeaweedFS object storage volume. Re-enables TimescaleDB background workers (timescaledb_post_restore()) and writes restored secrets (CLOAK_KEY, passwords) to/home/calltelemetry/.envand/etc/calltelemetry/.env. A full archive then refreshes materialized views, including Policy History, from the restored tables. A configuration-only archive skips that refresh and says so. - Service Startup & Health Validation: Launches services with
docker compose up -dand validates database readiness withpg_isready.
sudo ct backup import <archive> and sudo ct backup restore <archive> function as direct aliases for ct appliance import.
Automated Recurring Backups (ct backup schedule)
Manage automated recurring .cta disaster recovery archives (or database-only .dump backups via --kind db) using native Linux systemd timers:
# View active schedule, timer status, and next scheduled backup
sudo ct backup schedule
# Enable daily backup at 02:00 UTC, keeping the newest seven local archives
sudo ct backup schedule enable --calendar "*-*-* 02:00:00 UTC" --target /var/backups/ --retention 7
# Enable weekly backup to remote SFTP with log filtering and local staging cleanup
sudo ct backup schedule enable weekly --day sun --time 03:00 \
--target sftp://backupuser@storage.corp.lan/backups/ \
--retention 4 \
--skip-logs \
--clean-local
# Enable daily PostgreSQL-only (.dump) schedule instead of full .cta archives
sudo ct backup schedule enable daily --time 01:30 --kind db --target /var/backups/ --retention 14
# Test scheduled backup immediately on demand
sudo ct backup schedule run
# View scheduled backup execution history and journal logs
sudo ct backup schedule log
# Disable automated backups
sudo ct backup schedule disable
sudo ct appliance schedule-backup functions as a direct alias for ct backup schedule.
Cadence shortcuts with --time create a systemd calendar without a timezone suffix. Check the host timezone and the next scheduled run, or use an explicit timezone in --calendar. Retention applies to local archives; configure remote retention on the backup server. A scheduled backup includes the full database unless the schedule was enabled with --skip-data or --skip-logs. See Schedule Recurring Backups for the full procedure.
System Maintenance
Compact
Comprehensive cleanup including Docker system prune and PostgreSQL VACUUM FULL.
Prefer the grouped form sudo ct db maintenance compact; sudo ct db compact
remains a working alias:
sudo ct db maintenance compact
This command:
- Removes stopped containers
- Removes unused networks and volumes
- Removes dangling images
- Runs PostgreSQL VACUUM FULL on all tables
Run this monthly or when disk space is low, in a maintenance window. The operation takes an exclusive lock on the whole database and may take several minutes on large tables.
Purge
Remove unused Docker resources only (lighter than compact):
sudo ct docker prune
Removes:
- Stopped containers
- Unused networks
- Unused volumes
- Dangling images (retains images from last 24 hours)
Reset
Factory reset - stops services and deletes all data:
sudo ct reset
This command permanently deletes:
- SFTP data
- PostgreSQL database
- All backups
The application restarts in factory state. This cannot be undone.
Enterprise SSL/TLS Certificates
Manage appliance TLS certificates for the web admin portal, Caddy reverse proxy, and enterprise CA trust store.
View Certificate Status
Inspect active certificates, validity windows, issuer, and Subject Alternative Names:
sudo ct certs status
Generate Certificate Signing Request (CSR)
Generate a private key and CSR to submit to your enterprise Certificate Authority (Microsoft CA, Active Directory CS, etc.):
sudo ct certs csr --cn appliance.corp.local --san appliance.corp.local,appliance,10.0.1.5
The CSR and generated private key are saved in /home/calltelemetry/certs/.
Import Enterprise Certificate
Validate and install an enterprise-signed certificate with its private key and optional intermediate chain:
sudo ct certs import \
--cert /home/calltelemetry/certs/appliance.crt \
--key /home/calltelemetry/certs/appliance.key \
--chain /home/calltelemetry/certs/chain.crt
The CLI verifies that:
- The certificate and private key match.
- The certificate is currently valid (not expired or not yet valid).
- The certificate chain resolves cleanly.
Upon validation, certificates are atomically deployed and the web proxy is reloaded without dropping active calls.
Add Internal CA to Trust Store
Install your organization's root or intermediate CA into the appliance operating system trust store so outbound TLS connections (such as CUCM AXL, Tomcat, or LDAPS) succeed without certificate verification errors:
sudo ct certs trust add /home/calltelemetry/certs/Enterprise-Root-CA.pem
Reset Certificates
Delete existing certificates and regenerate fresh self-signed SSL certificates for appliance portals:
sudo ct certs reset
Use --yes for non-interactive automation. Without it, an interactive terminal prompts for confirmation.
For UI-based CSR generation and browser upload workflows, see SSL Certificates for Call Telemetry Appliance.
Database Troubleshooting
Table Sizes
View row counts and disk usage:
# All tables
sudo ct db inspect tables
# Specific table filter
sudo ct db inspect tables cdr_records
Purge Old Records
Timestamp-batched DELETE of rows older than the given days (requires an
inserted_at/timestamp column; optimized paths exist for known tables):
# Delete CDR records older than 90 days
sudo ct db purge cdr_records 90 --yes
# Purge by retention group (lists groups with: ct db purge-groups)
sudo ct db purge cube 7 --yes
sudo ct db purge-ct-events 7 --yes
Truncate Groups (wholesale, unbounded)
Debug and diagnostic log tables have no retention requirement. Truncate groups
run a wholesale TRUNCATE and are dramatically faster than batched DELETEs on
large tables. They are unbounded — no days argument — and require --yes:
# Debug/diagnostic payloads: CURRI debugs, responses, and post-call events;
# XCC mirror; cube + CDR webhook logs; workflow webhook requests; cube
# recovery failures; phone discovery runs/logs; phone state changes and
# registration snapshots
sudo ct db data purge truncate-debug --yes
# CUBE/XCC event logs only
sudo ct db data purge truncate-telemetry --yes
(Flat aliases: ct db truncate-debug, ct db truncate-telemetry.)
Before truncating, the run prints each table's row count and asks yes/NO;
non-interactive runs refuse without --yes and print the exact re-run
command. A df of the data filesystem prints before and after so you can see
the space actually returned.
curri_events and call_disconnect_metrics are deliberately not in any
truncate group — they are CURRI policy-decision records and per-call
analytics, not debug data. TRUNCATE removes all rows with no retention
window and no undo; to age those tables out, use a bounded purge instead:
ct db purge curri 30 --yes or ct db purge telemetry 30 --yes.
Offline / Air-Gapped Bundles
Build bundles on an internet-connected workstation with
Call Telemetry Appliance Manager
(macOS / Windows), or using the ct offline download command.
On the appliance, use offline apply / offline list after you stage or transfer a bundle.
For the full end-to-end workflow (download Manager → build → transfer → apply), see the Air-Gapped Appliance Upgrade guide.
Applying ISO or chunked bundles requires appliance CLI 0.8.7 or later. Remote sftp:// apply is supported natively in CLI 0.8.7+.
On-appliance Offline Commands
| Command | Description |
|---|---|
offline apply <bundle|dir|sftp-url> | Apply a bundle from a local archive, directory, mounted ISO, or remote SFTP server |
offline list | List images in the current docker-compose.yml and which are downloaded |
offline inventory [--output <file>] | Write inventory.json (version, profiles, local images) so a build host can package exactly what this appliance lacks |
offline inspect <bundle> | Print a bundle's manifest without applying it |
offline download [version] | Build an offline bundle on an internet-connected workstation, with optional SFTP upload |
Apply a Bundle
Run on the air-gapped appliance. offline apply performs the same full upgrade as the online update without manual .env editing.
1. Remote SFTP Storage
Deploy updates directly from a central SFTP file server without pre-staging files on the appliance disk. sftp:// is the only supported remote scheme:
# Direct SFTP pull (verifies host key via known_hosts; prompts for credentials if needed)
sudo ct offline apply sftp://backup.corp.local/bundles/calltelemetry-offline-0.8.6.30.tar.gz
# SFTP with SSH private key authentication and retaining downloaded file
sudo ct offline apply sftp://files.corp.local/builds/calltelemetry-offline-0.8.6.30.iso \
--user deploy --key /home/calltelemetry/.ssh/id_ed25519 --keep-download
# SFTP with explicit host-key fingerprint pinning
sudo ct offline apply sftp://files.corp.local/builds/calltelemetry-offline-0.8.6.30.tar.gz \
--user deploy --key /home/calltelemetry/.ssh/id_ed25519 \
--host-key-sha256 SHA256:AbCdEf0123456789+/=
2. Mounted ISO (Recommended for Appliance Manager)
sudo mkdir -p /mnt/cdrom
sudo mount -o loop calltelemetry-offline.iso /mnt/cdrom
sudo ct offline apply /mnt/cdrom
3. Local Folder / Extracted Directory
Apply directly from an uncompressed or extracted release directory:
sudo ct offline apply /home/calltelemetry/calltelemetry-build
4. Chunked ISO Parts
# Point to the first chunk; all sibling parts in the directory will be reassembled automatically
sudo ct offline apply calltelemetry-offline.iso.part-000
apply Options Reference
| Flag | Description |
|---|---|
--backup-db | Force a pre-upgrade database snapshot before applying changes |
--no-backup-db | Skip the pre-upgrade snapshot (default prompts on an interactive terminal) |
-u, --user <username> | Username for remote SFTP authentication |
-p, --password <secret> | Password for remote SFTP authentication (prompted securely if omitted) |
-i, --key <identity_file> | Path to SSH private key for remote SFTP authentication |
--host-key-sha256 <fp> | Pin expected SSH server host-key fingerprint (SHA256:...) for remote SFTP download |
--keep-download | Retain downloaded archive in /home/calltelemetry/ after remote apply (default cleans up) |
offline apply verifies SHA-256 checksums before loading images. A pre-upgrade configuration snapshot is created before replacing active configs. To revert configuration, use sudo ct rollback (the snapshot timestamp is printed on failure). Restore database contents separately with sudo ct db restore <file>.
Download and Upload Bundles (offline download)
On an internet-connected workstation, ct offline download can build release bundles and optionally upload them directly to internal SFTP storage:
# Build a standard tar.gz bundle for a specific version
ct offline download 0.8.6.30-rc11
# Build and immediately upload to central SFTP file share, cleaning up local files
ct offline download 0.8.6.30-rc11 \
--upload sftp://deploy@files.corp.local/bundles/ \
--clean-local
# Build as a single ISO with specific compose profiles
ct offline download 0.8.6.30-rc11 --format iso --profiles jtapi,syslog
# Split into 2GB chunks for FAT32 or file size restrictions
ct offline download 0.8.6.30-rc11 --chunk-size 2G
Object Storage
SeaweedFS object storage is on by default. It holds greeting audio, call recordings, and alert PDF archives. See Air-Gapped Installation for the full workflow on an isolated network.
| Command | Description |
|---|---|
sudo ct storage status | Show whether storage is enabled |
sudo ct storage enable | Enable storage and start SeaweedFS. If the image is missing and the registry is unreachable, it stops before changing anything and names the image. |
sudo ct storage disable | Turn storage off and record the choice so updates and restarts keep it off |
sudo ct storage load <seaweedfs-image.tar> | Load a saved SeaweedFS image, verify it matches the installed compose file, then enable storage |
ct bootstrap-admin <email> <password> --no-storage and ct factory-reset --no-storage skip the storage attempt for that run and leave storage off.
Run sudo ct doctor to check storage. The Storage check flags settings that disagree, a missing image, a stopped container, and an unreachable DNS resolver.
Configuration
Logging Level
Modify the logging level in docker-compose.yml and restart services:
sudo ct logging debug
Available levels:
debug- Verbose logging for troubleshootinginfo- Normal operational logging (default)warning- Warnings and errors onlyerror- Errors only
Advanced Operations
Build Appliance
Download and execute appliance initialization script:
sudo ct build-appliance
Prepare Cluster Node
Configure node for Kubernetes deployment:
sudo ct prep-cluster-node
This command:
- Disables firewall and SELinux
- Installs kubectl, helm, and K9s
- Installs Git
Diagnostics & Observability
Application Status (ct status)
ct status rolls up container, database, and service health. Its Purge &
Disk Health section reports the signals that decide whether the appliance can
hold its configured retention:
sudo ct status
=== Purge & Disk Health ===
✓ Purge: no failed runs in the last 24 hours
✓ Disk pressure: no emergency purges
⚠ 2 purge-enabled table(s) have no retention cap — they will grow unbounded
The section flags:
- Failed or retrying purge runs in the last 24 hours.
- The emergency disk-pressure purge — when the data disk falls below the emergency floor (~5 GiB or 10% free), the appliance deletes retention history early. An active or recent emergency purge is a warning, not a silent pass.
- The data disk measured against that floor.
- Purge-enabled tables with no retention cap — they grow unbounded.
- Issues found by the nightly purge audit.
When the database is down, or a signal does not exist on the installed release, the section reports it as unknown rather than showing a false ✓.
sudo ct status --verbose (or CLI_VERBOSE=1) adds detail lines: the last
purge run's state and time, free and total space on the data filesystem, the
names of uncapped tables, and the last purge audit timestamp.
Appliance Health Check (ct doctor)
Run active preflight sanity and health diagnostics across all appliance subsystems:
sudo ct doctor
ct doctor tests:
- Database pool connectivity: Ping database connection pool with latency metrics.
- Disk space: Verify free space across root and data partitions.
- NTP time synchronization: Verify clock drift against reference time sources.
- TLS certificate expiration: Alert on certificates nearing expiration within 30 days.
- System memory & CPU load: Check host memory saturation and container limits.
Service Container Logs (ct logs)
Stream or tail logs from appliance Docker compose services without manually running docker logs:
# Tail the primary web application logs
sudo ct logs web
# Follow logs in real-time
sudo ct logs web -f
# Tail the last 200 lines of JTAPI sidecar logs
sudo ct logs jtapi --tail 200
# View Caddy reverse proxy or NATS messaging logs
sudo ct logs caddy
sudo ct logs nats
Appliance Telemetry & Crash Reporting (ct telemetry)
Appliance telemetry helps Call Telemetry detect release migration issues, crash loops, and platform errors automatically to deliver faster fixes. Telemetry is opt-in and covers both the host CLI and appliance backend services.
Telemetry never transmits customer call data, CDRs, phone numbers, or passwords.
# Check current telemetry posture
ct telemetry status
# Enable appliance telemetry
sudo ct telemetry enable
# Disable appliance telemetry
sudo ct telemetry disable
When enabled, telemetry reports:
- CLI command execution outcomes and exit codes
- Database migration duration and failure diagnostics
- High-level system errors and unhandled exceptions
Storage & Cisco UC Connectivity
Test Remote Backup Storage (ct backup test)
Verify network reachability, SSH host-key trust, credentials, and write permissions for remote SFTP backup destinations before initiating backups or automated jobs:
# Test SFTP with interactive password masking (verifies host key via known_hosts)
sudo ct backup test sftp://backup_user@storage.example.com/backups/
# Test SFTP with an SSH private key
sudo ct backup test sftp://backup_user@storage.example.com/backups/ --key /path/to/private-key
# Test SFTP with explicit SSH host-key fingerprint pinning
sudo ct backup test sftp://backup_user@storage.example.com/backups/ \
--key /path/to/private-key \
--host-key-sha256 SHA256:AbCdEf0123456789+/=
backup test connects to the remote host, uploads a unique temporary probe file (.ct-backup-probe-<uuid>), verifies the file size and read access, and deletes the probe file, confirming full read/write/delete permissions.
Check Cisco UC Reachability (ct cucm check-ports)
Perform rapid TCP and UDP socket reachability checks against a Cisco Unified Communications Manager (CUCM) node:
sudo ct cucm check-ports 192.168.125.10
Validates critical Cisco UC communication ports:
- 8443 (TCP): AXL / Tomcat Administrative Web API
- 2748 (TCP): CTI Manager / JTAPI Provider port
- 6970 (TCP): TFTP over HTTP configuration service
- 514 (UDP/TCP): CDR / Syslog message export
Output presents clear [PASS], [WARN], or [FAIL] status along with measured socket latency.
License, Security Mode & Query Inspection
License Status & Two-Factor Activation (ct license)
Inspect the appliance license tier and phone quota, or activate a hardware-bound Premium (or time-bounded Demo) license using connected two-factor pairing or air-gapped .lic artifacts:
# Inspect license tier, active phone quota, hardware binding, and expiration
sudo ct license status
sudo ct license check --json
# Display the hardware-derived Factor 1 Appliance ID
sudo ct license id
# Connected two-factor pairing (displays Appliance ID + short-lived User Code for https://dash.calltelemetry.com/claim)
sudo ct license claim
# Air-gapped activation: generate request JSON, upload at https://dash.calltelemetry.com, then apply signed .lic
sudo ct license request --output ./ct-request.json
sudo ct license apply /path/to/calltelemetry.lic
ct license status displays:
- Organization: Licensed organization name.
- Tier:
Community,Demo,Enterprise, orPremium. - Phone Quota: Active registered phones vs. licensed capacity.
- Expiration: Expiration timestamp and remaining days.
Security Compliance Mode (ct security-mode)
Inspect or enforce hardened STIG compliance controls across .cta archive exports/imports and remote SFTP operations (see Application STIG Hardening):
# Inspect current mode, edition lock, and hardware-bound license compliance
ct security-mode status
ct security-mode status --json
# Enable secure mode on a standard appliance (requires active hardware-bound Premium or Demo license)
sudo ct security-mode enable
# Return a standard appliance to standard mode (exits with status 64 on STIG-edition appliances)
sudo ct security-mode disable
Active Database Queries (ct db active-queries)
Inspect currently executing non-idle queries from PostgreSQL's pg_stat_activity:
sudo ct db active-queries
Displays backend PID, client IP address, query state, elapsed execution duration, and query text. Designed for non-blocking read-only execution with zero locks on large tables.
Shell Autocompletion
Generate shell completion scripts or auto-install completion for the interactive shell:
# Generate completion script for your current shell
sudo ct completion bash
sudo ct completion zsh
sudo ct completion fish
# Load completions into current Bash session
source <(sudo ct completion bash)
# Load completions into current Zsh session
source <(sudo ct completion zsh)
Common Workflows
Upgrading with Safety Checks
# 1. Create backup before upgrade
sudo ct db backup
# 2. Run upgrade
sudo ct update
# 3. Monitor migration progress
sudo ct migrate watch
# 4. If issues occur, rollback
sudo ct rollback
Troubleshooting Disk Space
# 1. Audit retention and per-table headroom (read-only)
sudo ct db audit --warn
# 2. Purge or truncate what should not be kept
sudo ct db purge cdr_records 90 --yes
sudo ct db purge truncate-debug --yes
# 3. Return the freed space to the filesystem
sudo ct db reclaim <table> --dry-run # prints the method and fit check
sudo ct db reclaim <table> --yes
If the filesystem is already over 70% full, ct db audit reports 0d headroom
and ct status flags the emergency floor — reclaim immediately, or grow the
disk (ct disk grow after enlarging the virtual disk in the hypervisor).
Investigating Migration Failures
# 1. Check migration status
sudo ct migrate status
# 2. View recent migrations from database
sudo ct migrate history
# 3. Check application logs
sudo docker logs calltelemetry-web -f
# 4. Manually run migrations if needed
sudo ct migrate run
Full Appliance Disaster Recovery & Host Migration
Migrate an entire appliance to a new VM or restore after a disaster:
# 1. On source appliance: export complete archive (DB, certs, configs, media, storage, encrypted secrets)
sudo ct appliance export /backups/appliance-full.cta
# 2. Transfer archive to target appliance host (via scp, sftp, or mounted volume)
scp /backups/appliance-full.cta admin@new-appliance:/tmp/
# 3. On target appliance: inspect payload, table row estimates, and version
sudo ct appliance inspect /tmp/appliance-full.cta
# 4. Restore everything (quiesces services, restores DB, re-enables TimescaleDB, syncs .env)
sudo ct appliance import /tmp/appliance-full.cta --yes
# 5. Verify appliance health and connectivity
sudo ct doctor
sudo ct logs web --tail 50
See Also
- Upgrading Guide - Step-by-step upgrade procedures
- Air-Gapped Appliance Upgrade - Offline bundle workflow
- Kubernetes Deployment Guide - K8s deployment and updates