Display or change the Admin URI
Log in to the Magento server as, or switch to, a user who has permissions to write to the Magento file system. One way to do this is to switch to the Magento file system owner.
If you use the bash shell, you can also use the following syntax to switch to the Magento file system owner and enter the command at the same time:
su <Magento file system owner> -s /bin/bash -c <command>
If the Magento file system owner does not allow logins you can do the following:
sudo -u <Magento file system owner> <command>
To run Magento commands from any directory, add
<your Magento install dir>/binto your system
Because shells have differing syntax, consult a reference like unix.stackexchange.com.
bash shell example for CentOS:
You can also run the commands in the following ways:
cd <your Magento install dir>/binand run them as
./magento <command name>
php <your Magento install dir>/bin/magento <command name>
<your Magento install dir> is a subdirectory of your web server's docroot. Need help locating the docroot? Click here.
In addition to the command arguments discussed here, see Common arguments.
Before you run this command, you must Create or update the deployment configuration.
Display the Admin URI
This section discusses how to use the command line to display the Admin Uniform Resource Identifier (URI).
A sample result follows:
Admin Panel URI: /admin_1wgrah
You can also view the Admin URI in
<your Magento install dir>/app/etc/env.php. A snippet follows:
Change the Admin URL
To change the Admin URI, use the magento setup:config:set command.
- Installing the Magento software using the command line
- Remove sample data modules or update sample data
- Display or change the Admin URI
- Enable or disable modules
- Uninstall modules
- Create or update the deployment configuration
- Enable or disable maintenance mode
- Create the Magento database schema
- Update the Magento database schema and data
- Configure the store
- Create a Magento administrator
- Back up and roll back the file system, media, and database
- Uninstall themes
- Uninstall language packages
- Uninstall the Magento software
- Update the Magento software
- Reinstall the Magento software