nextcloud / nextcloud/docker

Allow setting admin user email via environment variable during initial setup

Open
#2,425 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage enhancement feature: auto config (environment variables)
Dominant language
Shell
Stars
7.4k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

After a fresh Docker-based install with all SMTP settings supplied via environment variables, the send test via "Basic settings → Test and verify email settings" result in the following error:
AxiosError: Request failed with status code 400
This error message is not helpful and gives no indication of the root cause. It took me several days of debugging - including repeatedly verifying and adjusting the SMTP settings - before I realized that the problem was simply that the admin user had no email address set.

Expected Behavior

A fresh installation should allow specifying an admin email during setup. Without it, the email system silently fails with unclear error messages, despite all SMTP settings appearing correct.

Proposed Solution

Introduce a new environment variable, such as NEXTCLOUD_ADMIN_EMAIL, which can be used during container initialization to automatically assign an email address to the admin user.

environment:
  - NEXTCLOUD_ADMIN_USER=admin
  - NEXTCLOUD_ADMIN_PASSWORD=secret
  - NEXTCLOUD_ADMIN_EMAIL=admin@example.com
Benefits
  • Prevents misleading errors like AxiosError: Request failed with status code 400 when testing email
  • Reduces time wasted on debugging SMTP configs
  • Streamlined, fully automated deployment
  • Enables functional email notifications from the start
  • Avoids manual post-installation steps

This would align well with the goals of containerization and automation. Thanks for considering!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the container initialization path that handles NEXTCLOUD_ADMIN_USER and NEXTCLOUD_ADMIN_PASSWORD, then determine where a proposed admin email variable would be applied. Reproduce a fresh Docker-based install with SMTP settings and use “Basic settings → Test and verify email settings” to confirm that the email is set and the test no longer fails with the reported 400 error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, shell
Domain
devops, infrastructure
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.