Skip to content
Search our site for answers
Login
  • Help Docs
  • API Docs
  • liquidweb.com
  • Hosting Services
    • Cloud VPS Hosting
    • Dedicated Servers
    • GPU Hosting
    • Hosting For WordPress
    • Hosting For WooCommerce
    • Email Hosting
    • VMware Hosting
    • Add-ons
  • Security & Compliance
    • SSL Certificates
    • Firewalls
    • Cloud Hosting
    • Two Factor Authentication
    • DDoS Protection
    • Compliance
    • Malware Protection
  • Domain & DNS
    • Domain Registration
    • DNS Settings
    • Nameservers
    • Subdomains
    • Domain Forwarding
    • Email DNS Setup
  • Account & Billing
    • Account Setup
    • Payment Methods
    • Billing Cycles
    • Refunds Cancellations
    • Invoices Receipts
    • Account Security
  • Email Hosting
    • Email Setup
    • Email Forwarding
    • Spam Protection
    • Microsoft 365
    • G Suite Setup
    • Account Security
    • Email Troubleshooting
  • Performance & Optimization
    • Server Optimization
    • Caching Strategies
    • Content Delivery Network
    • Database Performance
    • Image Optimization
  • Server Administration
    • Server Setup
    • SSH Access
    • Command Line Basics
    • Database Management
    • CRON Jobs
    • Apache Nginx Setup
    • Log Analysis
  • CMS & Applications
    • WordPress
    • WooCommerce
    • Magento
    • Joomla
    • Drupal
  • Backups & Recovery
    • Backup Strategies
    • Cloud Backups
    • Disaster Recovery
    • Restoring Backups
    • Raid Configurations
  • Reseller & Partner Support
    • Reseller Program
    • White Label Hosting
    • Partner Portal
    • Client Management
  • Policies & Compliance
    • Terms Of Service
    • Privacy Policy
    • GDPR Compliance
    • Acceptable Use Policy
Help Docs Content Management Systems (CMS) Magento Overview Magento 2 Admin Login: Disable 2FA

Magento 2 Admin Login: Disable 2FA

Although not recommended for production, learn how to disable 2FA in Magento 2.4+ for dev or staging environments using the command line.
Magento 2 Nexcess Security
4 min read

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.

Why Would You Want to Disable Two-Factor Authentication (2FA) in Magento 2.4 & Greater Versions?

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:

  • To enable the admin user to log into the Magento 2 Admin Panel Dashboard for the first time due to 2FA warning message.
  • When 2FA is not needed in a staging environment.
  • When 2FA is not needed in a testing environment.
  • When 2FA is not needed in a development environment.

Magento 2.4 & Two-Factor Authentication (2FA)

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:

Warning Message Accessing Magento 2 Admin Panel Dashboard

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.

Command Line Method #1: Magento 2 Admin Login & Disabling 2FA Temporarily

The first command line method for disabling 2FA temporarily from your Magento 2 root directory is done by issuing the following command:

php bin/magento module:disable Magento_TwoFactorAuth

bin/magento cache:flush

Command Line Method #2: Magento 2 Admin Login & Disabling 2FA Temporarily

The second command line method for disabling 2FA temporarily from your Magento 2 root directory is done by issuing the following command:

bin/magento config:set twofactorauth/general/enable 0

bin/magento cache:flush

Command Line Method #3: Magento 2 Admin Login & Disabling 2FA Temporarily

The third command line method for disabling 2FA temporarily from your Magento 2 root directory is done by taking the following steps:

  1. Open the app folder -> etc -> config.php using any of the text editors (for example the VI Text Editor) from your Magento 2 root directory:


 vi /app/etc/config.php 
  1. 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:


bin/Magento cache:flush 

Now you will be able to log into the Magento Admin Panel Dashboard without using Two-Factor Authentication (2FA).

Was this article helpful?
Thank you for your input.
Thank you for your feedback.
Table of Contents
  • What is Two-Factor Authentication (2FA)?
  • Why Would You Want to Disable Two-Factor Authentication (2FA) in Magento 2.4 & Greater Versions?
  • Magento 2.4 & Two-Factor Authentication (2FA)
Essential hosting resources to help your business stay ahead
Get the guides
Related hosting content
  • Hosting Add-Ons
  • High-Speed Cloud Hosting Services
  • WordPress VPS Hosting

Hosting

  • Cloud Hosting
  • Dedicated Hosting
  • Email Hosting
  • GPU Hosting
  • Magento Hosting
  • Reseller Hosting
  • VPS Hosting
  • Hosting for WordPress

