DocsServer ManagementServer Management Basics
Server Management 8 min read

Server Management Basics

Essential commands and practices for managing your dedicated server.

Server Management Basics

This guide covers essential server administration tasks for your Cd hosting dedicated server.

Connecting to Your Server

Use SSH to connect to your server:

bash
# Basic SSH connection
ssh root@your-server-ip

# Using a specific SSH key
ssh -i ~/.ssh/your-key root@your-server-ip

# Connect on a custom port
ssh -p 2222 root@your-server-ip

System Monitoring

Check System Resources

bash
# CPU and memory usage
htop

# Disk usage
df -h

# Network connections
netstat -tulpn

# System uptime and load
uptime

Process Management

bash
# List running processes
ps aux

# Kill a process
kill -9 PID

# Find processes by name
pgrep -a nginx

Package Management

Ubuntu/Debian

bash
# Update package list
apt update

# Upgrade all packages
apt upgrade -y

# Install a package
apt install nginx

# Remove a package
apt remove nginx

CentOS/RHEL

bash
# Update packages
yum update -y

# Install a package
yum install nginx

# Remove a package
yum remove nginx

Service Management

bash
# Start a service
systemctl start nginx

# Stop a service
systemctl stop nginx

# Restart a service
systemctl restart nginx

# Enable service on boot
systemctl enable nginx

# Check service status
systemctl status nginx

Log Management

Important log locations:

Log FilePurpose
/var/log/syslogSystem messages
/var/log/auth.logAuthentication attempts
/var/log/nginx/access.logWeb server access
/var/log/nginx/error.logWeb server errors
/var/log/mysql/error.logDatabase errors
bash
# View recent log entries
tail -f /var/log/syslog

# Search logs
grep "error" /var/log/syslog

# Rotate logs manually
logrotate -f /etc/logrotate.conf
Need help? Chat with us!