/ knowledge
Server Command Knowledge Base
68 battle-tested ops commands with explanations, use cases, and troubleshooting. The same library built into ZShell.
68 commands
Software Installation
13- Install Docker Compose Install the Docker Compose v2 plugin
- Install Certbot (Let's Encrypt) Install Certbot for free SSL certificates
- Install Docker One-click install Docker CE
- Install Git Install Git version control tool
- Install OpenJDK Install OpenJDK 17 runtime and tools
- Install MariaDB Install MariaDB database server
- Install MySQL Install MySQL Server
- Install PHP & PHP-FPM Install PHP with PHP-FPM and MySQL extension
- Install Nginx One-click install Nginx web server
- Install Node.js Install Node.js LTS via NodeSource
- Install PostgreSQL Install PostgreSQL database server
- Install Redis Install Redis cache service
- Install Python3 + pip Install Python3 and pip package manager
System Configuration
8- Configure UFW Firewall Enable UFW and allow SSH/HTTP/HTTPS ports
- Raise Open File Limit Raise the max open files (nofile) to 65535
- Set Hostname Set the system hostname
- Configure System Locale Set UTF-8 Chinese locale
- Generate SSH Key Pair Generate Ed25519 SSH key pair
- Change SSH Port Change the SSH server port (default 22)
- Set Timezone Set system timezone to Asia/Shanghai
- Create Swap Partition Create a 2GB swap partition
Service Management
9- Restart Docker Restart Docker daemon
- Enable & Start Service Enable service at boot and start immediately
- Tail Service Logs Follow logs of a systemd service in real time
- View Failed Services List all failed systemd services
- List Running Services List all running systemd services
- Reload Nginx Config Validate and reload the Nginx configuration
- Check Nginx Status Display Nginx service status
- Restart MySQL Restart MySQL database service
- Restart Nginx Restart Nginx service
Network Tools
10- HTTP Response Headers Inspect the HTTP response headers of a URL
- Network Connections View current network connection statistics
- HTTP Request Test Test HTTP endpoint response
- Local IP Info Show all network interface IP addresses
- Listening Ports List all listening TCP/UDP ports
- DNS Lookup Query domain DNS resolution records
- MTR (Ping + Traceroute) Trace route and measure latency with MTR
- Ping Test Send 5 ICMP packets to target host
- Traceroute Trace network path to target host
- Whois Lookup Query domain registration information
Disk Management
8- Clean APT Cache Clean APT package cache and old kernels
- Largest Directories Show the 20 largest directories under the current path
- Inode Usage Check inode usage
- Find Large Files Find files larger than 100MB in current directory
- Clean Journal Logs Remove systemd journal logs older than 7 days
- Files Deleted But Open List files that were deleted but still held open
- Disk Usage Show all disk partition usage
- Clean Docker Disk Clean up stopped containers, dangling images, and unused networks
Security Hardening
7- Check Open Ports List all listening ports and their processes
- Block IP Address Block specified IP via UFW
- Copy SSH Key to Server Install your SSH public key on a remote server
- Install Fail2Ban Install and configure Fail2Ban for brute-force protection
- SSH Hardening Disable password login, allow key auth only
- Update System Apply all available package upgrades
- Enable Auto Security Updates Install and configure unattended security upgrades
Monitoring & Diagnostics
8- Kernel Log View last 50 kernel messages
- Process Monitor (htop) View processes with htop (requires install)
- Disk IO Monitor Disk read/write IO statistics
- Login History View recent login records
- System Info Overview Display system summary information
- Process Monitor (top) Interactive process monitor (press q to quit)
- System Uptime Show system uptime and load average
- Memory Statistics Real-time memory/CPU/IO statistics