Skip to content

terrariumctl

terrariumctl is the main Terrarium control surface. It handles install, status, reconfiguration, proxy sync, IDP sync, backup export, and restore.

Top-Level Commands

CommandArgumentsDefaultsMeaning
terrariumctl installoptional flags, see belowinteractive modeInstalls or bootstraps Terrarium on the current host, including preflight verification for external OIDC and S3 when enabled.
terrariumctl statusnonen/aShows Terrarium service status, management endpoints, IDP mode, admin group, and the oauth2-proxy state.
terrariumctl backup listnonen/aLists local ZFS snapshots and, when enabled, S3 manifests.
terrariumctl backup exportnonen/aUploads the current incremental ZFS backup chain to configured S3 storage.
terrariumctl backup restorerequired: --instance; optional: --source, --at, --as-new--source local, latest restore point, in-place restoreRestores an instance either in place by default or as a new instance when --as-new is provided.
terrariumctl reconfigurenonen/aRe-runs the local Ansible reconciliation using the persisted config.
terrariumctl proxy syncnonen/aRebuilds Traefik dynamic config and Terrarium-managed UFW rules from LXC user.proxy labels.
terrariumctl mount addrequired: protocol, hostPath, address, username; optional: -p/--password, --sealpassword prompt, uid=0, gid=0, file_mode=0660, dir_mode=0770, --seal=trueCreates a managed host SMB/CIFS mount, stores credentials under /etc/terrarium/mounts, writes a managed /etc/fstab block, and mounts it immediately.
terrariumctl mount removerequired: hostPathn/aUnmounts a Terrarium-managed host mount, removes its managed /etc/fstab block, and deletes its managed credentials file.
terrariumctl mount listnonen/aLists Terrarium-managed host mounts, including whether each one is currently mounted.
terrariumctl idp syncnonen/aReconciles self-hosted ZITADEL applications, Terrarium management role claims, and related local OIDC settings. No-op unless ZITADEL mode is enabled.
terrariumctl set domainsoptional rootDomain, plus override flagsmanage.<rootDomain>, lxd.<rootDomain>, auth.<rootDomain> when applicableUpdates the root domain, derived Terrarium subdomains, re-verifies external OIDC when needed, and re-runs reconciliation.
terrariumctl set emailsoptional flagsexisting values when omittedUpdates Terrarium contact, ACME, and ZITADEL admin emails.
`terrariumctl set idp localoidc`mode plus optional flagsn/a
terrariumctl set s3optional flagskeeps current enable/disable state unless --enable or --disable is passedUpdates S3 backup settings, verifies the target with a real test operation, and can enable or disable S3 exports.
terrariumctl set syncoidoptional flagskeeps current enable/disable state unless --enable or --disable is passedUpdates syncoid replication settings and can enable or disable syncoid.

install

FlagArgumentRequiredDefaultMeaning
--non-interactivenonenointeractive mode if omittedDisables prompts and requires all needed config through flags.
--yesnonenoprompt before destructive actionsAuto-confirms destructive or confirmation prompts.
--refgit branch or tagnomainChecks out a specific Terrarium ref in /opt/terrarium.
--emailemail addressyes in non-interactive mode; no in interactive modeprompted in interactive modeSets the Terrarium contact/admin email and default ZITADEL bootstrap admin email.
--acme-emailemail addressnofalls back to --emailSets the ACME account identity for Traefik and LXD certificate automation.
--domainroot domainnoservice domains default to <service>.<dashed-public-ip>.traefik.me when omittedSets the root domain used to derive service subdomains.
--manage-domaindomainnomanage.<domain> when --domain is set, otherwise manage.<dashed-public-ip>.traefik.meOverrides the Cockpit domain.
--proxy-domaindomainnoproxy.<domain> when --domain is set, otherwise proxy.<dashed-public-ip>.traefik.meOverrides the Traefik dashboard domain.
--lxd-domaindomainnolxd.<domain> when --domain is set, otherwise lxd.<dashed-public-ip>.traefik.meOverrides the LXD domain.
--idplocal or oidcyes in non-interactive mode; no in interactive modeprompted in interactive modeSelects whether Terrarium uses self-hosted ZITADEL or an external OIDC issuer.
--admin-groupgroup nameyes when --idp=oidc; no otherwiseterrarium-admins when --idp=local, otherwise prompted in interactive modeSets the management admin group that is allowed into Cockpit and LXD.
--oidcissuer URLyes when --idp=oidc; no otherwisederived from https://<auth-domain> when --idp=localSets the OIDC issuer URL.
--oidc-clientclient IDyes when --idp=oidc; no otherwisenoneSets the external OIDC client ID used by Cockpit's oauth2-proxy, LXD, and published-route auth.
--oidc-secretclient secretyes when --idp=oidc; no otherwisenoneSets the external OIDC client secret used by Cockpit's oauth2-proxy, LXD, and published-route auth.
--auth-domaindomainnoauth.<domain> when --domain is set and self-hosted ZITADEL is enabled, otherwise auth.<dashed-public-ip>.traefik.meOverrides the ZITADEL auth domain.
--zitadel-admin-emailemail addressnofalls back to --emailSets the initial admin email for self-hosted ZITADEL.
--root-pwdpasswordyes in non-interactive mode when root has no usable local password; no otherwiseexisting root password if already set, otherwise prompted in interactive modeSets or updates the root password used for Cockpit login.
--storage-modedisk, partition, or fileyes in non-interactive mode; no in interactive modeprompted or auto-selected in interactive modeSelects how the LXD ZFS pool is created.
--storage-sourcepath or autoyes for disk and partition in non-interactive installs; no in interactive modeprompted when needed in interactive modeSets the source disk or partition for disk or partition mode, or uses auto to pick the largest valid target.
--storage-sizesize stringonly for file mode when overriding the default64G in interactive prompts and non-interactive fallbackSets the size of the file-backed ZFS pool for file mode.
--enable-s3nonenodisabledEnables S3-backed archive exports.
--s3-endpointURLonly when using a custom S3-compatible providerhttps://s3.amazonaws.com when omittedSets a custom S3-compatible API endpoint.
--s3-bucketbucket nameyes if --enable-s3 is setnoneSets the destination bucket for S3 exports.
--s3-regionregion namenous-east-1 when omittedSets the S3 region.
--s3-prefixprefixnoterrariumSets the object prefix under the bucket.
--s3-access-keyaccess keyyes if --enable-s3 is setnoneSets the S3 access key.
--s3-secret-keysecret keyyes if --enable-s3 is setnoneSets the S3 secret key.

