Autoconfig vs occ 'maintenance:install'

There seems to be some partial overlap in functionality. In particular, I can’t set a few values via maintenance:install that I can set via autoconfig, e.g.

  • trusted_domains
  • adminlogin
  • adminpass
  • smtp settings

What is the recommended way for scriped installs these days?

adminlogin can be set via --admin-user <username>
adminpass can be set via --admin-pass <password>

trusted_domains needs to be set via a new call. First list all existing domains:

$ occ config:system:get trusted_domains

To add a new one you can run the following command: occ config:system:set trusted_domains <number of existing entries> --type string --value=""

SMTP mostly works the same:

occ config:system:set mail_smtpmode --type string --value="smtp"
occ config:system:set mail_smtpsecure --type string --value="tls"

See for a list of variables