Every fresh Nginx Proxy Manager container greets you with a screen where you create the first admin. Fine once. Annoying when I rebuild a test setup from a compose file and want it ready without clicking.
The docs have two environment variables for this. Put them under environment in your compose file:
environment:
INITIAL_ADMIN_EMAIL: '[email protected]'
INITIAL_ADMIN_PASSWORD: 'a-long-unique-password'
On startup NPM then creates that admin user for you and the first-user setup screen is skipped. You open the admin page and log in straight away. That suits scripted installs and anyone who keeps the whole stack in version control.
The caveat is the obvious one. The password now sits in plain text in your compose file, and probably in a git repo or a backup. Use a throwaway password here, then change it in the admin UI after the first login. I would also keep the compose file out of any public repository. The docs only describe the creation of the first user, so do not expect changing these variables later to rename or reset an account that already exists.
Further reading: Nginx Proxy Manager: Advanced Configuration, On this site: IP_RANGES_FETCH_ENABLED skips a startup download in Nginx Proxy Manager, On this site: pin the Nginx Proxy Manager image version, upgrade on purpose, On this site: Guide: put Nextcloud behind Nginx Proxy Manager with HTTPS and the right headers
Going deeper: Guide: fix a 502 Bad Gateway in Nginx Proxy Manager, with a checklist that finds the cause