---
title: "How to Create Admin User via Command Line in Magento 2?"
url: "https://magecomp.com/blog/create-admin-user-via-command-line-magento-2/"
date: "2023-01-24T10:00:25+00:00"
modified: "2025-02-13T11:53:28+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "How To"
  - "Magento 2"
word_count: 219
reading_time: "2 min read"
summary: "Hello Magento Friends,"
description: "You can create admin user via command line in Magento 2. Check out which command can help you with this"
keywords: "How To, Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "Magento 2 Migration SEO Checklist 2026"
    url: "https://magecomp.com/blog/magento-2-migration-seo-checklist/"
  - title: "How to Create Custom Swatch Attribute Programmatically in Magento 2?"
    url: "https://magecomp.com/blog/create-custom-swatch-attribute-programmatically-magento-2/"
  - title: "How to Prevent Adding Duplicate Product to Wishlist in Magento 2"
    url: "https://magecomp.com/blog/prevent-adding-duplicate-product-to-wishlist-in-magento-2/"
---

# How to Create Admin User via Command Line in Magento 2?

_Published: January 24, 2023_  
_Author: Dhiren Vasoya_  

![How to Create Admin User via Command Line in Magento 2](https://magecomp.com/blog/wp-content/uploads/2023/01/How-to-Create-Admin-User-via-Command-Line-in-Magento-2-1024x512.webp)

**Hello Magento Friends,**

In the current blog, I will discuss How to Create Admin User via Command Line in Magento 2.
[![hyva theme development](https://magecomp.com/blog/wp-content/uploads/2025/02/hyva-theme-development-CTA-3.webp)](https://magecomp.com/services/hyva-theme-development/)

Working with Magento, you may need various admin accounts to manage different parts of the store.
You can create a new admin user in Magento 2 in two ways.
- [**Create an admin user from the admin panel**](https://magecomp.com/blog/create-new-admin-user-in-magento-2/)
- **Create an admin user using the command line**

Let’s find out How to Create Admin User via Command Line in Magento 2.
## Steps to Create Admin User via Command Line in Magento 2:
**Step 1:** In the first step, create an admin account with the following information:
User: magecomp
Password: Magecomp@123
Email: test@magecomp.com
First Name: Magecomp
Last Name: Admin
**Step 2:** Now run the below command in the Magento root folder.
```
php bin/magento admin:user:create --admin-user=magecomp --admin-password=Magecomp@123 --admin-email=test@magecomp.com --admin-firstname=Magecomp --admin-lastname=Admin
```

[![Hire Magento Programmer](https://magecomp.com/blog/wp-content/uploads/2025/02/Hire-Magento-Programmer-CTA-4.webp)](https://magecomp.com/services/hire-magento-programmer/)

**Step 3:** Now, you have successfully created a new admin account.
Go to the admin login page and add the login details.
[![](https://magecomp.com/blog/wp-content/uploads/2023/01/new-admin-user.png)](https://magecomp.com/blog/wp-content/uploads/2023/01/new-admin-user.png)

Your new admin dashboard is here.
[![new admin dashboard](https://magecomp.com/blog/wp-content/uploads/2023/01/new-admin-dashboard.png)](https://magecomp.com/blog/wp-content/uploads/2023/01/new-admin-dashboard.png)

## Conclusion:
Hence, you can easily create a new admin user using the command line in Magento 2. If you have any doubts, share them with me through the comment section. Share the solution with other Magento developers and stay in touch with us for more Magento 2 tutorials.
[![Magento version upgrade](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Version-Upgrade-CTA-1.webp)](https://magecomp.com/services/magento-upgrade-services/)

**Happy Coding!**


---

_View the original post at: [https://magecomp.com/blog/create-admin-user-via-command-line-magento-2/](https://magecomp.com/blog/create-admin-user-via-command-line-magento-2/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-07-13 05:34:43 UTC_  
