There are various method try one of the following -
1) 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"
2) 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:
return array (
'frontname' => "myadmin"
You can change the admin path by modifying the value against‘frontName’.
3) Using admin panel configuration
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.
Source : Internet