Title: Wordfence 2FA multiple server setup
Last modified: August 16, 2024

---

# Wordfence 2FA multiple server setup

 *  Resolved [George-Paul Crețu](https://wordpress.org/support/users/necroob/)
 * (@necroob)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/wordfence-2fa-multiple-server-setup/)
 * Hi there,
 * I have a question about the 2FA from Wordfence. 
   Our stack looks like this:
    - Cloudfront -> Loadbalancer -> 3 different servers -> connected to a database
      server
 * Those 3 server run identical WordPress installs and all connected to a database
   server (same database).
 * My understanding is that the 2FA is going to keep a file on the server that is
   used to match the code from the client trying to log.
 * Given that a user goes through the load balancer, it never knows on what server
   is going to land, is the 2FA still going to work?
 * Because when I’m going to enable 2FA is going to happen from one of those servers,
   if there is something stored locally is going to be only on that server. If it’s
   at the database level, than it’s fine because they all use/share it.
 * Let me know if the 2FA will work given this setup.
   **Update:**I’ve already applied
   this part: [https://www.wordfence.com/help/firewall/mysqli-storage-engine/](https://www.wordfence.com/help/firewall/mysqli-storage-engine/)
 * Thanks!
    -  This topic was modified 1 year, 9 months ago by [George-Paul Crețu](https://wordpress.org/support/users/necroob/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [wfmargaret](https://wordpress.org/support/users/wfmargaret/)
 * (@wfmargaret)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/wordfence-2fa-multiple-server-setup/#post-17958416)
 * Hi [@necroob](https://wordpress.org/support/users/necroob/),
 * Thanks for reaching out. Since you’re on a load-balanced server using one database,
   I still recommend using MySQLi storage engine as this will ensure all configuration
   is saved in the database for the firewall, but it isn’t required for 2FA specifically.
 * The login security data, including 2FA, is saved in the database. The 2FA data
   in particular is saved in the `wfls_2fa_secrets` table. As long as all servers
   on the load-balanced setup are using the same database, 2FA should work without
   issue.
 * Please let me know if you have any other questions!
 * Thanks,
   Margaret
 *  Thread Starter [George-Paul Crețu](https://wordpress.org/support/users/necroob/)
 * (@necroob)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/wordfence-2fa-multiple-server-setup/#post-17964455)
 * Hi [@wfmargaret](https://wordpress.org/support/users/wfmargaret/) ,
 * Thanks for getting back to me with these details. 
   Yes, I can confirm that the
   2FA works correctly.
 * Thanks,
   George

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Wordfence 2FA multiple server setup’ is closed to new replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

## Tags

 * [2fa](https://wordpress.org/support/topic-tag/2fa/)
 * [load balancer](https://wordpress.org/support/topic-tag/load-balancer/)
 * [login](https://wordpress.org/support/topic-tag/login/)

 * 2 replies
 * 2 participants
 * Last reply from: [George-Paul Crețu](https://wordpress.org/support/users/necroob/)
 * Last activity: [1 year, 9 months ago](https://wordpress.org/support/topic/wordfence-2fa-multiple-server-setup/#post-17964455)
 * Status: resolved