Why the strange string?

Whenever you install Magento 2, Magento would automatically create an admin URL with random string appended to it at the end. It does this for the simple fact that you’re critically exposed to threats & brute force attacks if you keep an easy and guessable admin panel URL. Using a customize Admin Panel URL or Login panel URL is highly recommended, since it makes it difficult for hackers to even find your Magento 2 admin panel login page in the first place; leave alone penetrate into your admin panel.

Why Change it?

When it comes to the eCommerce development process, we won’t need such a sophisticated URL unless we are hosting our development environment in a public domain that is accessible to all (which is most often, not the case). Once the eCommerce development process completes and we proceed to migrate our site to a live environment, we’d need to change the Magento 2 admin login URL to a more complex one to ensure enhanced security.

So in simple terms, it wouldn’t be advisable to mess with the secure URL if your store is visible on online. For development purposes, you can go ahead and change it.

3 Easy Methods To Customize The Magento 2 Admin Login URL

1. Changing the admin path in Config.php

After Magento 2 is successfully installed, the admin URL will get saved in an environment configuration file called as env.php located in the following path:


The file looks like this:

You can change the admin path by modifying the value against‘frontName’.

2. Using Magento 2 Command Line

Open the terminal or command prompt and navigate to the directory in which the Magento 2 is installed. Enter the following command to change the Admin panel URL:

php bin/magentosetup:config:set --backend-frontname="myadmin"

3. Using Admin Panel Configuration

Lastly, this the easiest and simplest option to change the admin panel URL.

  • Login to the Magento 2 admin panel URL and navigate to Stores ->Configuration.
  • Under the Advanced section, click on the Admin menu item. 
  • Expand the Admin Base URL section and set the value of the Use Custom Admin Path to Yes.
  • Use the Custom Admin Path text field to specify the custom admin ‘frontname’ and save the configuration.

Did this tutorial help you? Let us know in the email! Do you have any other questions? Reach out to us for everything Magento and we’ll be more than glad to assist! We have an awesome team of expert Magento developers who have hands-on experience in Magento 1 as well as Magento 2. So if you have a Magento online store that needs customization or quick-fixes, call us at +1 516 717 2049 or fill this contact us form to instantly hire a developer.

We also have a great Magento 1 and 2 Extensions Store at store.velanapps.com. Visit our Magento 1 extensions and Magento 2 extensions store and find the perfect extension for your Magento Online Store! If you can’t find an extension or want to request for one, use this contact form.