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
| Command | Arguments | Aliases | Effect | Summary |
|---|---|---|---|---|
assign_admin, claim-admin | write | Explicitly claim or verify initial CLI super-admin ownership for the current operator. | ||
database, postgres | write | Bootstrap Vaulthalla local PostgreSQL integration (role/database) and hand off schema/migrations to normal runtime startup. | ||
remote_db, remote, rdb | write | Configure Vaulthalla to use a remote PostgreSQL database. | ||
proxy | write | Generate/deploy Vaulthalla-managed nginx config from canonical runtime config, then validate and reload conservatively. | ||
tls | write | Create 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. | ||
https | write | macOS: 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-password | write | Change the web console password of the built-in super-admin account ('admin'). |
vh setup assign-admin
vh setup assign-adminA 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 dbvh setup remote-db
vh setup remote-db --host <hostname> --user <username> --database <database> --password-file <path> [--port <port>] [--pool-size <size>] [--interactive]| Option | Aliases | Type | Default | Required | Summary |
|---|---|---|---|---|---|
hostname | Yes | Remote PostgreSQL host. | |||
-u | username | Yes | Remote PostgreSQL user. | ||
--db, --name | database | Yes | Remote PostgreSQL database name. | ||
--password-path, --pw-file | path | Yes | Path to file containing remote DB password. | ||
-p | port | 5432 | No | Remote PostgreSQL port. | |
size | No | Database pool size. | |||
-i | flag | No | Prompt 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.
| Option | Aliases | Type | Default | Summary |
|---|---|---|---|---|
-d | domain | Domain to configure for Vaulthalla nginx integration. | ||
domain | Dedicated HTTPS hostname for the S3 gateway (must differ from --domain). Requires --certbot-dns-cloudflare <credentials>; --certbot cannot be combined with it. | |||
credentials | Issue/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. | |||
flag | Issue/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. | |||
flag | Serve 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 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]
| Option | Aliases | Type | Default | Summary |
|---|---|---|---|---|
-d | domain | The 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. | ||
domain | A second hostname for the S3 gateway (path-style requests), served with the same kind of certificate. | |||
domain | Internal 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. | |||
address | Contact address for the Let's Encrypt account (expiry notices). | |||
credentials | Get 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. | |||
file | Use your own certificate chain (PEM; with --key). Copied in; rerun to replace it before it expires. | |||
file | The private key of --cert (PEM, unencrypted); stored readable by the service only. | |||
address | Listen on this address only instead of every interface. | |||
flag | Use Vaulthalla's own CA whatever the hostname's suffix. | |||
flag | Use Let's Encrypt's staging service (untrusted certificates, generous limits) to rehearse. | |||
flag | Also trust Vaulthalla's CA on this Mac (System keychain; macOS asks you to confirm). | |||
flag | Also point the hostname(s) at this Mac in its /etc/hosts (a marked line, removed by teardown). | |||
flag | Print the Caddyfile that would be used and change nothing. | |||
flag | Show the configured hostnames, the certificate being served and the daemon's state. |
vh setup set-super-admin-password
vh setup set-super-admin-passwordChanges 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]
| Command | Arguments | Aliases | Effect | Summary |
|---|---|---|---|---|
proxy | destructive | Disable/remove Vaulthalla-managed nginx site integration only. | ||
https | destructive | macOS: stop and remove Vaulthalla's Caddy HTTPS front end. | ||
database, postgres | destructive | Disable/remove Vaulthalla local PostgreSQL integration (role/database). |
vh teardown nginx
vh teardown nginxvh teardown caddy
vh teardown caddy [--purge]| Option | Aliases | Type | Default | Summary |
|---|---|---|---|---|
flag | Also 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