Skip to content
Vaulthalla LogoVaulthalla

vh setup and vh teardown

Reference for vh setup and vh teardown - database, nginx, Caddy, local TLS and super admin setup, and their teardowns.

vh setup and vh teardown install and remove the pieces around the daemon: the database, the reverse proxy and its certificates, and the binding of the first administrator. The database, remote database, nginx, Caddy and teardown commands change host services and run with sudo; they work locally and don't need the daemon.

setup db, setup remote-db, setup nginx and their teardowns are Linux commands; setup caddy and teardown caddy (alias https) are macOS commands, and each platform says so instead of running the other's.

1sudo vh setup db2sudo vh setup remote-db --host <host> --port 5432 --user <user> --database <name> --password-file <path>3sudo vh setup nginx --domain vault.example.com --certbot4sudo vh setup nginx --domain vaulthalla.dev --s3-domain s3.vaulthalla.dev --certbot-dns-cloudflare /etc/vaulthalla/certbot/cloudflare.ini5sudo vh setup caddy --domain <name> --email <address>6vh setup assign-admin7vh setup set-super-admin-password

Setup

vh setup
CommandArgumentsAliasesEffectSummary
assign_admin, claim-adminwriteExplicitly claim or verify initial CLI super-admin ownership for the current operator.
database, postgreswriteBootstrap Vaulthalla local PostgreSQL integration (role/database) and hand off schema/migrations to normal runtime startup.
remote_db, remote, rdbwriteConfigure Vaulthalla to use a remote PostgreSQL database.
proxywriteGenerate/deploy Vaulthalla-managed nginx config from canonical runtime config, then validate and reload conservatively.
tlswriteCreate or renew the local HTTPS certificate (/etc/vaulthalla/tls/local.crt) that nginx serves when no public certificate is configured: self-signed, ECDSA P-256, valid 825 days, covering this host's names and addresses.
httpswritemacOS: serve Vaulthalla over HTTPS through Caddy (the console, WebSockets, uploads and downloads, and optionally the S3 gateway), with certificates handled automatically: Vaulthalla's own CA for internal names, Let's Encrypt for public ones, Cloudflare DNS when the host isn't reachable from the internet, or your own files.
super-admin-passwordwriteChange the web console password of the built-in super-admin account ('admin').

vh setup assign-admin

vh setup assign-admin

A normal CLI command, run without sudo: it claims (or confirms) the CLI super-admin binding for the Linux user running it. See First Run.

vh setup db

vh setup db

vh setup remote-db

vh setup remote-db --host <hostname> --user <username> --database <database> --password-file <path> [--port <port>] [--pool-size <size>] [--interactive]
vh setup remote-db
OptionAliasesTypeDefaultRequiredSummary
hostnameYesRemote PostgreSQL host.
-uusernameYesRemote PostgreSQL user.
--db, --namedatabaseYesRemote PostgreSQL database name.
--password-path, --pw-filepathYesPath to file containing remote DB password.
-pport5432NoRemote PostgreSQL port.
sizeNoDatabase pool size.
-iflagNoPrompt for missing remote DB values.

vh setup nginx

vh setup nginx [--domain <domain>] [--s3-domain <domain>] [--certbot-dns-cloudflare <credentials>] [--certbot] [--plain-http]

setup nginx checks for the generated initial admin password first. If it is still in use and its plaintext copy (/var/lib/vaulthalla/super_admin_initial_password) still exists, it offers to change the password, delete the file and keep the password, continue, or cancel. Run without a terminal, it warns and continues.

The --s3-domain form needs a Cloudflare API token in a root-only credentials file (dns_cloudflare_api_token = <token>). See S3 Gateway Setup.

