A Status Code 504 (Gateway Timeout) error in Minecraft means your game or server is waiting too long for a response from an external server - usually Mojang's authentication servers, a proxy, or a Realms service. It does not mean something is wrong with your game files.
This guide covers the most common causes and how to resolve each one.
Method 1: Check Mojang's Server Status
The 504 error is often caused by Mojang's servers being slow or temporarily unavailable.
- Open your browser and visit the Downdetector for Minecraft website.
- Look for any reported outages or degraded services.
- If an outage is confirmed, wait 15-30 minutes and try again.
Method 2: Restart Your Network Connection
A dropped or unstable connection can trigger a timeout before Mojang's servers respond.
- Close Minecraft completely.
- Unplug your router and modem, wait 30 seconds, then plug them back in.
- Wait for your connection to fully restore, then relaunch Minecraft and try again.
Method 3: Disable Your VPN or Proxy
VPNs and proxies can reroute traffic in a way that causes authentication requests to time out.
- Open your VPN or proxy application.
- Disconnect or disable it entirely.
- Relaunch Minecraft and attempt to log in or connect again.
Method 4: Check Your Firewall and Antivirus
Security software can block outbound connections Minecraft needs for authentication.
- Open your firewall or antivirus application.
- Add Minecraft (and your launcher, if using a third-party one) to the list of allowed applications.
- Confirm that port 443 (HTTPS) is not being blocked for Minecraft's traffic.
- Relaunch Minecraft and test again.
Method 5: Update Minecraft
Outdated game versions can cause authentication failures, including 504 errors.
- Open your Minecraft launcher.
- Check for any available updates and install them.
- Relaunch the updated version and attempt to connect.
Method 6: Clear the Game Cache (Mobile Only)
On mobile devices, a corrupted cache can interfere with authentication requests.
- Open your device's Settings and go to Apps (or Application Manager).
- Find Minecraft in the list and tap it.
- Tap Storage, then tap Clear Cache.
- Relaunch Minecraft and sign in again.
Method 7: Reduce World File Count (Realms Upload Only)
If you are seeing a 504 error when uploading a world to Realms, the issue is likely too many individual files in your world folder - not the total file size.
- Locate your world save folder on your computer.
- Open the
datasubfolder inside your world directory. - Delete excess
map_*.datfiles. These accumulate over time and are safe to remove if the maps are no longer needed. - Check the
statsfolder as well, and remove files for players who no longer join your world. - Try the Realms upload again.
map_*.dat files are a common cause of the Realms 504 upload error. Reducing the count to under 2,000 files typically resolves it.