How to create a new admin user in Magento via the terminal

To create a new admin user in Magento via the terminal, follow these steps:

  1. Access Your Server: Open your terminal or SSH into your server.
  2. Navigate to Your Magento Installation: Change to the Magento root directory:

  1. Create a New Admin User: Use the following command to create a new admin user. Replace <new_username>, <new_email>, and <new_password> with your desired values:

php bin/magento admin:user:create --admin-firstname=FirstName --admin-lastname=LastName --admin-email=<new_email> --admin-user=<new_username> --admin-password=<new_password>
  1. Clear Cache (optional): It’s good practice to clear the cache after making changes:
php bin/magento cache:clean
php bin/magento cache:flush
  1. Log in to Admin Panel: Use the new credentials to log in to your Magento admin panel.

Leave a comment

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