Home / Knowledge Base / VPS & Dedicated Servers / Essential Linux Commands Every VPS Owner Should Know
  1. Home
  2. »
  3. Knowledge Base
  4. »
  5. WordPress Hosting
  6. »
  7. Making WordPress Updates Safe When…

Essential Linux Commands Every VPS Owner Should Know

Table of Contents

Essential Linux Commands Every VPS Owner Should Know

Why learning a few Linux commands matters for your VPS

What a VPS actually is in plain language

A Virtual Private Server (VPS) is a slice of a larger physical server that behaves like your own independent machine. It has its own operating system, resources such as CPU, RAM and disk, and its own configuration.

If you run a website, application, or WordPress store on a VPS, you are effectively responsible for a small Linux server in the cloud. Even if your provider gives you a control panel, the underlying system is still Linux. Knowing a small set of commands helps you:

  • See what is happening when something goes wrong
  • Make small fixes without waiting on support
  • Understand what a developer or support engineer is asking you to do

Why you cannot rely on cPanel style tools alone

Web hosting control panels such as cPanel, Plesk or DirectAdmin are very helpful. They provide a graphical way to create sites, databases, email accounts and more. However, they do not cover everything:

  • Some problems appear only in logs or system status, which you read in the terminal
  • Performance diagnostics often use tools such as top, free and df
  • Security hardening or troubleshooting often requires editing configuration files directly

Panels are excellent for day to day tasks, but when something unusual happens, you will almost always see a command line suggested in documentation or by support. This article aims to make those commands understandable rather than mysterious.

How many commands you really need to be useful (and safe)

You do not need to become a full time system administrator to look after a VPS. A practical starter set is roughly:

  • Navigation and help: ssh, pwd, cd, ls, man
  • Files: cp, mv, rm, mkdir, tar
  • Viewing and editing: cat, less, tail, nano
  • Users and permissions: whoami, id, chmod, chown
  • Processes and resources: ps, top, systemctl, df, free
  • Networking: ping, curl, ss or netstat
  • File transfer and backup: scp, rsync

Used carefully, these are enough to manage a typical small VPS, including WordPress and WooCommerce sites, and to have informed conversations with support or developers.

When a managed virtual dedicated server is the better option

Running your own unmanaged VPS or virtual dedicated servers means taking care of:

  • Security updates for the operating system, web server, PHP and database
  • Backups, monitoring and basic incident response
  • Performance tuning as traffic grows

If you run one or two business sites and do not want to think about this regularly, a managed virtual dedicated server can be a calmer option. You still benefit from learning basic commands, but you can hand over ongoing patching, tuning and more complex troubleshooting to specialists.

Throughout this article, whenever a task is more complex or higher risk, that is a hint that managed hosting might be more suitable if you prefer not to experiment on production systems yourself.


Getting started safely: SSH basics and working as the right user

Connecting to your VPS with SSH

ssh user@example.com

To do anything on your VPS, you first connect with SSH, which provides an encrypted terminal session.

A typical command looks like this:

ssh user@example.com

This tells your computer to open a secure shell to example.com as the user user. You can also connect directly to an IP, such as ssh user@203.0.113.10.

On first connection you will be asked to confirm the host fingerprint (more on that below), then you will be prompted for the user’s password or for your SSH key passphrase.

If SSH is not working, double check:

  • You have the right username
  • The correct IP or hostname
  • SSH is allowed through your firewall

What host keys and fingerprint prompts mean

When you first connect, you will usually see something like:

The authenticity of host 'example.com (203.0.113.10)' can't be established.
ECDSA key fingerprint is SHA256:...
Are you sure you want to continue connecting (yes/no/[fingerprint])?

This is your SSH client checking that you are connecting to the correct server. It stores the server’s key in a local file, normally ~/.ssh/known_hosts. On later connections, if the key changes unexpectedly, you will see a warning.

In everyday use, you typically type yes the first time. If you are working on high value systems or under strict security policies, you would compare the fingerprint to one provided by your hosting support before accepting.

Understanding root vs normal users

Why using root directly is risky

The root user is the superuser. It can do anything, including deleting the whole filesystem or misconfiguring the network so you cannot connect. It is powerful and convenient, but also unforgiving of mistakes.

