• Email: [email protected]
  • Dedicated Server Login
  • About
  • 9288041031
  • Knowledge Base
  • Support
India's best web hosting | Ehostpiya India
  • Home
  • Hosting
    Web Hosting Quality Hosting Starting at ₹60/mo
    Cloud VPS Starting at ₹300/mo
    Dedicated Server First Starting at ₹2401/mo
    Reseller Web Hosting Conveniently Starting at ₹421/mo
    Application For Hosting
    • iconWordPress Hosting
    • iconJoomla Hosting
    • iconMagento Hosting
    • iconOpencart Hosting
    • iconPrestashop Hosting
    • iconDrupal Hosting
  • Email
  • Domain
  • SVG
    Contact Us Face any problem contact with us
    SVG
    About Us We are leading hosting company
  • My Account
Web Hosting Blogs by Ehostpiya | Tips and Tricks Web Hosting Blogs by Ehostpiya | Tips and Tricks
Buy Now

Archives

  • October 2026
  • September 2026
  • August 2026
  • October 2023

Categories

  • Control Panels
  • Magento
  • Miscellaneous
  • SEO
  • Technology
  • Trends
  • Web Hosting
  • Wordpress
Facebook Twitter Instagram Pinterest
Home How to Change the Magento Admin URL?
ByVandeeta
October 3, 2026

How to Change the Magento Admin URL?

Table of Contents

Toggle
  • How to Change the Magento Admin URL
    • What Is the Magento Admin URL?
  • Why Change the Magento Admin URL?
  • Before Changing the Magento Admin URL
      • 1. Create a Backup
      • 2. Make Sure You Have SSH or File Access
      • 3. Record the Current Admin URL
  • Where Magento Stores the Admin URL
  • How to Change the Magento Admin URL Using SSH
    • Step 1: Connect to Your Server
    • Step 2: Navigate to the Magento Directory
    • Step 3: Back Up env.php
    • Step 4: Open env.php
  • Step 5: Flush Magento Cache
  • Step 6: Test the New Admin URL
  • Step 7: Test the Storefront
  • Change Magento Admin URL With a One-Line Command
      • Important
  • How to Change Magento Admin URL on DirectAdmin
    • Method 1: Using DirectAdmin File Manager
      • Step 1: Log in to DirectAdmin
      • Step 2: Open File Manager
      • Step 3: Open env.php
      • Step 4: Find frontName
      • Step 5: Save the File
      • Step 6: Flush Magento Cache
  • Change Magento Admin URL on cPanel
    • Step 1: Open File Manager
    • Step 2: Open env.php
    • Step 3: Locate the Backend Configuration
    • Step 4: Save the File
    • Step 5: Clear Magento Cache
  • How to Choose a New Magento Admin URL
  • What Happens to the Old Admin URL?
  • What If the New Admin URL Does Not Work?
    • 1. Verify frontName
    • 2. Check for Typographical Errors
    • 3. Flush the Cache
    • 4. Check Magento Logs
    • 5. Check Web Server Logs
  • What If You Completely Lose Access to the Magento Admin?
  • Common Mistakes When Changing the Magento Admin URL
      • Mistake 1: Editing the Wrong Magento Installation
      • Mistake 2: Forgetting the New URL
      • Mistake 3: Not Clearing Cache
      • Mistake 4: Sharing env.php
      • Mistake 5: Treating a Hidden Admin URL as Complete Security
      • Mistake 6: Changing Production Configuration Without a Backup
  • Does Changing the Admin URL Improve Magento Security?
  • Recommended Magento Admin Security Setup
  • Frequently Asked Questions
    • Can I change the Magento Admin URL?
    • What file contains the Magento Admin URL?
    • Do I need to change my Magento administrator username?
    • Will changing the Admin URL affect my customers?
    • Do I need to restart Apache or Nginx?
    • Can I use any word as the Admin URL?
    • Is changing the Admin URL enough to secure Magento?
  • Quick Checklist
  • Final Thoughts

