Installation issues (v0.16.5)

Issue Description

I have tried to install Stawart at an Ubuntu server, but following the instructions at the website are different from the behavior I see. After the installation Stalwart is always running on a different port. When trying to reach /admin to make the first configuration, only emails are accepted. I’ve tryed different configurations, the only possibility of get it running on port 8080 is if I activate the recovery mode, but still, I cant configure with the initial login data provided.

Is there anything I am missing?

Expected Behavior

I was expecting the instalattion to be exactly as the instructions.

Actual Behavior

I cant get to the initial configuration screen

Reproduction Steps

  1. install
  2. Get the login data at the logs
  3. Access http://myip:38891/admin (38891 this is the one at the moment)
  4. The page is running forever, or, if it is configured at the webserver, it takes me to the login screen that only accepts emails to login

Stalwart Version

v0.16.x

Installation Method

Binary (Linux)

Database Backend

SQLite

Blob Storage

SQLite

Search Engine

Internal

Directory Backend

Internal

I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.

on

I have searched this support forum (open and closed topics) and confirm this is not a duplicate.

on

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

Let me look into the installation and initial login process for Stalwart.

There are a few separate issues going on here. Let me address each one:


1. The port keeps changing

On first start, Stalwart runs in bootstrap mode using port 8080. The port you’re seeing (e.g. 38891) is almost certainly a random ephemeral port being shown somewhere unrelated – or the server has been restarted multiple times and is in a different state. The bootstrap HTTP listener is always on 8080. Access the setup wizard at:

http://<your-server-ip>:8080/admin

2. Login only accepts email addresses

This is the key symptom: after the setup wizard has run at least once, Stalwart provisions a permanent administrator account whose username is an email address (e.g. [email protected]) – that is normal and expected. However, during the initial bootstrap mode (before the wizard is completed), the username is simply admin (no domain) and the password is the 16-character temporary password printed exactly once in the service logs.

To retrieve the bootstrap credentials on systemd:

sudo journalctl -u stalwart -n 200 | grep -A8 'bootstrap mode'

The credentials block looks like:

username: admin
password: XXXXXXXXXXXXXXXX

3. Recovery mode still doesn’t work

Recovery mode re-enables the port 8080 HTTP listener and accepts credentials from the STALWART_RECOVERY_ADMIN environment variable set in /etc/stalwart/stalwart.env. Make sure you have set that variable before starting in recovery mode, and are using exactly the username and password you put there. Recovery mode is enabled by also setting STALWART_RECOVERY_MODE=1 in that same env file.

The likely root cause of your situation: the setup wizard may have already completed (explaining why login now expects an email address), but you did not capture the final screen’s generated admin@<domain> credentials. In that case, use STALWART_RECOVERY_ADMIN=admin:somepassword in /etc/stalwart/stalwart.env and restart with STALWART_RECOVERY_MODE=1 – then sign in at http://<ip>:8080/admin with those exact credentials.

Full installation docs for Linux: Linux / MacOS | Stalwart

This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong. If you found it useful, mention @helpbot in any reply to ask follow-up questions and the bot will respond again.

Are you running Stalwart as root or with CAP_NET_BIND_SERVICE? If not, it might explain the random port because it cannot bind below port 1024, which requires additional permissions on Linux.