Safer practice is:

  • Log in as a normal user
  • Use sudo only when you actually need higher permissions
  • Keep a record of what you run with sudo

Using sudo safely

sudo temporarily runs a command with elevated privileges. For example, instead of logging in as root to install security updates, you can run:

sudo apt update && sudo apt upgrade

This tells the system to:

  • Run apt update as root to refresh package information
  • If that succeeds, run apt upgrade to install updates

You will usually be asked for your own password, not the root password. Use sudo specifically for administrative tasks such as installing software or editing system configuration, not for every command.

If you accidentally run something with sudo that you did not intend, there is no general undo. This is why double checking is important, especially for commands like rm or chown -R that modify many files.

Safety first: a few habits that prevent big mistakes

Double checking the command line before pressing Enter

Before pressing Enter, take a brief moment to read the command back to yourself. Ask:

  • Is this the right path?
  • Am I in the right directory?
  • Does this command remove or overwrite anything?

That small pause prevents many accidental deletions and misconfigurations.

Never running “random” commands from the web as root

When searching for solutions, you will see one line commands that claim to fix everything. Avoid copying and pasting them directly, especially with sudo or as root.

Instead:

  • Read the command and make sure you understand what it is doing in broad terms
  • Prefer instructions from reputable documentation or your hosting provider
  • Test on a non production VPS if the change is significant

The difference between destructive and non‑destructive commands

Non‑destructive commands display information without changing anything. Examples include:

  • ls, pwd, df -h, free -h
  • ps, top, systemctl status
  • cat, less, tail -f

Destructive commands change or remove things. Used incorrectly, they can break a site or whole server:

  • rm, especially rm -r or rm -rf
  • mv and cp when overwriting
  • chmod and chown with recursive flags
  • systemctl restart on critical services

Whenever you use a destructive command, consider backing up relevant files first and checking that you have a recent snapshot of the VPS.


Navigation and help: finding your way around the server

pwd, cd, ls: moving around the filesystem

pwd: show where you are

pwd prints the current working directory. If you are not sure where you are, run:

pwd

Typical output might be:

/home/user

This is non‑destructive and safe to use as often as you like.

cd /path/to/site: moving to your web root

cd changes directory. To move into your web root directory, you might run:

cd /var/www/example.com

If the directory exists, you will now be inside it. You can confirm with pwd. If it does not exist, you will see an error such as No such file or directory.

cd itself does not create or delete anything. It only changes your viewpoint within the filesystem.

ls and ls -l: listing files with details

ls lists files and directories in the current directory:

ls

For more detailed information, including permissions and timestamps, use:

ls -l

Or for human friendly sizes:

ls -lah

This will show something like:

-rw-r--r-- 1 user user  28K Jan 12 10:15 index.php
drwxr-xr-x 5 user user 4.0K Jan 10 09:00 wp-content

Again, this is non‑destructive and safe.

Common WordPress paths on typical stacks

On many VPS setups, WordPress files live in one of these locations:

  • /var/www/html
  • /var/www/example.com/public_html
  • /home/user/public_html (often with cPanel)

Once inside the web root, you should see familiar WordPress files and directories such as wp-config.php, wp-content, wp-admin and wp-includes.

Getting help without leaving the terminal

Using man and –help

Most commands have built in help. Two very useful approaches are:

man ls

This opens the manual page for ls. You can scroll with the arrow keys and press q to quit.

ls --help

This prints a summary of options directly in the terminal. It is often quicker to skim than a full man page.

These commands are informational only and safe to use at any time.

Understanding examples in documentation

When reading examples online, pay attention to:

  • Placeholders like /path/to/site or example.com that you must change
  • Flags such as -r, -f, -R that often mean “recursive” or “force”
  • Whether the command is run as a normal user or with sudo

If you are unsure, try the command with a harmless path such as a test directory in your home folder rather than your live website.

Tab completion and history to reduce mistakes

Using Tab to complete filenames and paths

Most shells let you press Tab to autocomplete paths and filenames. For example, if you type:

cd /var/www/exa

Then press Tab, it may autocomplete to:

cd /var/www/example.com

This reduces typing errors and helps avoid operating on the wrong directory.

Using the Up arrow to repeat and edit commands

