Linux Commands Every VPS Owner Should Know (2026 Cheat Sheet)

Linux Commands Every VPS Owner Should Know — 2026 Cheat Sheet. UltaHost-branded graphic showing a Linux VPS hosting webpage, operating system icons, and a “2026” label on a blue-purple gradient background.
Shares

SSH gives you a terminal on a remote Linux server. This cheat sheet covers common tasks on an Ubuntu or Debian VPS, including files, services, resource checks and logs. Some managed plans also provide a control panel; shell access depends on your plan and account permissions.

Start with commands that inspect the system before making changes. The examples below assume a Bash-compatible shell and, for service management, a system using systemd. Replace sample paths, usernames and service names with those from your server.

Commands that edit files, stop services or remove data can affect a live site. Work from a current backup, check the target and use sudo only where your account is authorized to do so.

Key Takeaways

  • Check files, service state, logs and resources before changing configuration.
  • Use sudo only for authorized administrative operations.
  • APT examples apply to Ubuntu and Debian; service names and paths can vary.
  • Back up files before editing, and verify the target before deleting or stopping anything.
  • Use manual pages to confirm options for the version installed on your VPS.

Connecting to Your VPS via SSH

SSH is a remote access command line management tool with security protocols you can depend on. It creates a secure connection through encryption that allows you to run commands, manage files, and configure services on a server.

Connecting to a server can typically be done with a command like

ssh username@server-ip

On the first connection, compare the host-key fingerprint with a trusted value from your provider or server administrator before accepting it. Authenticate using your password or SSH key; never share the private key.

Windows users can use OpenSSH in PowerShell, while macOS and Linux users can use a terminal. The SSH connection command is the same for different server regions, but installed utilities and service names depend on the operating system.

Essential File and Directory Commands (Core VPS Navigation)

When working with a VPS, most of your tasks require navigating files and directories. These commands are critical for efficient management.

pwd – Prints the current working directory.

Example:

pwd

Typical VPS use case: Confirm your current location before editing files or running commands.

ls – Lists files and directories.

Example:

ls /var/www/html

Typical VPS use case: Review website files inside your web root directory.

cd – Changes the current working directory.

Example:

cd /etc/nginx

Typical VPS use case: Navigate to configuration directories before making changes.

mkdir – Creates a new directory.

Example:

mkdir backups

Typical VPS use case: Create folders for backups, logs, or new projects.

rm removes files; directories require additional options. Check every target before deletion.

Example:

rm -i -- old-backup.zip

Typical VPS use case: Remove a verified unneeded file. The -i option asks for confirmation; rm does not move a file to a desktop Trash folder. Keep a backup if you may need it again.

cp – Copies files or directories.

Example:

cp -i -- nginx.conf nginx.conf.bak

Typical VPS use case: Copy a configuration file before editing it. The -i option prompts before overwriting an existing destination; use a distinct backup name for each change.

mv – Moves or renames files and directories.

Example:

mv app.conf app.conf.old

Typical VPS use case: Rename configuration files or move website files during deployments.

touch – Creates an empty file or updates a file’s timestamp.

Example:

touch index.html

Typical VPS use case: Create new configuration, log, or placeholder files.

Before modifying a configuration file, make a separate backup and check ownership and permissions. File commands work in your current directory unless you supply an absolute path.

Managing Logs and Configuration Files

When assessing the performance of your web application on a VPS, you will be inspecting logs and editing configuration files. The following commands will help you edit and view files via the terminal.

cat – Displays the entire contents of a file.

Example:

cat /etc/nginx/nginx.conf

Typical VPS use case: Quickly view a configuration file or small log file.

less – Opens a file in an interactive viewer, allowing you to scroll forward and backward.

Example:

sudo less /var/log/nginx/error.log

Typical VPS use case: Read large log files without loading the entire file into the terminal.

head – Displays the first lines of a file (10 by default).

Example:

sudo head /var/log/syslog

Typical VPS use case: Check the beginning of a log or configuration file.

tail – Displays the last lines of a file (10 by default) and can monitor updates in real time with the -f option.

Example:

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

Typical VPS use case: Monitor server logs live while troubleshooting website or application errors.

nano – A beginner-friendly terminal text editor for creating and editing files.

