First run of stalwart container fails

Your question

I am trying to run the docker container for the very first time (bootstrap), using the instructions provided (Docker | Stalwart).

I execute the command (rootless):
$ podman run -d --name stalwart \
–restart unless-stopped
-p 443:443 -p 8080:8080
-p 25:25 -p 587:587 -p 465:465
-p 143:143 -p 993:993
-p 110:110 -p 995:995
-p 4190:4190
-v stalwart-etc:/etc/stalwart
-v stalwart-data:/var/lib/stalwart
stalwartlabs/stalwart:latest
-e STALWART_RECOVERY_ADMIN=admin:stalwart_rec_admin
I get the response:
$ e1af2aaa8f973cb23a94a98ba48235ea5e18059ec0d96a3be7d1cc3a22c9fa18

The container loads for a bit and then it fails/stops without any message.
The only feedback i get from the container’s log is : Missing ‘–config’ argument for import/export.

I am running the rootless container using rootless podman on Alpine Linux VM.
Any ideas? I know other people are successfully using stalwart on rootles podman.!

Appreciated!

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

The problem is a simple command-line syntax error: the -e environment variable flag is being passed as part of the container’s command arguments instead of as a Docker/Podman -e option.

In your command:

stalwartlabs/stalwart:latest \
-e STALWART_RECOVERY_ADMIN=admin:stalwart_rec_admin

The -e STALWART_RECOVERY_ADMIN=... comes after the image name, which means Podman passes it to the container’s entrypoint as a binary argument, not as an environment variable. That’s what causes the Missing '--config' argument for import/export error – the server binary is treating -e as an unknown flag.

The -e flag must come before the image name:

podman run -d --name stalwart \
  --restart unless-stopped \
  -p 443:443 -p 8080:8080 \
  -p 25:25 -p 587:587 -p 465:465 \
  -p 143:143 -p 993:993 \
  -p 110:110 -p 995:995 \
  -p 4190:4190 \
  -v stalwart-etc:/etc/stalwart \
  -v stalwart-data:/var/lib/stalwart \
  -e STALWART_RECOVERY_ADMIN=admin:stalwart_rec_admin \
  stalwartlabs/stalwart:latest

With this corrected, Stalwart will start in bootstrap mode using the credentials you specified. You can then open http://<hostname>:8080/admin and log in with admin / stalwart_rec_admin to complete the setup wizard.

The Docker install docs confirm this usage: “Pass the value via -e, for example -e STALWART_RECOVERY_ADMIN=admin:mySecretPass” – the flag belongs in the podman run options, not after the image name.

Reference: Stalwart Docker install docs

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