Request Quote

Create/Edit Magento 2 Admin User Account via CLI

You can create or edit Magento 2 admin user account using the command line.

For that, you have to open terminal/command prompt.

After that go to you’re Magento site’s root directory in the terminal, for example, your Magento site can be in folder/directory path as /var/www/html.
So go to that directory from command line and after that execute the below command.

php bin/magento admin:user:create --admin-user='new-user' --admin-password='admin123' --admin-email='' --admin-firstname='Admin' --admin-lastname='Admin'

Once the Magento 2 admin user account is created then you will see the below success message.

–admin-user-> Admin account username (required).
–admin-password-> Admin User account password (required).
–admin-email-> Admin user account’s email address (required).
–admin-firstname-> Admin user’s first name (required).
–admin-lastname-> Admin user’s last name (required).

Note: If you are editing an existing user then only the first name, last name, and password can be edited.

Hope it will help you. Thank you.

. . .

Comments (2)

Add Your Comment

  • Syed Muneeb Ul Hasan
    There is one more way to create the admin user in Magento 2 which can be done from its admin panel. I think adding this method will make your tutorial more comprehensive.

    Thanks for sharing this post!

    • Mayur
      >> via CLI <<
  • css.php