How to create a new Magento 2 administrator account

October 10, 2016 - Raphael Thiel # Magento 2 Administrator Account, Reset Magento 2 Administrator Account

Introduction

In this tutorial we show you how to create or reset a Magento 2 administrator account.
This could be helpful if you have lost the Magento 2 admin credentials or you need to create a new one.

For creating a new administrator account for Magento 2 we use the Magento CLI.

1) Login into your Magento 2 Server with SSH

ssh your-username@$your-server-ip

2) Navigate to the Magento 2 directory e.g.

/home/cloudpanel/htdocs/magento2.mgtcommerce.com/

3) Execute the following command in order to create a new administrator with username "new-admin" and password "!admin123!"

php bin/magento admin:user:create --admin-user='new-admin' --admin-password='!admin123!' --admin-email='info@domain.com' --admin-firstname='Jon' --admin-lastname='Doe'

Once the new Magento 2 administrator account has been created, you will see following success message:

Created Magento administrator user named new-admin

Parameter explanation

Name Value
--admin-user Magento administrator user name
--admin-password Magento administrator user password
--admin-email Magento administrator user's e-mail address
--admin-firstname Magento administrator user's first name
--admin-lastname Magento administrator user's last name


To see all available options you can execute the following command

php bin/magento admin:user:create --help

Magento 2 Administrator Account