Example:

sudo nano /etc/nginx/nginx.conf

Typical VPS use case: Edit Nginx, Apache, or SSH configuration files directly on the server.

vim – A powerful terminal text editor with advanced editing features.

Example:

sudo vim /etc/ssh/sshd_config

Typical VPS use case: Edit a configuration file if you already know vim. Press Escape and type :q! to quit without saving, or :wq to save and quit.

Protected files and logs may require sudo. Press q to leave less, top or the systemctl status pager, and Ctrl+C to stop tail -f. In nano, use Ctrl+O to write, Enter to confirm the name, and Ctrl+X to exit. Back up a configuration file before editing it and validate the service configuration before reloading it.

User and Permission Management Commands

The security of your VPS relies on a large part of permissions and user management. With these commands, you can control access to your server.

  • sudo – allows execution of commands with root privileges
  • chmod – alter permissions for files and folders
  • chown – change ownership of a file
  • passwd – change a user’s password
  • useradd, usermod – create and alter user accounts

Check the intended owner, group and service account before changing permissions. Broad changes can break an application or expose files. Apply the narrowest access that supports the required task.

Service Management Commands

Most applications on a VPS run as services. The stability of your VPS relies on your ability to manage these services. The primary command used for controlling these services is systemctl.
  • systemctl status – shows the current state of the service
  • systemctl start/stop/restart – alter the state of the service
  • systemctl enable nginx — configure Nginx to start at boot; it does not start it now.

Use systemctl status nginx and relevant logs to investigate a failed web server before restarting it. Start, stop and restart change service state and can interrupt traffic. Unit names vary: Ubuntu commonly uses apache2, while another distribution may use httpd. systemctl enable configures startup behavior; it does not start the service immediately.

“Note that this does not have the effect of also starting any of the units being enabled.”

systemd documentationsystemctl enable

Server Resource Monitoring Commands

Keeping resources within the limits of your VPS hosting helps you understand the behavior of your system and helps you maintain your VPS’s performance and stability. Here are some commands combined with their brief descriptions:

  • top, htop – list processes and provide CPU and RAM usage (in real time)
  • free – provides RAM usage statistics
  • df – provides statistics for disk storage usage
  • du – gives the size of files and directories on disk and helps locate spacious directories
  • uptime shows how long the system has been running and its load averages. Load average is not a CPU-use percentage.

Process Management Commands

Inspect a process before sending it a signal. A high CPU reading does not, by itself, prove that a process should be terminated.

  • ps – lists the processes running on the system
  • kill PID sends SIGTERM by default, allowing a process to shut down. Check the PID first. killall can affect every process matching a name; avoid broad matches.
  • pgrep -a nginx lists matching process IDs and command lines for inspection.

Networking Commands for VPS Administration

Understanding networking commands for your VPS will give you insight into the way your VPS connects to the internet and external services and systems. It is also useful for diagnosing connectivity and verifying that everything is functioning normally.

  • ip – displays information about network interfaces and IP addresses, along with the routing info
  • ping tests ICMP reachability. A failed ping may mean ICMP is blocked; it does not prove that a website is down.
  • traceroute – shows the route that data takes to a particular destination
  • ss displays sockets and listening services; netstat is an older alternative that may not be installed.
  • curl, wget – can make API calls, test endpoints, and even download files from the web

Log Analysis Commands

Logs record events that help you investigate a server problem. Match messages to the failing request and its timestamp, then check the relevant service configuration.

  • tail -f – allows you to see the log file as it updates in real time
  • grep – allows you to search for specific patterns or even specific errors in log files
  • journalctl – allows you to see the logs for services in the OS and logs of the operating system itself

Package Management Commands

Use APT for package management on Ubuntu and Debian. Other distributions use different tools. Administrative operations normally require sudo. apt update refreshes the index; it does not install upgrades. Review changes before running an upgrade and plan any required restart or reboot.
  • apt update – refreshes package lists
  • apt upgrade – updates already installed packages
  • apt install – adds packages
  • apt remove – takes packages away

Linux Commands for Security

Security is one of the most important things to consider when managing Virtual Private Servers. Linux provides VPS managers with plenty of ways to help defend against intruders and attacks.

