Linux Server Basics: 15 Commands Every Website Owner Needs

Linux Server Basics: 15 Commands Every Website Owner Needs 1
⏱ 2 min readUpdated 13 October 2026

If you run a website on a small cloud server, a handful of commands cover almost everything. Connect with SSH, then:

In this article
  1. Health
  2. Services
  3. Logs
  4. Files
  5. Updates

Health

df -h                 # disk space per drive; act when Use% passes ~85%
free -m               # memory in MB; "available" is what matters
uptime                # load average; compare with the number of CPUs (nproc)
top                   # live view of busy processes (press q to quit)

Services

systemctl status nginx          # is the web server running?
sudo systemctl reload nginx     # apply config changes without dropping visitors
sudo nginx -t                   # test the config BEFORE reloading
sudo systemctl restart php8.3-fpm

Logs

sudo tail -n 50 /var/log/nginx/error.log      # last 50 errors
sudo tail -f /var/log/nginx/access.log        # watch visits live (Ctrl+C to stop)
journalctl -u nginx --since "1 hour ago"

Files

du -sh /var/www/*               # which site uses the most space
ls -lh                          # list files with sizes and permissions
sudo cp file.conf file.conf.bak # back up before editing anything
sudo nano file.conf             # simple editor: Ctrl+O save, Ctrl+X exit

Updates

sudo apt update && sudo apt upgrade     # install security updates
⚠️ Two rules that prevent most disasters: back up a file before editing it, and run nginx -t before reloading. A typo in a config file can take every site on the server offline.

Setting up a new server? See host a website for free on Oracle Cloud.

Advertisement
✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free · AI can be wrong