Pressing the Up arrow in the terminal shows your previous commands. This is convenient for rerunning similar commands such as:

cd /var/www/example.com
ls -lah

You can press Up to recall ls -lah, then edit it, for example adding a path. Be careful not to blindly rerun destructive commands from history. Read them before pressing Enter.


File and directory management: ls, cp, mv, rm, mkdir, tar

Listing and inspecting files with ls and file

ls -lah for human readable output

When exploring a directory, ls -lah is a good default:

ls -lah /var/www/example.com

This shows permissions, owner, size in human readable units, and modification time. Use this to check whether your web files are present, how large they are, and who owns them.

file filename to identify file types

The file command inspects a file and tells you what type it is:

file wp-config.php

Output might be:

wp-config.php: PHP script, ASCII text

This is helpful if you are unsure whether something is plain text, a binary, or an image. It is read only and safe.

Creating directories and copying files safely

mkdir and mkdir -p

To create a directory, use mkdir:

mkdir backups

This creates a backups folder in the current directory. If you need to create a nested path in one go, use -p:

mkdir -p /var/www/example.com/backups/2025-01-01

mkdir changes the filesystem by adding a directory but does not remove or overwrite anything.

cp and cp -r for backups of WordPress files

cp copies files. To make a quick backup of a configuration file before editing, you might run:

cp wp-config.php wp-config.php.bak

This creates wp-config.php.bak as a copy. To copy directories, add -r (recursive):

cp -r wp-content wp-content-backup

This duplicates the entire wp-content directory. Be careful when copying to an existing path, as cp can overwrite files without warning. If you want prompts before overwriting, you can use cp -i.

mv to rename or move without data loss

mv moves or renames files and directories. For example, to temporarily disable a plugin directory after a faulty update:

mv wp-content/plugins/example-plugin wp-content/plugins/example-plugin.disabled

This does not delete the plugin; it just renames the folder so WordPress no longer loads it. You can restore it by renaming back:

mv wp-content/plugins/example-plugin.disabled wp-content/plugins/example-plugin

As with cp, be cautious about moving files onto existing paths. Use mv -i if you want a prompt before overwriting.

rm: deleting files and why it is dangerous

rm and rm -r: what they do in plain language

rm removes files. For example:

rm error_log

This deletes the error_log file in the current directory. It does not go to a recycle bin; recovery is not straightforward.

To remove directories and their contents, you might see:

rm -r cache/

This recursively deletes cache and everything inside it. Misplaced paths here can remove whole sites inadvertently.

Why you should avoid rm -rf / and similar patterns

rm -rf combines recursive deletion with “force” (no prompts). Used on the wrong path, it can remove critical system files.

Dangerous patterns include:

  • rm -rf / or anything close to the root of the filesystem
  • rm -rf * in the wrong directory
  • Commands copied from the web that use rm -rf without clear explanation

Use ls and pwd first to confirm you are in the correct place. If in doubt, make a backup or snapshot before running large removals.

Safer patterns, like backing up before removing

Instead of deleting straight away, you can move things out of the way:

mkdir -p ~/trash
mv error_log ~/trash/

If everything is fine after a few days, you can delete files from ~/trash later. For big changes, taking a VPS snapshot with your hosting control panel is a good habit.

Working with tar.gz backups of your site

Creating a quick tar.gz of your web root and wp-content

tar bundles files into archives, often compressed with gzip (.tar.gz). To create a compressed backup of your site directory:

cd /var/www
tar -czf example.com-$(date +%F).tar.gz example.com

This creates a file like example.com-2025-01-01.tar.gz containing the whole example.com directory. The command:

  • -c creates a new archive
  • -z compresses with gzip
  • -f specifies the filename to write

Keep an eye on available disk space with df -h if you are making large archives.

Extracting tar.gz when migrating or restoring

To extract a backup:

tar -xzf example.com-2025-01-01.tar.gz

This unpacks into the current directory. If you are restoring over an existing site, consider extracting into a new directory first:

mkdir /var/www/example-restore
tar -xzf example.com-2025-01-01.tar.gz -C /var/www/example-restore

You can then inspect files before replacing the live site. For more step by step detail, see How to Extract or Unzip .tar.gz Files in Linux.

Safety note about extracting over live sites