How to Change the Magento Admin URL

The Magento Admin URL is the address used to access the backend of a Magento store. By default, some Magento installations may use a predictable administrator path, while others are configured with a custom path during installation.

Changing the Magento Admin URL can make the administrative endpoint less predictable and can be useful as one layer of a broader security strategy. However, changing the URL should not be considered a replacement for strong passwords, two-factor authentication, access controls, security updates, and other Magento security practices.

In Magento, the Admin URL is controlled through the frontName value in the Magento environment configuration.

This guide explains how to change the Magento Admin URL safely using SSH, DirectAdmin, cPanel, or a file editor.


What Is the Magento Admin URL?

The Magento Admin URL is the backend address where administrators sign in and manage the store.

For example:

https://example.com/admin

A customized Admin URL might look like:

https://example.com/storemanager

or:

https://example.com/admin_7x9k

The exact path depends on your Magento configuration.


Why Change the Magento Admin URL?

A customized administrator path can make the backend URL less obvious to automated scanners that target common administrator paths.

For example, instead of:

https://example.com/admin

you could use:

https://example.com/controlpanel

However, the URL itself should not be treated as a complete security mechanism.

A secure Magento installation should also use:

  • HTTPS
  • Strong administrator passwords
  • Two-factor authentication
  • Role-based permissions
  • Regular Magento updates
  • Updated extensions
  • Server-level access controls
  • Security monitoring
  • Reliable backups

Before Changing the Magento Admin URL

Changing the administrator path affects how you access the Magento backend, so prepare the server before making the change.

1. Create a Backup

Create a current backup of your Magento files and database.

At minimum, make sure you can restore:

app/etc/env.php

and your Magento database.

2. Make Sure You Have SSH or File Access

You need access to the Magento installation directory.

Depending on your hosting environment, this may be through:

  • SSH
  • DirectAdmin File Manager
  • cPanel File Manager
  • Another server management panel

3. Record the Current Admin URL

Before making changes, note the existing administrator URL.

For example:

https://example.com/admin

This makes troubleshooting easier if the new URL does not work.


Where Magento Stores the Admin URL

Magento stores the administrator front name in:

app/etc/env.php

Inside this file, look for the backend section.

A configuration may look similar to:

'backend' => [
    'frontName' => 'admin'
],

The value of:

frontName

determines the administrator path.

For example:

'frontName' => 'storeadmin'

means that the Admin URL uses:

https://example.com/storeadmin

How to Change the Magento Admin URL Using SSH

SSH is one of the most direct ways to change the Magento administrator path.

Step 1: Connect to Your Server

Connect to the server using SSH:

ssh username@server-ip

Replace:

username

with your server username and:

server-ip

with your server’s IP address or hostname.


Step 2: Navigate to the Magento Directory

Change to your Magento installation directory.

For example:

cd /var/www/html

Your actual Magento path may be different.

You can verify that you are in the correct directory with:

ls

A Magento root directory commonly contains:

app
bin
composer.json
pub
vendor
var

Step 3: Back Up env.php

Before modifying the configuration, create a backup:

cp app/etc/env.php app/etc/env.php.backup

This gives you a quick way to restore the previous configuration if necessary.


Step 4: Open env.php

Use an editor such as nano:

nano app/etc/env.php

Find:

'backend' => [
    'frontName' => 'admin'
],

Change admin to your desired administrator path.

For example:

'backend' => [
    'frontName' => 'storemanager'
],

Save the file.

If using nano:

Ctrl + O
Enter
Ctrl + X

Step 5: Flush Magento Cache

After changing the configuration, clear the Magento cache:

php bin/magento cache:flush

You can also check the cache status:

php bin/magento cache:status

Step 6: Test the New Admin URL

Open your new administrator URL:

https://example.com/storemanager

Replace example.com with your domain.

If the login page appears, enter your existing administrator credentials.


