Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to fix a 503 error on a Linux server

This guide helps you find out why your website shows "503 Service Unavailable", and how to fix it. Some steps need root access, so it is for VPS and dedicated server customers.

How-To Guides2 min read9 steps

What is a 503 error?

Every time you open a web page, the server sends back a number code. 200 means all is well. 503 means "Service Unavailable". The server is there, but it cannot answer right now.

It is like a shop with the lights on but a "back soon" sign on the door.

Common causes:

  • The web server (Apache or Nginx) has stopped.
  • The server is too busy, or out of memory.
  • PHP, the program that runs many websites, has crashed.
  • The site is in maintenance mode.
  • A firewall or security tool is blocking the visitor.

Steps to find and fix it

  1. Connect to your server with SSH, a safe way to type commands on a remote server.
  2. Check that the web server is running. For Apache on CentOS or AlmaLinux:
systemctl status httpd

On Ubuntu, use apache2. For Nginx, use nginx. You should see "active (running)".

  1. If it is stopped, start it:
systemctl start httpd
  1. Read the error log, which is a record of problems. For Apache it is often here:
tail -n 50 /var/log/httpd/error_log

On Ubuntu the file is /var/log/apache2/error.log. For Nginx it is /var/log/nginx/error.log. This shows the last 50 lines.

  1. Check memory and load:
free -m
uptime

free -m shows memory use. uptime shows how busy the server is. If memory is full, a program may be using too much.

  1. Check PHP. If you use PHP-FPM, check it is running:
systemctl status php-fpm

The service name can be different, such as php8.1-fpm. Restart it if it has stopped.

  1. Check the disk is not full:
df -h

If any line shows 100%, free up space by deleting old logs and backups.

  1. Restart the web server after fixes:
systemctl restart httpd
  1. Reload your website and check.
Warning: Do not delete files unless you know what they are. Back up first.

Other things to check

  • A WordPress plugin or theme that is failing. Rename its folder in wp-content/plugins to switch it off.
  • A maintenance mode file such as .maintenance that was left behind after an update.
  • A firewall tool blocking your IP.

If you are still stuck, open a ticket at the support ticket page and include the log lines.

Quick recap

  • 503 means the server is up but cannot serve the page.
  • Check that Apache or Nginx and PHP are running.
  • Read the error log.
  • Check memory, load and disk space.
  • Restart services, then test again.