How to Get admin path Command Line in Magneto 2 through Code
Vinh Jacker | 03-17-2025
In this tutorial, we will demonstrate how to get admin path command line in Magento 2 which is one of tutorials our in Command Line Series.
Get Admin Path command line
Commands syntax:
php bin/magento info:adminuri
Output:
Admin URI: /admin_mageplaza
So the path is /admin_mageplaza, now navigate your browser to domain.com/admin_mageplaza to access to Magento 2 backend.
Get Admin path in env.php file
Do you know? You can get admin path without access to etc/env.php file.
'backend' =>
array (
'frontName' => 'admin_mageplaza',
),
Wrap up
That’s how you can get back your admin path command line in Magento 2 in case you have forgotten it.
I hope this is a useful tutorial for you.
Thank you for reading!
Jacker is the Chief Technology Officer (CTO) at Mageplaza, bringing over 10 years of experience in Magento, Shopify, and other eCommerce platforms. With deep technical expertise, he has led numerous successful projects, optimizing and scaling online stores for global brands. Beyond his work in eCommerce development, he is passionate about running and swimming.
Related Post
Magento 2.4.9 Beta Release: What's New?
Magento 2.4.9 beta is here. Stay up to date with every release milestone with this regularly updated guide.
Google Analytics Website Traffic: The A–Z Guide for Magento 2 Store Owners
Learn how to analyze website traffic in Google Analytics 4, identify high-quality traffic sources, and grow your Magento 2 store with data-driven insights.
The Complete Guide to UTM Parameters & Google Analytics for Magento website
Master UTM parameters and Google Analytics for Magento. Track traffic sources, measure campaign performance, and practical tips to use it for better business decisions.
How to implement Cookie Consent for GTM & Google Analytics in Magento Under GDPR?
Implement cookie consent for GTM & GA4 in Magento under GDPR. Step-by-step guide using Google Consent Mode v2 to avoid fines and maintain analytics.
Speed vs. Sales: Comparing Hyvä Checkout and Mageplaza One Step Checkout
Learn how Hyvä Checkout and Mageplaza One Step Checkout impact order completion rates and revenue growth.
Magento 2.4.9 Beta Release: What's New?
Magento 2.4.9 beta is here. Stay up to date with every release milestone with this regularly updated guide.
Google Analytics Website Traffic: The A–Z Guide for Magento 2 Store Owners
Learn how to analyze website traffic in Google Analytics 4, identify high-quality traffic sources, and grow your Magento 2 store with data-driven insights.
The Complete Guide to UTM Parameters & Google Analytics for Magento website
Master UTM parameters and Google Analytics for Magento. Track traffic sources, measure campaign performance, and practical tips to use it for better business decisions.
How to implement Cookie Consent for GTM & Google Analytics in Magento Under GDPR?
Implement cookie consent for GTM & GA4 in Magento under GDPR. Step-by-step guide using Google Consent Mode v2 to avoid fines and maintain analytics.
Speed vs. Sales: Comparing Hyvä Checkout and Mageplaza One Step Checkout
Learn how Hyvä Checkout and Mageplaza One Step Checkout impact order completion rates and revenue growth.