Step 7: Test the Storefront

After changing the Admin URL, also test the customer-facing website:

https://example.com

Check:

  • Homepage
  • Product pages
  • Category pages
  • Customer login
  • Cart
  • Checkout
  • Admin login

Changing the administrator path should not normally change the storefront URL.


Change Magento Admin URL With a One-Line Command

For experienced administrators, the Magento CLI can be used to configure the backend front name.

From the Magento root directory, you can use:

php bin/magento setup:config:set --backend-frontname="storemanager"

Then flush the cache:

php bin/magento cache:flush

Afterward, access:

https://example.com/storemanager

Important

Always verify the command against the Magento version and deployment environment you are running before using it on a production store. If you use a custom deployment or configuration management system, make sure the change is also reflected in your deployment process.


How to Change Magento Admin URL on DirectAdmin

If Magento is hosted on DirectAdmin, you can change the Admin URL through SSH or File Manager.

Method 1: Using DirectAdmin File Manager

Step 1: Log in to DirectAdmin

Open your DirectAdmin account.

Step 2: Open File Manager

Navigate to your Magento installation.

A common location is:

domains/example.com/public_html

Step 3: Open env.php

Navigate to:

app/etc/env.php

Step 4: Find frontName

Look for:

'backend' => [
    'frontName' => 'admin'
],

Change it to:

'backend' => [
    'frontName' => 'storemanager'
],

Step 5: Save the File

Save the changes.

Step 6: Flush Magento Cache

If SSH access is available:

cd ~/domains/example.com/public_html
php bin/magento cache:flush

Then test:

https://example.com/storemanager

Change Magento Admin URL on cPanel

You can also change the administrator path through cPanel’s File Manager.

Step 1: Open File Manager

Log in to cPanel and open File Manager.

Navigate to the Magento installation.

For example:

public_html/

Step 2: Open env.php

Navigate to:

app/etc/env.php

Step 3: Locate the Backend Configuration

Find:

'backend' => [
    'frontName' => 'admin'
],

Change the path:

'backend' => [
    'frontName' => 'storemanager'
],

Step 4: Save the File

Save the configuration.

Step 5: Clear Magento Cache

If you have terminal or SSH access:

php bin/magento cache:flush

Then open:

https://example.com/storemanager

How to Choose a New Magento Admin URL

Choose an administrator path that is:

  • Not obvious
  • Easy for authorized administrators to remember
  • Not identical to the domain name
  • Not unnecessarily long
  • Compatible with your access policies

For example:

storemanager

is easier to remember than an extremely complicated random string.

You could also use a less predictable path such as:

admin_84kx

Avoid paths containing sensitive information such as:

companypassword

or:

secretadmin

The purpose is to make the endpoint less predictable, not to store a secret in the URL.


What Happens to the Old Admin URL?

After changing:

frontName

the old administrator path should no longer be the correct Magento Admin URL.

For example, if you changed:

/admin

to:

/storemanager

you should use:

https://example.com/storemanager

for future administrator logins.

Do not assume that Magento will automatically redirect the old URL to the new one.


What If the New Admin URL Does Not Work?

If the new URL returns an error, check the following.

1. Verify frontName

Run:

grep -n "frontName" app/etc/env.php

Make sure the configured value matches the URL you are using.

For example:

'frontName' => 'storemanager',

means:

https://example.com/storemanager

2. Check for Typographical Errors

Make sure the URL matches the configuration exactly.

For example:

storemanager

is different from:

store-manager

and:

storeManager

3. Flush the Cache

Run:

php bin/magento cache:flush

4. Check Magento Logs

Review:

var/log/

You can use:

tail -f var/log/system.log

and:

tail -f var/log/exception.log

when troubleshooting.


5. Check Web Server Logs

If Magento logs do not reveal the problem, check the Apache or Nginx error logs.

A web-server configuration problem can prevent the new Admin URL from reaching Magento correctly.