Extracting directly into your live web root can:

  • Overwrite modified configuration files
  • Temporarily mix old and new files if the archive is incomplete

Safer approaches include:

  • Restoring into a separate directory and swapping symlinks or using mv to switch versions
  • Performing the restore during a planned maintenance window
  • Ensuring you have a fresh backup and, ideally, a VPS snapshot before starting

Viewing and editing files: cat, less, tail, nano

Reading configuration and log files

cat for quick checks, less for longer files

To quickly see the contents of a small file, use:

cat wp-config.php

This prints the whole file to the terminal. For longer files, less is more convenient:

less /var/log/nginx/error.log

With less you can scroll with the arrow keys and search with /text. Press q to quit. Both cat and less are read only.

tail -f for watching logs in real time

To monitor a log as new entries are written, use:

tail -f /var/log/nginx/error.log

This shows the last lines of the file and then follows new lines in real time. Use this while reproducing an error in your browser to see what is happening on the server. Press Ctrl+C to stop.

Useful log files for WordPress and WooCommerce issues

Common log locations include:

  • Web server errors:
    • Nginx: /var/log/nginx/error.log
    • Apache: /var/log/apache2/error.log
  • PHP‑FPM errors:
    • Often under /var/log/php* or in pool specific logs
  • MySQL / MariaDB:
    • /var/log/mysql/error.log or /var/log/mysqld.log

For WooCommerce in particular, PHP errors and slow database queries can show up in these logs and explain slow checkouts or 500 errors.

Editing files safely with nano

Opening a file with nano /path/to/file

nano is a simple terminal text editor with helpful on screen shortcuts. To edit a configuration file:

nano /etc/php/8.2/fpm/php.ini

Or to edit wp-config.php:

cd /var/www/example.com
nano wp-config.php

If you do not have permission, use sudo nano ... but only after making a backup copy.

Basic nano shortcuts: save, exit, search

Common nano shortcuts (shown at the bottom of the screen):

  • Save: Ctrl+O, then Enter
  • Exit: Ctrl+X
  • Search: Ctrl+W, then type text and Enter

If you exit with unsaved changes, nano will ask whether to save. Answer carefully; incorrect edits to system files can stop services from starting.

Best practice: backing up config files before editing

Before editing any important configuration file, make a copy:

cp /etc/php/8.2/fpm/php.ini /etc/php/8.2/fpm/php.ini.bak

If your edit causes problems, you can revert quickly:

sudo mv /etc/php/8.2/fpm/php.ini.bak /etc/php/8.2/fpm/php.ini
sudo systemctl restart php8.2-fpm

Taking this step adds a few seconds but saves a lot of time when troubleshooting.


User and permissions basics: whoami, id, chmod, chown

Checking who you are and what you can do

whoami and id to see your user and groups

To confirm which account you are using:

whoami

You will see something like user or root. To see groups and numeric IDs:

id

Output might look like:

uid=1000(user) gid=1000(user) groups=1000(user),27(sudo)

This tells you whether you can use sudo, and helps when diagnosing permission issues.

For more on managing groups, see How to Add a User to a Linux Group and How to List Users on Linux.

Why www-data / nginx / apache users matter for web files

Web server processes usually run as unprivileged users such as www-data, nginx or apache. For example, Nginx on Debian based systems often runs as www-data.

Your WordPress files need to be readable (and, in certain directories, writable) by this user. If ownership or permissions are wrong, you may see errors such as:

  • “Failed to open stream: Permission denied”
  • Plugins cannot write to wp-content/uploads

File ownership and permissions in simple terms

What rwx means for user, group and others

When you run ls -l, the first column shows permissions, for example:

-rw-r--r-- 1 user www-data  28K Jan 12 10:15 wp-config.php
drwxr-xr-x 5 user www-data 4.0K Jan 10 09:00 wp-content

The letters mean:

  • r read
  • w write
  • x execute (or “can enter” for directories)

They are grouped as:

  • First three: owner
  • Next three: group
  • Last three: others (everyone else)

chown user:group file for WordPress ownership fixes

chown changes file ownership. For example, if your site files should be owned by user:www-data you might run:

sudo chown -R user:www-data /var/www/example.com

This recursively sets the owner to user and the group to www-data. This is powerful and can break things if applied to the wrong path. Always double check with ls -ld before and after:

