Configuring Failover with 3CX

Introduction

The Failover feature in 3CX allows you to create a standby replica of your PBX. In the event that your PBX fails, your replica PBX becomes active minimizing downtime and data loss. An Enterprise/AI (ENT/AI) license key is required.

How it works

3CX uses an active - passive approach using built-in configuration replication with a maximum offset of 24h. The active host processes calls and presence information, while the passive host monitors the active host. In case of a failure of the active host (independent of application, OS or hardware failure), the passive host stops its monitoring role and takes over as the active host. The passive host’s configuration determines in which state the active host is declared failed in order to initiate the failover switch.

3CX Failover example

Pre-requisites

Before configuring or enabling 3CX failover on your 2 servers, the 3CX installations need to meet these requirements.

  • Two (2) 3CX PBXs, each with its own public IP, both installed with identical settings, including FQDN, SSL Certificate, SIP, Tunnel, web server ports and operating system.
  • When configuring 3CX after the installation, you need to select 3CX FQDN. You may use a custom FQDN but configuration is more complex and you must edit the sample scripts yourself and support these yourself.
  • When provisioning phones in a Local Lan/VPN environment, the Select Interface field must be set to the FQDN and NOT the IP Address.
  • Split DNS is required as for all 3CX deployments.

Step 1: Configuring the Active Server

  • Go to "Backup → Location" and select Google Storage as the location type, or specify other backup options, e.g. SMB or SFTP. For this example, backups are stored in the “3CX_PBX_Backups” folder in a Google Storage bucket.
  • Click on Schedule Backup, select backup options to include, set the backup schedule and click OK to save your configuration. A daily off-hours backup is recommended, e.g. start backup at 1:00 AM and upload “3CXScheduledBackup.zip” (latest backup filename) to Google storage.
  • Now, click the “Failover” button, set the Enable Failover checkbox and select “Active”. Press OK to save.

Step 2: Configuring the Passive Server (#2)

  1. Switch to your passive server and click Backup > “Failover” button, set the Enable Failover checkbox and select “Passive”.
  2. Enter the IP address of the active server (#1), e.g.
    1.1.1.1
    Select when to make a failover and which services you want to monitor: SIP Server, Web Server or Tunnel Server.Select the interval for the heartbeat checks to be made, (default 30 seconds) and configure whether failover occurs if one or all tests fail.Specify the location of your failover scripts. You can find the Windows scripts here. The Linux scripts can be found here.Set a time for the restore to be applied.Press “OK” to save the configuration and start monitoring. When the active server (#1)
     fails, the passive detects this and takes over. With the backup already restored, the failover action triggers the 3CX DNS Servers to update the FQDN to the IP address of the new active server (#2). It is important that the previously active server (#1) is shutdown to avoid conflict with the server that just took over.

Important Notes

  • Gateways in a failover scenario are only supported when local to your PBX system, i.e. reachable via LAN.
  • For scenarios where the Active/Primary and Passive/Failover servers are behind different public IP addresses, when you first complete the installation of the Passive server and you run through the installation options, your public FQDN will be rewritten to the public IP of the Failover server. To re-write your external FQDN to resolve back to the public IP of the Active server, you need to restart the System service.
  • If you are configuring your failover on Microsoft Windows, then the appropriate rights must be assigned to this service running the scripts, being 3CX Event Notification Manager. The minimum account level which the service can be assigned to, must have local administrative rights like the “Local System” user and, if running
    dnscmd
    also DNS management administrator privileges. For this purpose, it is recommended to create a dedicated Active Directory user with suitable administrative rights and the password set not to expire.
  • For Failover use with custom FQDN and LAN-to-LAN or Cloud-to-Cloud scenarios, to update your DNS and FQDNs when failover occurs, you need to use advanced scripting and services like Active Directory to run shell scripts with administrative privileges.

See also

Last Updated

This document was last updated on 11 November 2025

https://www.3cx.com/docs/failover/