How to create admin user using CLI in Magento 2? – Some times we need to create admin users without login to Magento admin panel. We can use the command line to create admin users. This is something pretty simple to achieve.
Run the below command from the root directory.
1 |
bin/magento admin:user:create |
You will get the prompt to give Admin user, Admin Password, Admin Email, Admin first Name, Admin Last Name one by one respectively after filling each. Once everything filled successfully you will get the success message of ” Created Magento administrator user named username “.

After cache flush, you can use the created credential to log in to the admin panel. In this way, we can create admin user using CLI in Magento 2.