Skip to main content

How to Find the Admin Password for Apache Airflow® standalone

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

The first time you start Apache Airflow® with airflow standalone, it creates a user named admin with a random password and prints the password once. Start it again and the line is gone. This guide shows where the password appears, and where to read it any time after that, on Airflow 3.4.0.

Syntax​

Syntax
cat "${AIRFLOW_HOME:-$HOME/airflow}/simple_auth_manager_passwords.json.generated"
PartWhat it means
catPrints a file in the terminal
${AIRFLOW_HOME:-$HOME/airflow}Your Airflow folder: the value of AIRFLOW_HOME, or ~/airflow when it isn't set, which is where Airflow goes by default
simple_auth_manager_passwords.json.generatedThe file where Airflow keeps the generated passwords

Airflow's simple auth manager documentation says the passwords are "auto-generated for each user", printed in the logs, and saved by default in $AIRFLOW_HOME/simple_auth_manager_passwords.json.generated.

Step 1: Read It When Airflow Starts for the First Time​

The first airflow standalone in a new Airflow folder prints the password near the top:

Terminal
airflow standalone
Output (first lines)
standalone | Starting Airflow Standalone
standalone | Checking for new Dag files every 5 seconds (set [dag_processor] refresh_interval to change this)
Simple auth manager | Password for user 'admin': ********
standalone | Checking database is initialized

The first lines of the first airflow standalone run: Starting Airflow Standalone, then Simple auth manager Password for user admin, with the password replaced by stars.

The username is admin. In your terminal, the stars are the real password; I replaced it here.

Step 2: See What Later Starts Print​

Stop Airflow with Ctrl+C and start it again. The same line now says:

Output (first lines)
standalone | Starting Airflow Standalone
standalone | Checking for new Dag files every 5 seconds (set [dag_processor] refresh_interval to change this)
standalone | Password for the admin user has been previously generated in /Users/you/source/airflow-password-demo/simple_auth_manager_passwords.json.generated. Not echoing it here.
standalone | Checking database is initialized

The first lines of the second airflow standalone run: Password for the admin user has been previously generated in the simple_auth_manager_passwords.json.generated file, Not echoing it here.

The password hasn't changed. Airflow only prints it when it creates it, and points to the file instead.

Step 3: Read the File​

Terminal
cat "${AIRFLOW_HOME:-$HOME/airflow}/simple_auth_manager_passwords.json.generated"
Output
{"admin": "********"}

The terminal after the cat command: one line of JSON with the user admin and its password, replaced by stars.

The file is JSON: each username maps to its password. Mine is in /Users/you/source/airflow-password-demo because I set AIRFLOW_HOME to that folder before starting Airflow. Without it, the file is in ~/airflow.

Step 4: Sign In​

Open the UI, type admin and the password, and click Sign in:

The Sign into Airflow form with admin in the Username field, the password shown as dots, the Sign in button, and the Simple auth manager enabled note below.

The blue note under the button is a reminder that this sign-in, the simple auth manager, is meant for development and testing.

Common Mistakes​

MistakeWhat happensDo this instead
Looking in ~/airflow when you set AIRFLOW_HOMENo such file or directoryLook in your AIRFLOW_HOME folder
Committing the file to GitYour password is in the repositoryAdd it to .gitignore (How to Keep Apache Airflow® Files Out of Git with .gitignore)

Troubleshooting​

SymptomLikely causeFix
cat: …json.generated: No such file or directoryAirflow hasn't started in this folder yet, or AIRFLOW_HOME points elsewhereCheck echo $AIRFLOW_HOME, then start Airflow once
The output says Not echoing it here.The password was created on an earlier startRead the file

FAQ​

Can I change the password?​

Airflow's documentation says you can read and update the passwords directly in the file. I didn't change mine for this guide.

Is the password admin, as in the admin:admin setting?​

No. The [core] simple_auth_manager_users setting defaults to admin:admin, but that's a username and a role, separated by a colon: a user named admin with the admin role. The password is always generated.

Can I add more users?​

Yes, with the same setting. The documentation's example is "bob:admin,peter:viewer": two users, each with its role.

Is the simple auth manager safe for production?​

Its own note says it "is intended for development and testing", and that in production you should make sure access is controlled through other means.

Conclusion​

The first airflow standalone printed the admin password once; later starts said Not echoing it here. and pointed to simple_auth_manager_passwords.json.generated, where cat showed it as JSON. With it, the sign-in worked.

Additional Resources​

Apache®, Apache Airflow and Airflow® are either registered trademarks or trademarks of The Apache Software Foundation in the United States and/or other countries. No endorsement by The Apache Software Foundation is implied by the use of these marks.