ls -ld /var/www/example.com

chmod 644 vs 755 on typical web files and folders

chmod sets permissions. For WordPress, typical values are:

  • Files: 644 (owner read/write, group and others read)
  • Directories: 755 (owner read/write/execute, group and others read/execute)

You can apply these recursively, but do so carefully:

find /var/www/example.com -type f -exec chmod 644 {} \;
find /var/www/example.com -type d -exec chmod 755 {} \;

These commands walk the directory tree and set appropriate permissions on files and directories separately. They change the filesystem but are less risky than a blanket chmod -R 777.

Common permission mistakes to avoid

Why chmod -R 777 is a security problem

chmod -R 777 /var/www/example.com gives every user full read, write and execute permissions. It might appear to “fix everything” briefly, but it:

  • Makes it easier for compromised processes or users to alter your files
  • Can be flagged by security audits and scanners

It is better to fix ownership and use 644/755 patterns, adjusting individual directories (such as uploads) only when necessary.

When to call support or use managed hosting for permission issues

If you are faced with complex permission trees, shared hosting migrations, or mixed ownership from multiple deployment methods, it can be quicker and safer to:

  • Ask your hosting support to review and correct permissions, or
  • Use a managed virtual dedicated servers plan where sysadmins maintain secure defaults

Process, service and resource checks: ps, top, systemctl, df, free

Checking what is running with ps and top / htop

ps aux | grep php-fpm or nginx

To see if a specific process is running, use:

ps aux | grep php-fpm

This lists processes and filters for php-fpm. If you see entries apart from the grep line itself, PHP‑FPM is running. Similarly:

ps aux | grep nginx

Use this when debugging “service not available” messages.

top or htop for a live view of CPU and memory

top shows live CPU and memory usage:

top

Watch the CPU percentages, memory usage and which processes are consuming most resources. Press q to exit.

If installed, htop provides a more colourful, interactive view:

htop

Use these tools when your site is slow to see if the server is under heavy load.

Checking system resources: disk and memory

df -h to see disk space usage

df -h reports disk usage in human readable units:

df -h

Look at the percentage used for the filesystem containing / and your web root. If you see 100 percent usage, the server may become unstable and web requests can fail.

free -h to see memory and swap

free -h shows memory and swap usage:

free -h

Focus on “available” memory. If memory and swap are both heavily used, your VPS may slow down during traffic spikes.

Relating these checks to WordPress 500 errors and slow sites

Common patterns include:

  • Low disk space: updates fail, logs cannot be written, database may error
  • High CPU: PHP or database queries take too long, causing timeouts
  • Low memory: services are killed by the system, leading to 500 errors

When diagnosing, it is useful to run df -h, free -h and top as a basic health check.

Managing services safely with systemctl

systemctl status nginx / apache2 / php-fpm / mysql

systemctl controls system services. To check web stack services:

sudo systemctl status nginx
sudo systemctl status apache2
sudo systemctl status php-fpm
sudo systemctl status mysql

Only one of Nginx or Apache will normally be in use. The output shows whether the service is “active (running)” or “failed”, and includes recent log lines.

Restarting a service: when and how to do it safely

If a service has crashed or configuration has changed, you might restart it:

sudo systemctl restart nginx

This stops and starts Nginx. Visitors may see brief interruptions if the service restarts slowly, so it is best done:

  • During quiet times for production sites
  • After validating configuration syntax where possible

If a restart fails, use systemctl status and journalctl -xe or relevant logs to see why. For more on full server reboots, see How to Reboot Linux Commands.

High risk changes that are better handled on managed VDS

Tasks that can merit a managed service include:

  • Changing PHP‑FPM or web server tuning parameters
  • Altering database configuration such as InnoDB settings
  • Upgrading major versions of Nginx, Apache, PHP or MySQL

These changes affect how services start and use resources. Managed virtual dedicated servers allow you to offload that tuning and focus on your application.


Networking basics: ping, curl, ss / netstat

Checking connectivity with ping

ping example.com to test reachability

ping sends small packets to a host and measures how long they take to come back. From your VPS, you can test external connectivity:

ping example.com

If you see replies with “time=” values, the host is reachable. If you see “Destination Host Unreachable” or timeouts, there may be routing or firewall issues.

