In this tutorial, we will show you two common ways to add a new admin user in Magento 2 – by command execution and backend configuration. Let’s get started!
The 1st Approach: Executing A Simple Command To Create Magento 2 Admin User
On this method, you need to open your SSH terminal and access to your server. Then, go to Magento 2 root directory and run the following command:
php bin/magento admin:user:create --admin-user='loki' --admin-password='admin123$' --email@example.com' --admin-firstname='Loki' --admin-lastname='Doan'
After running that command successfully, you will immediately get this message: “Created Magento administrator user named loki”.
Now, open your admin panel and access by the account that you have created.
The 2nd Approach: Creating Admin User Directly From Magento 2 Backend
There are two quick steps to create Magento 2 admin user from your admin panel:
- Step 1: Providing required User Information
- Step 2: Setting specific User Role
Step 1: Providing required user Information
To begin with, you must go to your the admin panel, navigate to SYSTEM, and choose All Users under Permissions (Admin Panel => SYSTEM => All Users) as the following:
Next, you must click on the Add New User button in the upper-right corner:
After that, you have to configure the User Info by providing all Account Information (including User Name, First Name, Last name, Email, Password, Interface Locale) of the new admin user, activating this new account and creating a password for Current User Identity Verification.
Besides, if you want to set a specific language for the admin interface of this new account, just select one from the Interface Locale options.
Step 2: Assigning admin role for the new account
Now, switching to the User Role tab on the left panel to define the role of this new admin account.
In the Assigned column, you have to mark the checkbox to set the new account as Administrators.
Finally, click on the Save User button to complete all settings.
We have shown you two easy methods to create the new admin user in Magento 2 website. If you have any problem when following our instruction, be free to leave a comment so that we can help!