Additional Hosting

  • Add-ons
  • Agency Hosting
  • Application Hosting
  • Database Hosting
  • Ecommerce Hosting
  • Enterprise Hosting
  • Freelancer Hosting
  • High Availability
  • High Performance
  • HIPAA Hosting
  • PCI Compliant Hosting
  • Private Cloud Hosting
  • Server Clusters
  • Small Business Hosting
  • VPS Reseller Hosting
  • Windows Hosting
  • Windows VPS Hosting
  • Linux VPS Hosting
  • Ubuntu VPS Hosting
  • cPanel VPS Hosting
  • KVM VPS Hosting
  • WooCommerce Hosting

Servers

  • Bare Metal Servers
  • Cloud Dedicated Servers
  • Cloud VPS
  • Custom Servers
  • Dedicated Servers
  • Managed Cloud
  • Gaming Server
  • Windows Servers

Managed Hosting

  • Managed ExpressionEngine
  • Managed Craft CMS
  • Managed Cloud
  • Managed Hosting
  • Managed Hosting for WordPress
  • Managed Magento
  • Managed Servers
  • Managed VPS
  • Managed WooCommerce

Studies

  • Every Second Counts
  • Impact of Downtime
  • Hypergrowth Hosting

Resources

  • API
  • Hosting Coupons
  • Blog
  • Customer Stories
  • Ebooks
  • Help Docs
  • Migrations
  • Sitemap
  • SSL Checker
  • Webinars
  • Web Hosting Tools
  • White Papers
  • What is my IP

Hosting Basics

  • Bare Metal
  • Cloud Hosting
  • Dedicated Servers
  • Gaming VPS
  • GPUs
  • Private Cloud
  • VPS
  • Web Hosting

Partnerships

  • Hosting Affiliate Program
  • Partner Programs
  • Refer-a-Friend

Software & Design Solutions

  • GiveWP
  • IconicWP
  • Kadence WP
  • LearnDash
  • MemberDash
  • Modern Tribe
  • Restrict Content Pro
  • SolidWP
  • The Events Calendar

Get Help

  • Chat
  • Sales
  • Support

Company

  • About
  • Careers
  • Data Centers
  • Hosting Prices
  • News
  • Policies
  • Privacy Policy
  • Security
  • Terms and Conditions
  • Web Hosting Deals

Liquid Web, a web hosting company with 18 data centers globally

HostingAdvice.com logo
Liquid Web reviewLiquid Web review

© 2026 Liquid Web, LLC

Privacy Policy

* Promotions may be exclusively available to new customers and cannot be applied to existing accounts. Qualification is at the sole discretion of Liquid Web. Reach out with questions.

  • Solutions
    • Solutions by industry
      Ecommerce

      Secure, compliant infrastructure for regulated online sales

      Financial Services

      High-trust hosting built for security and compliance

      Agencies

      Fast, flexible hosting for high-traffic client projects

      Healthcare

      HIPAA-ready environments for protected health data

      Solutions by outcomes
      Compliance

      Hosting aligned with HIPAA, PCI, GDPR, and audit readiness

      Launch

      Configure a high-performance server in minutes

      Commerce Scale

      Infrastructure built to handle surges, orders, and growth

      Disaster Recovery

      Redundant, resilient systems for rapid recovery and uptime

  • VPS Hosting
    • VPS Packages
      Cloud VPS Hosting
      Windows VPS Hosting
      Linux VPS Hosting
      Add-ons & Backups
      View All VPS Hosting
  • Dedicated Servers
    • Bare Metal Packages
      Bare Metal Servers
      Cloud Metal Packages
      Managed Dedicated
      Gaming Servers
      View All Dedicated Servers

  • Managed Hosting
    • Managed Hosting
      Managed Servers
      Managed Applications
  • WordPress
    • Hosting for WordPress
      Managed Hosting for WordPress
      VPS for WordPress
      Dedicated WordPress
      WooCommerce Hosting
  • GPU Hosting
    • GPU Hosting
      NVIDIA GPU Hosting
      AI Training & Interface

  • Products
    • Compute
      Cloud Servers

      Scalable, high-speed compute

      Dedicated Servers

      Reliability, power, and control

      Private Cloud

      Isolated, enterprise-grade cloud

      GPU

      Accelerated for AI & ML

      Containers

      Portable workloads for any app

      Platform services
      Cloud Storage

      Storage for growing data needs

      Backups & DR

      Protection for critical workloads

      Global Private Fabric

      Unify networks across servers

      Security & Protection

      Advanced defense for data

      Load Balancing

      Optimized traffic distribution

      Applications
      WordPress

      Optimized for fast, secure sites

      WooCommerce

      Performance for scalable stores

      Magento

      Commerce-ready, built to scale

Log in
  • System status
  • Support | Get Help