Stopping ping and interpreting basic output

ping continues until you stop it. Press Ctrl+C. You will then see summary statistics: packets transmitted, received and packet loss percentage. Occasional small packet loss is not usually critical; persistent or high loss can explain intermittent issues.

Checking HTTP responses with curl

curl -I https://yourdomain.com to see headers and status codes

curl lets you make HTTP requests from the server. To see status codes and headers only:

curl -I https://yourdomain.com

Look at the first line, such as:

HTTP/1.1 200 OK

or

HTTP/1.1 500 Internal Server Error

If your site returns 200 from the server itself but you see problems via a browser behind a CDN, the issue may lie with caching or DNS rather than the VPS.

Using curl from the server side to bypass DNS or CDN issues

If your domain’s DNS has recently changed or you suspect CDN issues, using curl from the VPS can distinguish between:

  • Problems reaching the VPS at all
  • Issues with DNS propagation or external caching layers

You can also request by IP:

curl -I http://203.0.113.10

Be aware that some web server configurations respond differently to direct IP requests compared with domain names.

Seeing what is listening with ss or netstat

Checking if Nginx, Apache or MySQL ports are open

ss (or older netstat) shows which ports are listening. To see common web and database ports:

sudo ss -tulpn | grep -E '(:80|:443|:3306)'

This should show processes bound to ports:

  • :80 HTTP
  • :443 HTTPS
  • :3306 MySQL / MariaDB

If nothing is listening on port 80 or 443, your web server may not be running or may be misconfigured.

Why you should be careful changing firewall rules

Firewalls such as ufw or iptables control which ports are reachable. Incorrect firewall rules can:

  • Block SSH, locking you out of the VPS
  • Block HTTP/HTTPS, making sites unreachable

If you are new to firewall configuration, consider using your provider’s control panel for basic rules and leave more complex policies to experienced administrators or managed hosting teams.


File transfer and backups: scp and rsync basics

Copying files securely with scp

scp file user@server:/path and the reverse

scp copies files over SSH. To upload a file from your local machine to the VPS:

scp plugin.zip user@203.0.113.10:/var/www/example.com/wp-content/plugins/

To download a backup from the VPS to your local machine:

scp user@203.0.113.10:/var/www/example.com-2025-01-01.tar.gz .

The final . means “current local directory”. You will be prompted for the SSH password or key passphrase.

For more patterns and examples, see SCP Command Examples.

Simple use cases: uploading a plugin or downloading a backup

Common uses of scp for WordPress owners include:

  • Uploading a custom theme or plugin ZIP for manual installation
  • Downloading a tar.gz backup before making major changes
  • Transferring media libraries between servers during migrations

Using rsync for safer synchronisation

rsync -avh for incremental copies

rsync synchronises directories, copying only changed files. A safe starting pattern:

rsync -avh /var/www/example.com/ /var/www/example-backup/

Flags mean:

  • -a archive mode, preserving permissions and timestamps
  • -v verbose output
  • -h human readable sizes

Note the trailing slashes; they control how paths are interpreted. This command only copies or updates files and is non‑destructive by default.

Safety notes about using –delete

rsync --delete removes files in the destination that do not exist in the source. It is helpful for true synchronisation but can delete data if used incorrectly.

Before using --delete, run a dry run:

rsync -avh --dry-run --delete /var/www/example.com/ /var/www/example-backup/

This shows what would happen without changing anything. Review the output carefully.

How this fits with your wider WordPress backup strategy

CLI tools like tar, scp and rsync are a good complement to:

  • Automated backups from your hosting provider
  • WordPress backup plugins for database and files

For business critical sites, aim for:

  • Regular automated backups
  • Occasional manual snapshots before major updates
  • At least one backup stored off the server

Practical troubleshooting examples using these commands

Example 1: WordPress shows a 500 error after a plugin update

Using cd, ls and mv to rename the plugin folder

If a plugin causes a fatal error, you can disable it manually:

cd /var/www/example.com/wp-content/plugins
ls
mv example-plugin example-plugin.disabled

Here you:

  • Navigate to the plugins directory
  • List plugins to confirm the folder name
  • Rename the problematic plugin directory

Refreshing the site may now restore access to the dashboard, where you can delete or update the plugin more safely.

