Admin users can disable the Two-Factor Authentication (2FA) by using the command line methods from the Magento 2 root directory documented in this article.
Magento 2 Admin Login & Two-Factor Authentication (2FA)
What is Two-Factor Authentication (2FA)?
Two-Factor Authentication (2FA) is one category of Multi-Factor Authentication (MFA) that strengthens access security requirements by needing two authentication factors/methods to verify your identity.
Although earlier versions of Magento offered options to not install or to disable Two-Factor Authentication (2FA), Magento 2.4 and greater versions enable 2FA by default on every installation. The Magento admin user must disable 2FA using the command line.
While it is never recommended to disable 2FA in Magento 2.4 and greater versions, given its strength of security, there are a few scenarios in which you may want to disable it:
1. To enable the admin user to log into the Magento 2 Admin Panel Dashboard for the first time due to 2FA warning message.
2. When 2FA is not needed in a staging environment.
3. When 2FA is not needed in a testing environment.
4. When 2FA is not needed in a development environment.
Magento 2.4 &
By default, Magento will enable Two-Factor Authentication (2FA) after Magento version 2.4. So, before logging into the Magento Admin Panel Dashboard, the admin users will need to configure their 2FA either through the user interface or a web API. The 2FA provides an additional layer of security to the Magento 2 Admin Panel, making it harder for suspicious users to log in to the Magento 2 Admin Panel Dashboard without authorization. It also helps decrease the chance of questionable access to the Magneto 2 Admin Panel Dashboard. So, we do not recommend that you disable 2FA authentication in your Magento 2 Admin Panel Dashboard for security reasons. If you still do not wish to use 2FA, you can disable 2FA for the development, testing, or staging, environment or store.
Once you install Magento 2 for your domain, you will receive the following warning message while trying to access the Magento Admin Panel Dashboard for the first time:
Due to this warning message, you will not be able to log in to the Magento 2 Admin Panel Dashboard. Unfortunately, Magento 2.4 and greater versions do not provide an option to disable Two-Factor Authentication (2FA). But you can disable the 2FA by following any of the command line methods from your Magento 2 root directory.
The first command line method for disabling 2FA temporarily from your Magento 2 root directory is done by issuing the following command:
The second command line method for disabling 2FA temporarily from your Magento 2 root directory is done by issuing the following command:
The third command line method for disabling 2FA temporarily from your Magento 2 root directory is done by taking the following steps:
vi <Magento 2 root directory>/app/etc/config.php
Find 'Magento_TwoFactorAuth' => 1, and replace with 'Magento_TwoFactorAuth' => 0,
Where you use a value of 0 for disabling 2FA and a value of 1 for enabling 2FA.
3. Clean the cache by the following command:
Now you will be able to log into the Magento Admin Panel Dashboard without using Two-Factor Authentication (2FA).
Installing Magento 2 via Composer or a ZIP/TAR Archive File
You can install Magento 2 either using Composer or downloading an archive file for the Magento-specific version in either ZIP or TAR archive file format. But please note that installing Magento from an archive lacks the advantages of using Composer, including reusing third-party libraries without wrapping them with source code, reducing extension conflicts and compatibility issues by using a component-based architecture with robust dependency management, etc. In addition, you should install before installing Magento 2.4, and Magento does not support Elasticsearch versions 2.x, 5.x, and 6.x.
Installing Magento 2 via Composer
To install Magento 2 using Composer, you can follow the below steps.
Installing Magento 2 via Composer Step #1: Install Composer
You can run the following scripts in the terminal to install Composer in the current directory:
These installer scripts will check some php.ini settings, notify you if they are set incorrectly, and then download the latest composer.phar in the current directory.
If you want to put the composer.phar into a particular location as per your requirement, you can call composer from any location such as the following directory:
Issue the composer --help command to see available options for specific environments.
To install Magento 2.4 via Composer, you can run the following commands in the current directory:
You can choose the Magento version in the command shown above as per your requirement by replacing the 2.4.0 with the version you wish to install.
You can run the following commands in the Magento root directory to set file permissions:
Issue the bin/magento list command to display a complete list of commands. Issue the bin/magento help <command> to get help for a particular command.
Magento 2.4 Requirements
- Mail Server: Mail Transfer Agent (MTA) or an SMTP Server.
- Operating Systems (Linux x86-64): Linux distributions, such as RedHat Enterprise Linux (RHEL), CentOS, Ubuntu, and Debian. Magento is not supported on Microsoft Windows and macOS.
- PHP Extensions: ext-bcmath,ext-ctype, ext-curl, ext-dom, ext-fileinfo, ext-gd, ext-hash, ext-iconv, ext-intl, ext-json, ext-libxml, ext-mbstring, ext-openssl, ext-pcre, ext-pdo_mysql, ext-simplexml, ext-soap , ext-sockets, ext-sodium, ext-xmlwriter, ext-xsl, ext-zip, lib-libxml, lib-openssl.
- PHP OPcache: The OPcache is enabled in many PHP distributions and is recommended for performance reasons.
- PHPUnit: PHPUnit (as a command-line tool) 9.0.0
- RAM: Magento applications and extensions upgrade requires up to 2GB of RAM. If the system has less than 2GB of RAM, you will need to create a swap file to avoid upgrade failure.
- System Dependencies: bash, gzip, lsof, mysql , mysqldump, nice, php, sed, tar.
- SSL: A valid security certificate is required for HTTPS.
If you are looking for a suitable Magento hosting plan for your website, you are in the right place. At we offer optimized ecommerce hosting solution built for speed, security, and scale. You can find the available Fully Managed Magento Hosting plan on the Nexcess website. We also install Magento 2 for our customers as per their requirements using our own customized nkmagento2 command from our side. In addition, our skilled team provides 24/7/365 support and monitoring services so that you can focus on your websites. Contact our team today to learn more.
Not a Nexcess Customer Yet?
offers you many benefits from security and performance scanning, automated maintenance, and updates to beautiful, customizable designs and 24/7/365 support. Furthermore, Nexcess offers three flagship managed platforms to choose from:
with automatic plugin and platform updates.
with built-in image compression and the acclaimed interface.
- containing , the ability to add-on server clusters, and PCI compliance.
Read more about the Fully Managed Magento Hosting and its benefits for your business.
Optimized Ecommerce Hosting for Speed, Security and Scale
It’s hosting optimized for WordPress. That means a faster, more secure and scalable website. Smart monitoring tools are built-in to help you keep it that way.
It’s why WordPress Users Trust Nexcess Hosting.
We also have a variety of Nexcess support articles about Magento 2. Our range of hosting plans caters to any business scale. We do all the heavy lifting for you to focus on growing your business. In addition, we automatically update ore components and plugins to the latest version and ensure your hosting environment is properly optimized, secured, and updated.
Need a No-Code Website Building Solution?
Next Steps with a Nexcess Cloud Hosting Solution?
Read more about the Fully Managed Cloud Environment by Nexcess and its benefits for your business.
A Cloud Hosting Solution That Lets You Do Business Your Way
We believe in the promise of cloud: scalability, security, performance, and ease of use. Together with our team, clients, and partners, we’ve built something better.
Choose From Multiple Applications
Whether you’re a small business or a high-traffic eCommerce store, our cloud hosting solutions are designed around your needs: auto scaling, PCI compliance, and comprehensive development tools provide you with maximum dynamic flexibility in a fully managed cloud environment.
We make applications easy with environment optimizations for:
If you need any assistance with the above-mentioned, don't hesitate to reach out. For 24-hour assistance any day of the year, Nexcess customers can contact our support team by email or through your Client Portal.
- Magento 2 Nexcess Knowlesge Base
- Magento 2 Hosting
- Nexcess Scope of Support - Magento 2
- The Ultimate Magento 2 Checklist for Performance
- Magento 2 Optimized - Ebook
- How to enable Elasticsearch for your Nexcess Cloud account
- How to configure Magento 2 to use Elasticsearch
- How to use Elasticsearch with ElasticPress
- Magento 2 Help