How To Create Admin User Using Command Line Interface in Magento 2

As you know, we can also create the admin users with any role from admin. But if, in case, you want to create new admin user using command line interface, you need to use the following command.
Below is the command for adding new admin user:

php bin/magento admin:user:create --admin-user="username" --admin-password="password" --admin-email="" --admin-firstname="First Name" --admin-lastname="Last Name"

Please make sure to put proper information for username, password and email id. Please do not use existing email id and username, try to use new email id and username.

That’s it. You are all set to create new admin user using CLI.


Leave a Reply