D
Cloud Computing

How to Troubleshoot a Website That Goes Down After a Server Restart

A website that stops working after a server restart can cause unexpected downtime, lost visitors, and business disruptions. This issue often occurs when…

manjeet 3 min read 0 views
How to Troubleshoot a Website That Goes Down After a Server Restart

A website that stops working after a server restart can cause unexpected downtime, lost visitors, and business disruptions. This issue often occurs when application processes do not start automatically, server configurations fail to load, or required services are unavailable.

Whether your website runs on a Linux VPS, AWS EC2, or a Windows server, identifying the root cause is essential to restoring service and preventing the same problem from happening again.

1. Check Whether the Server Is Running

First, confirm that the server is accessible and responding to network requests.

For a Linux server, connect through SSH and run:

uptime

Check whether the server is reachable and whether its CPU, memory, or disk usage is unusually high.

If you cannot connect, verify the cloud instance status, network settings, firewall rules, and SSH access before troubleshooting the application.

2. Check Whether the Application Is Running

A server restart may stop application processes that were not configured to start automatically.

For Node.js applications managed by PM2, run:

pm2 status
pm2 logs

If the application is missing or stopped, inspect the logs and restart it if appropriate:

pm2 restart my-app

Replace my-app with your actual PM2 process name. If the process list is empty, check the correct user account and PM2 configuration before starting a new process.

3. Verify Automatic Startup Configuration

If restarting the application manually fixes the website, automatic process recovery may not be configured correctly.

For PM2, use:

pm2 startup
pm2 save

Run the additional command displayed by pm2 startup before saving the process list. This helps PM2 restore saved processes after a reboot.

Also verify that Nginx, databases, and other required services are enabled to start automatically.

4. Check Nginx and Server Logs

If the application is running but the website remains unavailable, check the web server.

For Nginx, run:

sudo systemctl status nginx
sudo nginx -t
sudo journalctl -u nginx -n 50

These commands help identify service failures, configuration errors, and startup problems.

Also review application logs and database logs. Common causes include incorrect permissions, unavailable environment variables, failed database connections, and port conflicts.

5. Check Ports, DNS, and Firewall Rules

A website may remain inaccessible even when the application is running.

Verify that the required ports are listening:

sudo ss -tulpn

For a typical website, ensure that HTTP port 80 and HTTPS port 443 are allowed where required. Check cloud firewall or security group rules, DNS records, SSL certificate validity, and Nginx reverse-proxy settings.

6. Prevent the Problem From Happening Again

To reduce downtime after future restarts:

  • Configure PM2 or systemd to start applications automatically.

  • Enable essential services at boot.

  • Monitor application health and server logs.

  • Test automatic recovery after a planned restart.

  • Maintain backups and a documented recovery procedure.

  • Configure alerts for website downtime and failed services.

Conclusion

When a website goes down after a server restart, check server availability, application processes, automatic startup settings, web server logs, and network configuration. These steps help identify the cause and restore the website more efficiently.

Need help troubleshooting server downtime? Dotcube Technologies helps businesses diagnose deployment issues, configure automatic application recovery, and maintain reliable production servers.

Keep reading