VPS security · Practical guide

Use a few simple checks to troubleshoot your VPS

Check disk space, memory, failed services and recent logs before changing an unavailable server.

Archive placement: April 2025

Lines of code on a laptop display

When a VPS is slow or a website stops responding, collect a few useful facts before restarting services. Work from the public symptom back to the application, system resources and recent logs. That gives you a much better chance of fixing the cause instead of briefly hiding it.

1. Describe the problem precisely

Record the affected URL or service, when it last worked and the time zone of your test. Note whether everyone is affected, whether SSH still works and whether a recent deployment or update coincided with the failure. Try a second network so a local Wi-Fi or DNS problem does not look like a server outage.

On your computer: inspect the website response
curl -I https://example.com/

A 200 response means that request succeeded, not that the whole application works. A 301/302 is a redirect. A 500 is an application/server error; 502 or 504 often involves a proxy waiting for an upstream service. A timeout is different from an HTTP error because no completed response arrived. Keep the exact output for comparison.

2. Check the obvious limits

Disk or memory pressure can affect several services at once. These commands give a quick overview without changing anything. Look at the filesystem holding the application or database, not just the first line of output.

On the VPS: check storage and memory
df -h
free -h

A nearly full filesystem needs attention. Linux uses otherwise free memory for cache, so low free memory alone does not prove a shortage. Look at available memory and symptoms together. Keep application and backup growth in your notes.

3. Find the affected service

Ask systemd which services have failed, then inspect the service you care about. This example assumes NGINX. An inactive service is a clue, but a running service can still return application errors.

On the VPS: check service state
systemctl --failed
systemctl status nginx

Read the messages shown with the state. If the failure followed an edit, validate that configuration before another restart. Repeated restarts cannot fix a syntax error or missing dependency. Check the application separately once its server process is running.

4. Check memory, load and storage together

On the VPS: take a small resource snapshot
uptime
free -h
df -h
df -i

Use the “available” memory figure rather than assuming Linux’s filesystem cache is wasted RAM. Load averages need context: a high value on a small VPS can mean CPU pressure or tasks waiting on storage. Full disk space or exhausted inodes can stop logging, sessions and database writes. Use top to identify busy processes, but do not kill an unfamiliar database process simply because it is near the top.

If the kernel reports an out-of-memory kill, identify the affected application and the traffic or job running at that time. A larger plan may help sustained legitimate demand, but it will not correct a runaway scheduled task, a plugin loop or uncontrolled log growth.

5. Read a short log window

Start with recent messages. If you know when the problem happened, use the time option below. Run one command at a time and look for the first useful error, not just the last repeated warning.

On the VPS: inspect NGINX messages
sudo journalctl -u nginx -n 30 --no-pager
sudo journalctl -u nginx --since "30 minutes ago" --no-pager

Application logs may live elsewhere, and web access logs are often separate from the journal. Match timestamps across them. Remove passwords, tokens and personal information before sharing an extract in a ticket.

6. Read a short, relevant log window

Use the real service name. On a typical Ubuntu server that might be nginx.service, apache2.service or a specific PHP-FPM unit. The examples below use nginx; replace it rather than installing NGINX merely to run the command.

On the VPS: inspect one service and a recent time window
sudo systemctl status nginx.service --no-pager
sudo journalctl -u nginx.service --since "30 minutes ago" --no-pager
sudo journalctl -k --since "30 minutes ago" --no-pager

Look for the first meaningful error around the incident, not only repeated consequences afterward. “Address already in use” suggests a port conflict; “permission denied” identifies an access issue; a killed process or I/O error needs a different response. For a configuration change, validate it with nginx -t or apache2ctl configtest before reloading the corresponding service.

7. Check from outside the server

Load the application from a separate connection or use an external monitor. Working from inside the VPS does not prove that DNS, TLS and the firewall are correct for visitors. Check those layers if the application itself looks healthy.

Keep a brief incident note: when it started, what you saw, what you changed and what proved recovery. Add an alert for a useful failure, such as low disk space or an unavailable public URL, rather than collecting metrics nobody reviews.

8. Fix one cause, then prove recovery and add monitoring

Make the smallest correction supported by the evidence. If a recent deployment caused the error, roll back that application change using its saved version and database plan. If storage is full, identify expendable data rather than deleting active database files. Repeat the original failed request after the correction and check the logs for new errors.

Set external monitoring against the hostname customers use, not only the server IP. Include certificate-expiry checks and alerts sent somewhere outside the monitored VPS. For a shop or booking site, a basic HTTP check should be supplemented by a safe application check. Record the cause and fix so the next incident does not start from scratch.

Common questions

Should I reboot when the site is slow?

A reboot may temporarily clear pressure while also losing useful evidence. Capture resource and log information first unless immediate recovery takes priority, then investigate why the condition occurred.

What should I include in a support request?

Provide the service ID, affected hostname, exact error, incident time and relevant short log excerpt. Remove passwords, session tokens, private keys and customer data before sharing logs.

Further reading

← Back to all guidesDiscuss your hosting setup ↗