Install verification notes:

  • In interactive mode, external OIDC is not accepted until Terrarium can reach the issuer, confirm the callback flow looks valid, and probe the client credentials.
  • In interactive mode, S3 is not accepted until Terrarium can reach the bucket and complete a write/delete verification object cycle.
  • In non-interactive mode, the same checks run once and the install exits on failure. | --enable-syncoid | none | no | disabled | Enables syncoid replication to a second ZFS host. | | --syncoid-target | host | yes if --enable-syncoid is set | none | Sets the remote SSH target for syncoid replication. | | --syncoid-target-dataset | dataset | yes if --enable-syncoid is set | backup/terrarium in interactive prompts | Sets the remote target dataset for syncoid replication. | | --syncoid-ssh-key | path | yes if --enable-syncoid is set | /root/.ssh/id_ed25519 in interactive prompts | Sets the SSH key used for syncoid replication. |

backup restore

FlagArgumentRequiredDefaultMeaning
--sourcelocal or s3nolocalChooses whether restore data comes from local ZFS snapshots or from S3 manifests and streams.
--instanceinstance nameyesnoneNames the source instance to restore from.
--atsnapshot fragment or timestampnolatest local snapshot or latest S3 manifest chainSelects the restore point to match.
--as-newnew instance namenoin-place restoreRestores into a new dataset and then hands off into interactive lxd recover.

Restore behavior:

  • terrariumctl backup restore --instance NAME restores from the latest local snapshot in place by default after confirmation.
  • terrariumctl backup restore --source local|s3 --instance NAME [--at ...] --as-new NEWNAME restores the chosen point and then launches interactive lxd recover.

mount add

FlagArgumentRequiredDefaultMeaning
positional protocolsmb or cifsyesnoneChooses the SMB/CIFS mount handler. Both values map to a managed CIFS mount.
positional hostPathabsolute host pathyesnoneThe mount point to create on the Terrarium host.
positional addressshare addressyesnoneThe SMB share address, usually //server/share.
positional usernameusernameyesnoneThe SMB/CIFS username written to the managed credentials file.
-p, --passwordpasswordnoprompt if omittedThe SMB/CIFS password. Omit it to let Terrarium prompt securely instead of putting it in shell history.
--uiduidno0UID presented for files on the mounted share.
--gidgidno0GID presented for files on the mounted share.
--file-modeoctal modeno0660File permissions presented on the mounted share.
--dir-modeoctal modeno0770Directory permissions presented on the mounted share.
--sealtrue or falsenotrueEnables or disables the SMB encryption option explicitly.

Example:

bash
terrariumctl mount add cifs /srv/shared/storage-box //u12345.your-storagebox.de/backup u12345

Behavior:

  • Terrarium creates the mount point if it does not exist.
  • Terrarium writes credentials under /etc/terrarium/mounts/.
  • Terrarium adds or updates a Terrarium-managed block in /etc/fstab.
  • If the path is already mounted, Terrarium remounts it cleanly.

mount remove

FlagArgumentRequiredDefaultMeaning
positional hostPathabsolute host pathyesnoneThe Terrarium-managed mount point to remove from the host.

Example:

bash
terrariumctl mount remove /srv/shared/storage-box

