# Wizard-skip via CLI-only deploy

**URL:** https://support.stalw.art/t/wizard-skip-via-cli-only-deploy/404
**Category:** Questions
**Created:** [May 27, 2026, 3:12pm UTC](https://support.stalw.art/t/wizard-skip-via-cli-only-deploy/404 "2026-05-27T15:12:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![hvjunk](https://support.stalw.art/user_avatar/support.stalw.art/hvjunk/32/259_2.png) [@hvjunk](https://support.stalw.art/u/hvjunk)
#### Post date: [May 27, 2026, 3:12pm UTC](https://support.stalw.art/t/wizard-skip-via-cli-only-deploy/404/1 "2026-05-27T15:12:36Z")

</div>

### Your question

For a v0.16.6 deployment automated via configuration management (Ansible) where I want to skip the interactive `/admin` setup wizard entirely, can I pre-populate everything (admin Account, Domain, SystemSettings including defaultDomainId and defaultHostname, NetworkListeners, Certificates) via `stalwart-cli apply --file plan.ndjson` while running with STALWART\_RECOVERY\_ADMIN authentication? Does the wizard perform any irreplaceable steps not exposed via stalwart-cli apply?

### I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.

on

---

<div class="post-metadata">

### Author: ![helpbot](https://support.stalw.art/user_avatar/support.stalw.art/helpbot/32/13_2.png) [@helpbot](https://support.stalw.art/u/helpbot)
#### Post date: [May 27, 2026, 3:13pm UTC](https://support.stalw.art/t/wizard-skip-via-cli-only-deploy/404/2 "2026-05-27T15:13:09Z")

</div>

The answer is yes, and the docs explicitly describe exactly this pattern.

The wizard performs no irreplaceable steps. Everything the wizard does is accessible through the JMAP API / `stalwart-cli apply`. The documented fully-automated workflow is:

1. **Write `config.json` onto the host** - it only needs to contain the `DataStore` object pointing at your database.
2. **Start Stalwart with `STALWART_RECOVERY_MODE=1`** and `STALWART_RECOVERY_ADMIN=admin:<password>` (from your secrets manager). This suspends all mail services and exposes only the management API on port 8080 (configurable via `STALWART_RECOVERY_MODE_PORT`).
3. **Run `stalwart-cli apply --file plan.ndjson`** against the recovery listener to load your full configuration - accounts, domains, `SystemSettings` (including `defaultDomainId` / `defaultHostname`), `NetworkListeners`, `Certificates`, etc.
4. **Restart without the recovery variables** to bring the server up in normal operation.

From that point forward, every subsequent change is another `apply` against the running server. The `STALWART_RECOVERY_ADMIN` credential also works against a normally-running server, so you don’t need to cycle through recovery mode for post-initial changes.

One thing to be aware of: `apply` is not inherently idempotent for `create` operations. To make your plan re-runnable, prefix each `create` block with a matching `destroy` for that object type (which is the shape `stalwart-cli snapshot` emits). On re-runs, the destroy pass clears existing objects and the create pass rebuilds them.

Relevant docs:

- [Declarative deployments](https://stalw.art/docs/configuration/declarative-deployments)
- [Bootstrap mode](https://stalw.art/docs/configuration/bootstrap-mode)
- [Recovery mode](https://stalw.art/docs/configuration/recovery-mode)
- [stalwart-cli apply](https://stalw.art/docs/management/cli/apply)
- [Environment variables](https://stalw.art/docs/configuration/environment-variables)

_This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong._
