How to Solve Magento 2 Service Temporarily Unavailable Error 503

Magento 2 is a huge platform. That's why when any error occurs, it takes a lot of time and money to solve. Error 503 means the server is temporarily unavailable. Generally, this error display means the site is under maintenance mode or is not available for access. When you are a beginner is it tough how to solve Magento 2 Service temporarily unavailable Error 503.

Top Reasons for 503 Temporarily Unavailable Error

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

This message shows the service is currently unavailable to complete your access request. Firstly, this error occurs when you try to access the admin or store frontend.

error 503 is the most common error of Magento 2 errors. Secondly, it happens when you install Magento 2 extensions on your store.

The third reason is when you try to set up Magento 2 on your store or update the Magento version.

In detail, during your Magento 2 installation process, it generates a file .maintanance.flag to display that sire is under maintenance and the server is not available right now. Further, this is useful to avoid displaying other issues that happen while the installation. Mostly, this file will be automatically get removed from the system after the installation process is complete. However, in some cases, it may not get removed automatically or it may get created again. That's Magento 2 Service temporarily unavailable Error 503 appears.

How to solve Magento 2 Service temporarily unavailable Error 503.

When the .maintanance.flag file exists in your system, this error will surely occur. To resolve this we have listed two solutions that will help you to resolve this error.

Solution 1: Disabling the maintenance mode

  • Go to the Magento root folder to delete the file var/.maintenance.flag
  • Then, refresh Magento 2 cache from php bin/magento cache:flush or via the Admin Panel.
  • Now, check your error log to see a message that tells "Exception printing is disabled by default for security reasons."
  • If you get an error like "Please Upgrade your database", then run php bin/Magento setup: upgrade from the root directory.

Solution 2: Remove the .maintenance.flag file manually

  • Firstly, connect with your server using SSH.
  • Then, go to Magento2_root/var/, search for the .maintenance.flag.
  • Now, remove/delete the file.
  • Flush all the cache using the below command.
php bin/magento cache:flush
  • Now, refresh the website.

That's it.

NOTE: Additionally, this maintenance file is different for Magento 1 and Magento 2.

In Magento 1, remove the maintenance.flag file from  Magento root folder. While in Magento 2 remove the .maintenance.flag file from [Magento root folder]/var.

Final Words

You can use any of the solutions to solve Magento 2 Service temporarily unavailable Error 503. Get rid of this error 503 "Service temporarily unavailable" by this simple solution. If need any help in between, feel free to contact us or leave a message in the comment section.