Behavior:

  • Terrarium unmounts the path if it is currently mounted.
  • Terrarium removes the managed block from /etc/fstab.
  • Terrarium deletes the managed credentials file for that mount.

mount list

Example:

bash
terrariumctl mount list

Behavior:

  • Shows all Terrarium-managed mounts discovered in /etc/fstab.
  • Reports the share address, host path, protocol, and whether the path is mounted right now.

set domains

FlagArgumentRequiredDefaultMeaning
positional rootDomaindomainnoprompted when omittedSets the new root domain.
--manage-domaindomainnomanage.<rootDomain>Overrides the Cockpit domain.
--proxy-domaindomainnoproxy.<rootDomain>Overrides the Traefik dashboard domain.
--lxd-domaindomainnolxd.<rootDomain>Overrides the LXD domain.
--auth-domaindomainnoauth.<rootDomain> when self-hosted ZITADEL is enabledOverrides the ZITADEL domain.

set emails

FlagArgumentRequiredDefaultMeaning
--emailemail addressnoexisting configured valueUpdates the Terrarium contact/admin email.
--acme-emailemail addressnoexisting configured value or falls back to --emailUpdates the ACME account email.
--zitadel-admin-emailemail addressnoexisting configured value or falls back to --emailUpdates the self-hosted ZITADEL bootstrap admin email.

set idp

FlagArgumentRequiredDefaultMeaning
positional modelocal or oidcyesnoneSwitches the Terrarium IDP mode.
--auth-domaindomainnoderived from the current root domain or IP when mode is localOverrides the self-hosted ZITADEL auth domain.
--admin-groupgroup namerequired when mode is oidc; optional otherwiseexisting configured value, or terrarium-admins when mode is localSets the management admin group for Cockpit and LXD authorization.
--oidcissuer URLrequired when mode is oidc and no issuer is already configuredexisting configured issuer, or derived from auth-domain when mode is localSets the OIDC issuer URL.
--oidc-clientclient IDrequired when mode is oidc and no client ID is already configuredexisting configured valueSets the external OIDC client ID shared by Cockpit's oauth2-proxy, LXD, and published-route auth.
--oidc-secretclient secretrequired when mode is oidc and no client secret is already configuredexisting configured valueSets the external OIDC client secret shared by Cockpit's oauth2-proxy, LXD, and published-route auth.
--zitadel-admin-emailemail addressnoexisting configured value or --emailUpdates the ZITADEL bootstrap admin email when mode is local.

External OIDC notes:

  • Terrarium configures both Cockpit's oauth2-proxy and LXD from the same external issuer and client settings.
  • The external client must allow:
    • https://<manage-domain>/oauth2/callback
    • https://<manage-domain>/oauth2/app/callback if you want published-route auth with @auth
    • https://<lxd-domain>/oidc/callback
  • The external provider must emit a groups claim that contains the configured admin group as a JSON string array.
  • terrariumctl set idp oidc ... verifies the issuer, callback flow, and client credentials before persisting the new settings.

Local ZITADEL notes:

  • Terrarium auto-provisions a management role named after terrarium_admin_group, defaulting to terrarium-admins.
  • The bootstrap admin is granted that role automatically.
  • Terrarium also installs a small ZITADEL Action that flattens Terrarium role assignments into a groups claim for oauth2-proxy and LXD.

set s3

FlagArgumentRequiredDefaultMeaning
--enablenonenokeeps current stateEnables S3 exports.
--disablenonenokeeps current stateDisables S3 exports.
--s3-endpointURLnoexisting configured valueUpdates the S3 endpoint.
--s3-bucketbucket namerequired when S3 is enabledexisting configured valueUpdates the S3 bucket.
--s3-regionregion namenoexisting configured valueUpdates the S3 region.
--s3-prefixprefixnoexisting configured value or terrariumUpdates the S3 object prefix.
--s3-access-keyaccess keyrequired when S3 is enabledexisting configured valueUpdates the S3 access key.
--s3-secret-keysecret keyrequired when S3 is enabledexisting configured valueUpdates the S3 secret key.

S3 verification notes:

  • When S3 is enabled or updated, Terrarium verifies the target bucket with a real write/delete probe.
  • This catches wrong endpoint, wrong credentials, wrong bucket, and missing write permissions before backup settings are persisted.

set syncoid

FlagArgumentRequiredDefaultMeaning
--enablenonenokeeps current stateEnables syncoid replication.
--disablenonenokeeps current stateDisables syncoid replication.
--syncoid-targethostrequired when syncoid is enabledexisting configured valueUpdates the remote syncoid SSH target.
--syncoid-target-datasetdatasetrequired when syncoid is enabledexisting configured valueUpdates the remote syncoid dataset.
--syncoid-ssh-keypathnoexisting configured value or /root/.ssh/id_ed25519Updates the SSH key used by syncoid.

Built with VitePress