How to create a new Magento 2 administrator account
- Login into your Magento 2 Server with SSH.
ssh your-username-ssh@$server-ip
- Go to the Magento 2 directory e.g.
cd /home/cloudpanel/htdocs/www.domain.com/
- Use the below command to create a new administrator with the username
new-admin
and password!admin123!
php7.4 bin/magento admin:user:create --admin-user='new-admin' --admin-password='!admin123!' --admin-email='info@domain.com' --admin-firstname='John' --admin-lastname='Doe'
Once the new Magento 2 administrator account has been created, you will see the following success message:
Created Magento administrator user named new-admin.
Parameter explanation
Name | Value |
---|---|
--admin-user | (Required) Admin user |
--admin-password | (Required) Admin password |
--admin-email | (Required) Admin email |
--admin-firstname | (Required) Admin first name |
--admin-lastname | (Required) Admin last name |
To see all available options, you can execute the following command:
php7.4 bin/magento admin:user:create --help