These utilities support a security configuration; their presence alone does not secure a server:

  • ufw manages host firewall rules. Allow the actual SSH port before enabling or changing remote-access rules.
  • fail2ban-client queries and controls the Fail2Ban service. Protection depends on correctly configured jails, filters and log sources.
  • ssh-keygen creates an SSH key pair. Protect the private key with a passphrase and install only the public key on the server.

Docker Commands VPS Owners Should Know

Docker runs applications in containers. These commands apply only when Docker is installed and your account is authorized to use it.

Some basic commands include:

  • docker ps: lists all the running containers.
  • docker logs: shows logs for debugging.
  • docker stop: stops running containers.
  • docker restart: restarts containers/services.

Docker access can carry root-level privileges, including membership of the docker group. Do not grant it casually. Stopping or restarting a container interrupts its workload; inspect logs first. Review published ports separately because Docker networking can bypass UFW rules.

Linux Commands Cheat Sheet Table

Use these examples as a reference, not as a sequence to run. Replace sample usernames, paths, owner:group and PID with verified values from your server. Commands that change files or processes require the same checks described above:

CommandPurposeCommon Use Example
sshConnect to a remote server securelyssh username@server-ip
dfDisk usagedf -h
lsList files and directoriesls /var/www/html
pwdShow current directorypwd
cdChange directorycd /etc/nginx
grepSearch textgrep -n 'error' app.log
mkdirCreate a new directorymkdir backups
rmRemove files or directoriesrm -i -- unused-file.txt
nanoEdit files in the terminalnano notes.txt
tailView the end of a filetail -n 50 app.log
chmodChange file permissionschmod 640 private-notes.txt
chownChange file ownershipsudo chown owner:group file
systemctlManage system servicessystemctl status nginx
topMonitor system resourcestop
freeDisplay memory usagefree -m
psList running processesps aux
killSend a termination signal to a verified processkill -TERM PID
pingTest network connectivityping -c 4 example.com
curlSend HTTP requestscurl -I https://example.com
apt updateRefresh package listssudo apt update
ufwManage firewall rulessudo ufw status verbose
docker psList running Docker containersdocker ps

Common VPS System Commands

Management of VPS systems is generally accomplished using a number of Linux system commands. Below are examples of tasks commonly done and the commands used to accomplish them.

  • Check available RAM: free -m
  • Inspect Nginx: systemctl status nginx
  • Follow the Nginx error log: sudo tail -f /var/log/nginx/error.log
  • List listening TCP and UDP sockets: sudo ss -tulpn
  • Check filesystem space: df -h
  • Review recent Nginx logs: sudo journalctl -u nginx --since "1 hour ago"

With these commands, system administrators are capable of monitoring the performance of their system, troubleshooting errors, and managing software applications.

A Linux VPS can suit projects that need custom packages, services or network settings. That flexibility comes with responsibility for maintaining the operating system and application.

A VPS gives you a virtual environment with the resources defined by your plan. It is not automatically faster than shared hosting: performance depends on resources, contention, application configuration and workload.

Why UltaHost Linux VPS Is Ideal for Server Management

An UltaHost Linux VPS with root access lets you administer the installed operating system and services. Confirm which management, backup and support tasks are included in the plan you choose.

Most examples here use standard Linux tools. Install optional utilities only when needed, and use the documentation for your distribution and installed version. A command written for Ubuntu is not necessarily correct for every Linux image.

Conclusion: VPS Management and Mastering Commands

Use a small set of inspection commands to establish what is wrong, then make one controlled change at a time. Check the result and preserve useful logs before restarting services or removing files.

Keep this cheat sheet alongside the manual pages available through man command-name or command-name --help. Check the installed version’s options before copying a command into a production server.

FAQ

What are the most important Linux commands for VPS management?
Do I need to know Linux to manage a VPS?
How do I check if my VPS is running properly?
What command is used to restart a VPS service?
How do I find errors on my VPS?

Ask UltaAI

Your domain and hosting advisor.


Javeria Riaz

Content isn’t just about filling space; it’s about creating impact. Javeria is a WordPress expert, technical writer, and content strategist who specializes in crafting stories that readers love and search engines notice. By blending SEO strategy with creativity, she turns simple ideas into engaging content that informs, inspires, and drives results.

Related Posts