Fix the 504 Gateway Timeout error
Definitions
A 504 Gateway Timeout error occurs when your web browser can’t load a website due to a timeout issue, which can result from various factors. Here is a visual example of the 504 Gateway Timeout error:

Before you start
🚨 Typically, the 504 Gateway Timeout error can result from a CDN (Cloudflare, etc.) issue, a temporary spike in hosting resource usage, or simply a weak internet connection.
ℹ️ Follow each step by step fix below in order, moving to the next only if the previous one doesn’t work.
Step by step
Check your CDN settings
The 504 Gateway Timeout error can be caused by incorrect DNS settings. If you use a CDN (Content Delivery Network) like Cloudflare, check that your DNS settings are correct.
1. Log in to your CDN user portal and review your domain’s DNS settings
2. Make sure your domain is correctly pointed to your hosting account IP address
Check your CDN network
If you use a CDN like Cloudflare, this error may be due to a network issue on their end.
1. Go to your CDN provider’s network status page. This is often found in the footer section of their official website. For example, the Cloudflare CDN status page is: https://cloudflarestatus.com
2. On the status page, look for any indicators or updates that show the current performance and health of the CDN service. This may include live status reports, incident logs, or maintenance schedules.
3. Specifically, look for any reported outages or issues in the regions where your audience is located as this could be triggering the gateway error
Check your hosting account resource usage
In some instances, a 504 Gateway Timeout is caused by high resource usage on your hosting account.
1. Log in to your hosting control panel
2. Click on the Resource Usage button

3. Click on the Current Usage tab

4. Look for the CPU Usage, Physical Memory Usage and Faults graphs. If usage exceeds the red limit line on any graph, your hosting account is exhausting the allocated server resources on your hosting plan, causing the 504 error on your website(s).

5. To view the specific processes on your hosting account that are triggering high resource usage, click on Snapshot from the top menu and then Process List and HTTP Queries to view details

6. Allow some time to pass for your resource usage to stabilize and for heavy processes to complete. Once resource usage has stabilized, reload your website(s) and you will see things loading fine.
7. Review both the CPU usage and memory usage guides to better understand your resource usage and learn how to optimize it
Increase your PHP memory threshold
Sometimes a 504 Gateway Timeout error is caused by a PHP memory threshold limit.
1. Log in to your hosting control panel
2. Click on the Select PHP version button

3. Look for the memory_limit dropdown

4. On the dropdown, select the highest threshold value available

5. Wait a few moments and then load your website
Check your website on a mobile data connection
Sometimes a 504 Gateway Timeout error is caused by your WiFi network. To verify, check your website via a mobile data connection instead.
1. On your mobile device, open the Settings app
2. Find the Wi-Fi 📶 section and click on it
3. Toggle the WiFi switch to the ‘Off’ position to disable the WiFi connection
4. In the Settings app, find and select Connections or Cellular/Mobile Data (the exact name may vary depending on your device)
5. Toggle the Mobile Data switch to the On position to activate the mobile data connection
6. Check the top of your device screen for a mobile data indicator (such as 4G, LTE, or 5G, etc.) to confirm that mobile data is active
7. Open a new web browser window on your mobile device
8. Load your website
Refresh your web browser page
The 504 Gateway Timeout error could be caused by a bad session, so simply refresh your page.
- Look for the circular arrow icon near the address bar and click it
Or, if you’re comfortable with keyboard shortcuts:
- Press F5 or Ctrl + R on Windows, or Cmd + R on a Mac to refresh using keyboard shortcuts
Load your website from an incognito or private window
The 504 Gateway Timeout error could be caused by a bad cache. Try loading your website from an incognito window.
Disable firewall and/or anti-virus software
At times, the 504 Gateway Timeout error is triggered by a firewall or anti-virus software running on your device. Try disabling it, to see if that’s the cause.
1. Open Control Panel on Windows or System Preferences on macOS. For antivirus, open the application.
2. Select Firewall & network protection on Windows or the Firewall tab on macOS. In antivirus, go to settings.
3. Turn off Windows Defender Firewall or Firewall on macOS. Choose to disable or turn off in the antivirus program.
4. Open a new web browser window on your device
5. Load your website
Disable your VPN connection
Sometimes, the 504 Gateway Timeout error is triggered by a VPN running on your device. Try disabling it, to see if that’s the cause.
1. Look for the VPN icon on your device applications or menu bar
2. Click the icon to open your VPN application
3. Press the disconnect button within the app to disable your VPN connection
4. Open a new web browser window on your device
5. Load your website