---
title: "How to Get Admin Path Command Line in Magento 2"
url: "https://magecomp.com/blog/get-admin-path-command-line-magento-2/"
date: "2021-06-17T10:05:00+00:00"
modified: "2024-11-25T14:12:25+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "Magento Tutorials"
word_count: 256
reading_time: "2 min read"
summary: "Hello, Magento Friends!"
description: "Learn more to find out How to Get the Admin Path Command Line in Magento 2 with a terminal command and output of the same."
keywords: "Magento Tutorials"
language: "en"
schema_type: "Article"
related_posts:
  - title: "Fixed: Magento 2 Backend Not Working (updated)"
    url: "https://magecomp.com/blog/fixed-magento-2-backend/"
  - title: "How to Enable Push Notifications for your Magento 2 Store"
    url: "https://magecomp.com/blog/enable-push-notifications-magento-2/"
  - title: "How to Protect Your Magento 2 Images and Source Code from Stealing?"
    url: "https://magecomp.com/blog/protect-magento-2-images-source-code-from-stealing/"
---

# How to Get Admin Path Command Line in Magento 2

_Published: June 17, 2021_  
_Author: Dhiren Vasoya_  

![How-to-Get-Admin-Path-Command-Line-in-Magento-2](https://magecomp.com/blog/wp-content/uploads/2021/06/How-to-Get-Admin-Path-Command-Line-in-Magento-2.png)

**Hello, Magento Friends!**

Today I am here to help you all with How to Get Admin Path Command Line in Magento 2. You can add the command in bin/magento. However, we will guide you with the proper command and output of it.
The Admin URL is nothing but the URL which can be used to access the backend or the admin panel of your Magento 2 store. The admin panel can be used to view, edit and manage everything from extension, order data, customer, and set your checkout also. Can be regarded as a center of information for your Magento store.
There are both ways to get the admin path. From the command line or by running the code in your php file.
Let’s get rolling!
## How to Get Admin Path Command Line in Magento 2?
### Get Admin Path Via Command Line
First, open the command prompt or terminal. Then, run the below-given command in Magento 2 root directory to retrieve the Admin path.
**Syntax:**

```
php bin/magento info:adminuri
```

**Output:**

```
Admin URI: /admin
```

### Get Admin Path Via env.php File
First, navigate to the below-given path.
**app\etc\env.php**

Now, run the following code.
```
'backend' => [

        'frontName' => 'admin'

    ]
```

That’s it!
## Summing It Up:
Run the above code properly and you will surely get the desired output. We hope this helped. Also, [**Hire a Dedicated Magento Developer**](https://magecomp.com/hire-magento-developer.html) for your E-commerce business and custom-develop your store with the guidance of our certified developers.
Share this article with your Magento friends.
Have a G’day!
**Happy Reading!**


---

_View the original post at: [https://magecomp.com/blog/get-admin-path-command-line-magento-2/](https://magecomp.com/blog/get-admin-path-command-line-magento-2/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-07-24 17:16:04 UTC_  