Checking error logs with tail -f

To see exactly what went wrong, watch the error log while reloading the site:

tail -f /var/log/nginx/error.log

or

tail -f /var/log/apache2/error.log

You should see PHP error messages pointing to specific files and lines. These logs are also where you would see issues from custom code or theme updates.

Example 2: Site is very slow at busy times

Checking CPU and RAM with top and free -h

When the site is slow, log in and run:

top

Look for high CPU usage by PHP‑FPM, database processes or specific scripts. In another terminal, you can check memory:

free -h

If both CPU and memory are highly utilised, you may need:

  • Application level optimisation
  • More resources on the VPS
  • Better caching or offloading of static content

A content delivery network that optimises assets, such as the G7 Acceleration Network, can help by converting images to AVIF/WebP and filtering abusive bots before they hit PHP and the database, reducing wasted load.

Checking PHP-FPM and database services with systemctl

Ensure services are healthy:

sudo systemctl status php-fpm
sudo systemctl status mysql

If they are repeatedly restarting or failing, check their logs and configuration. For deeper tuning, the article How to Tune PHP-FPM for Performance is a good next step.

Where a managed VDS or performance tuned stack helps

Performance tuning can involve:

  • Adjusting PHP‑FPM pools
  • Query optimisation or database indexing
  • Web server caching layers and TLS configuration

If that feels beyond what you want to handle, a managed virtual dedicated servers plan or managed WordPress hosting can provide a tuned stack and ongoing monitoring so you can focus on content and business operations.

Example 3: You cannot connect to your site from your office

Using ping and curl from the server to compare paths

If your office cannot reach yourdomain.com but others can, first test from the VPS itself:

ping yourdomain.com
curl -I https://yourdomain.com

If these succeed from the server, the problem is likely between your office network and the CDN or DNS, rather than the VPS. If they fail from the server as well, the issue is more likely with the web server, DNS pointing or firewall.

Checking if services are listening with ss

Next, check whether the web server is listening:

sudo ss -tulpn | grep -E ':80|:443'

If nothing appears, check:

  • systemctl status nginx or apache2
  • DNS records pointing at the correct IP

If services are listening and responding locally, your provider can often help trace external routing or firewall issues, especially if they manage network level web hosting security features.


Next steps: building confidence without becoming a full time sysadmin

Which commands to practise regularly

To build comfort, practise these in a test environment or non critical VPS:

  • Navigation and inspection: ssh, pwd, cd, ls -lah, cat, less, tail -f
  • Backups and restores on sample data: cp, mv, tar, scp, rsync
  • Basic health checks: ps, top, df -h, free -h, systemctl status, curl -I

Keep a simple log of what you changed, including dates and commands. This helps when retracing steps later.

Tasks that are safe to handle yourself vs jobs to delegate

Many VPS owners can comfortably handle:

  • Checking logs and resource usage
  • Creating manual backups before updates
  • Disabling problematic plugins or themes
  • Simple configuration edits with backups in place

Tasks that are often better delegated include:

  • Complex firewall or intrusion detection configuration
  • Database tuning and high traffic performance work
  • Major version upgrades of the OS, PHP, MySQL or web server
  • Security incident response after compromise

For those, having a managed platform reduces day to day operational load and provides reassurance that standard security and maintenance practices are in place.

Where to learn more and when managed hosting makes sense

To deepen your knowledge, the official documentation for your Linux distribution is valuable, for example the Debian Reference or the Ubuntu Server Guide. Practising on a non production VPS remains one of the best ways to gain confidence.

If you primarily want reliable WordPress or WooCommerce sites with minimal server administration, Managed WordPress hosting or a managed virtual dedicated server can be a good next step. You still benefit from understanding the essentials covered here, but you do not need to apply them daily, and you have a team to handle the more complex or risky tasks on your behalf.

Table of Contents

G7 Acceleration Network

The G7 Acceleration Network boosts your website’s speed, security, and performance. With advanced full page caching, dynamic image optimization, and built-in PCI compliance, your site will load faster, handle more traffic, and stay secure. 

WordPress Hosting

Trusted by some of the worlds largest WooCommerce and WordPress sites, there’s a reason thousands of businesses are switching to G7

Related Articles