Creating a new administrator account in Magento 2 allows you to grant access to additional users for managing your e-commerce store. In this tutorial, we'll guide you through the process of creating a new administrator account in Magento 2 using the command line. Let's get started!
Using Command Line Interface :
Run the Command to Create the Administrator Account
To create a new administrator account, execute the following command:
php bin/magento admin:user:create --admin-firstname=John --admin-lastname=Doe --admin-email=johndoe@example.com --admin-username=johndoe --admin-password=YourPassword123
Replace the placeholders with the appropriate values:
--admin-firstname
: The first name of the administrator.--admin-lastname
: The last name of the administrator.--admin-email
: The email address of the administrator.--admin-username
: The username for the administrator.--admin-password
: The desired password for the administrator. Replace YourPassword123
with a strong password of your choice.
Using Magento 2 Admin Panel :
Navigate to the Administrators Page
Once logged in, navigate to the "System" menu in the top navigation bar and click on "User Roles" under the "Permissions" section. On the "User Roles" page, click the "Add New Role" button to create a new role for the administrator account.
Create a New Role
On the "Add New Role" page, fill in the required information:
After entering the necessary information, click the "Save Role" button to create the new role.
Add a New Administrator User
Now, navigate to the "All Users" page by clicking on "All Users" under the "Permissions" section. On the "All Users" page, click the "Add New User" button to create a new administrator user.
Fill in the required information on the "New User" page:
Under the "User Info" tab, assign the previously created role to the new user. Select the role from the "User Role" dropdown list.
Click the "Save User" button to create the new administrator account.
Thank You!