What If You Completely Lose Access to the Magento Admin?

If you accidentally configure the wrong administrator path, you can restore the previous value directly in:

app/etc/env.php

For example:

'backend' => [
    'frontName' => 'admin'
],

Then clear the cache:

php bin/magento cache:flush

Afterward, test the original administrator URL.

This is why creating a backup before changing env.php is recommended.


Common Mistakes When Changing the Magento Admin URL

Mistake 1: Editing the Wrong Magento Installation

On servers hosting multiple websites, make sure you modify the env.php belonging to the correct Magento installation.

Mistake 2: Forgetting the New URL

After changing the administrator path, save the new URL in your password manager or internal documentation.

Mistake 3: Not Clearing Cache

Magento configuration changes may not behave as expected until the appropriate cache is refreshed.

Mistake 4: Sharing env.php

Never publicly share the complete contents of:

app/etc/env.php

It contains sensitive configuration information.

Mistake 5: Treating a Hidden Admin URL as Complete Security

Changing the URL does not replace proper authentication or security controls.

Mistake 6: Changing Production Configuration Without a Backup

Always maintain a recovery path before making configuration changes on a live store.


Does Changing the Admin URL Improve Magento Security?

A non-default or less predictable Admin URL can reduce exposure to automated requests targeting commonly known administrator paths.

However, it should be considered a defense-in-depth measure, not a primary security control.

For stronger Magento security, combine it with:

  • HTTPS
  • Strong passwords
  • Two-factor authentication
  • Least-privilege administrator roles
  • Regular security updates
  • Updated extensions
  • Server firewalls
  • Access restrictions
  • Security monitoring
  • Regular backups

Recommended Magento Admin Security Setup

A practical administrator security setup can include:

Security MeasurePurpose
Custom Admin URLMakes the endpoint less predictable
HTTPSEncrypts administrator traffic
Strong passwordProtects administrator credentials
2FAAdds another authentication factor
Admin rolesLimits user permissions
IP restrictionsLimits where administrators can connect
Firewall/WAFFilters unwanted traffic
UpdatesAddresses known security issues
BackupsProvides recovery capability
MonitoringHelps identify suspicious activity

No single measure should be relied upon by itself.


Frequently Asked Questions

Can I change the Magento Admin URL?

Yes. Magento’s administrator path is controlled by the backend frontName configuration in:

app/etc/env.php

It can also be configured through Magento’s CLI tools.

What file contains the Magento Admin URL?

The administrator front name is stored in:

app/etc/env.php

Look for:

'backend' => [
    'frontName' => '...'
],

Do I need to change my Magento administrator username?

No. Changing the Admin URL does not require changing the administrator username.

Will changing the Admin URL affect my customers?

Normally, changing the backend path does not change the public storefront URL. However, you should always test both the storefront and backend after making the change.

Do I need to restart Apache or Nginx?

Usually, changing the Magento backend front name does not require a web-server restart. Clear the Magento cache and test the new URL. If your server uses additional caching or custom configuration, follow your deployment procedures.

Can I use any word as the Admin URL?

The path should follow Magento’s configuration requirements and should not conflict with another application route or server configuration. Choose a simple, non-obvious path that your administrators can manage safely.

Is changing the Admin URL enough to secure Magento?

No. It is only one layer of defense. Strong authentication, two-factor authentication, updates, least-privilege access, server security, monitoring, and backups remain important.


Quick Checklist

Before finishing the change, verify:

  • Magento backup is available.
  • app/etc/env.php has been backed up.
  • The correct Magento installation was selected.
  • The frontName value was changed correctly.
  • Magento cache was flushed.
  • The new Admin URL opens successfully.
  • Administrator login works.
  • The storefront still works.
  • Magento logs show no new errors.
  • The new Admin URL has been stored securely.
  • Two-factor authentication is enabled where appropriate.

Final Thoughts

