Back to Top

Create/Edit Magento 2 Admin User Account via CLI

Updated 22 February 2024

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

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

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

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

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

Screenshot

–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).

Searching for an experienced
Magento 2 Company ?
Find out More

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.

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


4 comments

  • Vimal Kumar Vushakola
    • Anuj Gupta (Moderator)
  • Syed Muneeb Ul Hasan
    • Mayur
  • Back to Top

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home