vh setup nginx
OptionAliasesTypeDefaultSummary
-ddomainDomain to configure for Vaulthalla nginx integration.
domainDedicated HTTPS hostname for the S3 gateway (must differ from --domain). Requires --certbot-dns-cloudflare <credentials>; --certbot cannot be combined with it.
credentialsIssue/renew one certificate covering --domain and --s3-domain through Cloudflare DNS-01 (python3-certbot-dns-cloudflare); no inbound port 80 is needed. <credentials> is a root-owned, mode 0600 file containing the line 'dns_cloudflare_api_token = <token>', where the token has Zone > DNS > Edit on the zones of both hostnames. Certbot renewals keep reading the file, so leave it in place. Conventional path: /etc/vaulthalla/certbot/cloudflare.ini.
flagIssue/renew a Let's Encrypt certificate for --domain with the certbot nginx plugin (HTTP-01: the domain must reach this host on port 80). Not supported with --s3-domain.
flagServe plain HTTP only, without the local HTTPS certificate. Only behind another TLS terminator (a tunnel or load balancer that already provides HTTPS).

vh setup local-tls

vh setup local-tls [--force] [--quiet]
vh setup local-tls
OptionAliasesTypeDefaultSummary
flagRegenerate the certificate even if the current one is still valid.
flagPrint only when a new certificate was created.

vh setup caddy

vh setup caddy [options]

macOS only. Every option is described in Serve Vaulthalla With Caddy.

1sudo vh setup caddy --domain <name> [--s3-domain <name>|none] [--internal] [--ca-scope <domain>]2sudo vh setup caddy --domain <name> --dns-cloudflare <credentials>3sudo vh setup caddy --domain <name> --cert <file> --key <file>4sudo vh setup caddy [--listen <address>] [--trust] [--hosts-entry] [--dry-run] [--status]
vh setup caddy
OptionAliasesTypeDefaultSummary
-ddomainThe console's hostname. Names under .home.arpa, .internal, .lan, .local, .localhost or .test get a certificate from Vaulthalla's own CA; other names get Let's Encrypt. Required the first time; later runs reuse it.
domainA second hostname for the S3 gateway (path-style requests), served with the same kind of certificate.
domainInternal CA only: let it sign for this domain and everything under it (e.g. home.arpa) instead of only the configured hostnames, so a new hostname later needs no new CA on clients.
addressContact address for the Let's Encrypt account (expiry notices).
credentialsGet the public certificate through Cloudflare DNS (DNS-01; no inbound port 80/443 needed). <credentials> is a root-owned 0600 file with the line 'dns_cloudflare_api_token = <token>' (the same file vh setup nginx uses); the token needs Zone > DNS > Edit.
fileUse your own certificate chain (PEM; with --key). Copied in; rerun to replace it before it expires.
fileThe private key of --cert (PEM, unencrypted); stored readable by the service only.
addressListen on this address only instead of every interface.
flagUse Vaulthalla's own CA whatever the hostname's suffix.
flagUse Let's Encrypt's staging service (untrusted certificates, generous limits) to rehearse.
flagAlso trust Vaulthalla's CA on this Mac (System keychain; macOS asks you to confirm).
flagAlso point the hostname(s) at this Mac in its /etc/hosts (a marked line, removed by teardown).
flagPrint the Caddyfile that would be used and change nothing.
flagShow the configured hostnames, the certificate being served and the daemon's state.

vh setup set-super-admin-password

vh setup set-super-admin-password

Changes the web console password of the built-in admin account. Only the local user bound as the super admin may run it, without sudo; it ends the account's web sessions and removes the generated initial password file.

Teardown

1sudo vh teardown nginx2sudo vh teardown db3sudo vh teardown caddy [--purge]
vh teardown
CommandArgumentsAliasesEffectSummary
proxydestructiveDisable/remove Vaulthalla-managed nginx site integration only.
httpsdestructivemacOS: stop and remove Vaulthalla's Caddy HTTPS front end.
database, postgresdestructiveDisable/remove Vaulthalla local PostgreSQL integration (role/database).

vh teardown nginx

vh teardown nginx

vh teardown caddy

vh teardown caddy [--purge]
vh teardown caddy
OptionAliasesTypeDefaultSummary
flagAlso delete the certificates, the ACME account and Vaulthalla's internal CA (clients that trusted it keep trusting it until removed there).

vh teardown db

vh teardown db