Changing the Magento Admin URL is a relatively simple configuration task, but it should be performed carefully on a production store. The key configuration is the backend.frontName value in app/etc/env.php, which determines the path used to access the Magento backend.

Before making the change, create a backup and record the existing configuration. Afterward, clear the Magento cache and test both the new administrator URL and the customer-facing storefront.

Most importantly, treat a custom Admin URL as an additional security layer rather than a replacement for strong authentication, two-factor authentication, regular updates, access controls, monitoring, and backups.

If you want, the next related Magento article can be “How to Create Magento Admin Users and Roles” to continue the administration/security series.

ByVandeeta
Updated October 03, 2026
  • Magento

Read Next

ByVandeeta
October 3, 2026

How to Create an Admin User in Magento?

How to Create an Admin User in Magento Magento allows store owners and administrators to create separate backend…
  • Magento
ByVandeeta
October 3, 2026

How to Reset a Magento Admin Password?

How to Reset a Magento Admin Password Forgetting a Magento administrator password can prevent you from accessing important…
  • Magento
ByVandeeta
October 3, 2026

How to Configure Magento Store Information?

How to Configure Magento Store Information Store information is one of the foundational settings in Magento. It defines…
  • Magento

Leave a Reply Cancel reply

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

Explore Categories

  • Control Panels 7
  • Magento 52
  • Miscellaneous 5
  • SEO 17
  • Technology 10
  • Trends 9
  • Web Hosting 7
  • Wordpress 100

Recent Posts

  • How to Fix WordPress “Too Many Redirects”
  • How to Fix WordPress Critical Error
  • How to Fix WordPress Database Connection Error
  • How to Fix WordPress White Screen of Death
  • How to Fix WordPress 404 Error

Recent Comments

  1. Tabias H. on The Future is 5G: Understanding the Next Wave of Connectivity
  2. Elliot Alderson on Evolving Workspaces: The Rise of the Hybrid Work Trend
  3. James Mann on Evolving Workspaces: The Rise of the Hybrid Work Trend
Swyft

Welcome to the Ehostpiya Blog, your trusted resource for web hosting, WordPress, VPS, domains, website security, and online business tips.

Our goal is to make web hosting and website management easier to understand for everyone—from beginners launching their first website to experienced developers and business owners. We publish practical guides, hosting tips, tutorials, and helpful insights to help you build, manage, and grow your website successfully.

At Ehostpiya, we believe that reliable information and quality hosting go hand in hand. Explore our latest articles and discover simple solutions for a faster, safer, and more successful online presence.

  • Facebook
  • Twitter
  • Instagram
  • Pinteres

Featured Posts

  • AI and Ethics: Navigating the Complex Landscape of Artificial Intelligence
    by Vandeeta
    October 11, 2023
  • AR and VR: Blurring the Lines Between Reality and Virtuality
    by Vandeeta
    October 11, 2023
  • Best WordPress Caching Plugins to Improve Website Speed
    by Vandeeta
    September 26, 2026
  • Blockchain Unchained: How Distributed Ledger Technology is Transforming Industries
    by Vandeeta
    October 11, 2023

Web Hosting Discount

cLAIM NOW
logo

Ehostpiya is reliable Web hosting provider, with aim to provide affordable Website and application hosting to various clients for their online business and presence.

Hosting
  • Web Hosting
  • Cloud VPS
  • Reseller Hosting
  • Email Hosting
  • Dedicated Server
  • Nodejs Hosting
  • SSL Certificate
Legal
  • Accepted Uses Policy
  • privacy Policy
  • Terms of Service
  • Refund and cancellation
  • Service Delivery Policy
Company
  • About Us
  • Our Clients
  • Contact Us
  • Our Blog
Support & Tools
  • Open Support Request
  • View Ticket
  • Knowledge Base
  • Report Abuse
  • check nameserver
  • What is my IP
  • Mx lookup

© Ehostpiya, All rights reserved

  • Terms & Condition
  • Privacy Policy