# Fresh Install login credentials - Portainer/Docker Setup

**URL:** <https://community.directus.com/t/fresh-install-login-credentials-portainer-docker-setup/1007>\
**Category:** Help\
**Tags:** authentication\
**Created:** [August 20, 2025, 12:28pm UTC](https://community.directus.com/t/fresh-install-login-credentials-portainer-docker-setup/1007 "2025-08-20T12:28:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![7005cb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.directus.com/7005cb/32/774_2.png) [@7005cb](https://community.directus.com/u/7005cb)\
**Post date:** [August 20, 2025, 12:28pm UTC](https://community.directus.com/t/fresh-install-login-credentials-portainer-docker-setup/1007/1 "2025-08-20T12:28:11Z")

</div>

Powerful as Directus is among the others, I am very disappointed in its first-time login method.

I have even included the admin user and email in the environment variables, but with no luck.

When accessing Directus through the Portainer console view, it results in software not being installed to execute commands, and maybe because you need to use Directus commands, I guess.

It’s been 3 days that I’ve struggled and now reached out for some help…

---

<div class="post-metadata">

**Author:** ![ahmad\_quvor](https://sea2.discourse-cdn.com/flex002/user_avatar/community.directus.com/ahmad_quvor/32/310_2.png) [@ahmad\_quvor](https://community.directus.com/u/ahmad_quvor)\
**Post date:** [August 20, 2025, 12:38pm UTC](https://community.directus.com/t/fresh-install-login-credentials-portainer-docker-setup/1007/2 "2025-08-20T12:38:52Z")

</div>

Hello @7005cb,

On the very **first startup** , Directus bootstraps the database and creates the initial admin user.  
This only happens **once** — after that, the admin account already exists in the database, and changing the env vars won’t affect it.

Here’s what that means for you:

- If you didn’t set `ADMIN_EMAIL` and `ADMIN_PASSWORD` before the first run, Directus will still create an admin:
  - **Email:** `admin@example.com`
  - **Password:** a random one (printed in the container logs)

- If you update the env vars later, they’ll be ignored since the database is already initialized.
- If you can access the logs from the very first run, you’ll see the auto-generated admin password there.

🔧 **Fix options:**

1. **Start fresh** (if you don’t have important data yet):

2. **Keep your existing DB** :

**In short:** make sure `ADMIN_EMAIL` and `ADMIN_PASSWORD` are set **before the first boot** , or check the logs to find the random password Directus generated the first time.
