The Complete Contabo VPS Cheat Sheet: Maximize Your Virtual Server

Introduction: Understanding Contabo VPS

Contabo Virtual Private Servers (VPS) are cost-effective hosting solutions that provide dedicated resources on shared physical hardware. Known for their generous resource allocations at competitive prices, Contabo VPS offerings allow users to run websites, applications, game servers, and various development environments. This cheatsheet will help you optimize your Contabo VPS experience from initial setup through advanced operations.

Core Contabo VPS Plans and Specifications

Current VPS Plans Comparison

PlanvCPU CoresRAMSSD StorageTrafficApprox. Monthly Cost
VPS S48GB200GBUnlimited€4.99
VPS M616GB400GBUnlimited€9.99
VPS L830GB800GBUnlimited€14.99
VPS XL1060GB1.6TBUnlimited€24.99
VPS XXL1280GB2.0TBUnlimited€34.99

Note: Prices and specifications may vary; check Contabo’s website for current offerings

Available Operating Systems

  • Linux Distributions: Ubuntu, Debian, CentOS, Rocky Linux, AlmaLinux, Fedora
  • Windows: Windows Server options (additional license fee)
  • Custom ISO: Option to install custom operating systems

Initial Server Setup Process

1. Account Setup and Ordering

  1. Create a Contabo account at contabo.com
  2. Select your preferred VPS plan
  3. Choose datacenter location (EU, US, Asia-Pacific)
  4. Select operating system or custom ISO
  5. Add optional services (backups, additional IPs)
  6. Complete payment process

2. First-Time Access

# SSH access (Linux)
ssh root@your_server_ip

# Windows access
# Use Remote Desktop Connection with the credentials provided by Contabo

3. Essential First Steps (Linux)

# Update system packages
apt update && apt upgrade -y   # For Debian/Ubuntu
dnf update -y                  # For CentOS/Rocky/Alma/Fedora

# Set up a non-root user with sudo privileges
adduser username
usermod -aG sudo username      # For Debian/Ubuntu
usermod -aG wheel username     # For CentOS/Rocky/Alma/Fedora

# Configure SSH key authentication
mkdir -p /home/username/.ssh
touch /home/username/.ssh/authorized_keys
# Add your public key to authorized_keys
chmod 700 /home/username/.ssh
chmod 600 /home/username/.ssh/authorized_keys
chown -R username:username /home/username/.ssh

Network Configuration

Basic Networking Commands

# Display network interfaces
ip addr show

# Configure network interface (temporary)
ip addr add 192.168.1.100/24 dev eth0

# Set default gateway
ip route add default via 192.168.1.1

# Test connectivity
ping -c 4 google.com

# Check open ports
ss -tulpn

Firewall Setup with UFW (Ubuntu/Debian)

# Install UFW
apt install ufw

# Allow SSH (important before enabling firewall)
ufw allow ssh

# Allow other services as needed
ufw allow 80/tcp    # HTTP
ufw allow 443/tcp   # HTTPS

# Enable firewall
ufw enable

# Check status
ufw status

Firewall Setup with firewalld (CentOS/Rocky/AlmaLinux)

# Install firewalld if not installed
dnf install firewalld

# Start and enable firewalld
systemctl start firewalld
systemctl enable firewalld

# Allow services
firewall-cmd --permanent --add-service=ssh
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https

# Reload firewall
firewall-cmd --reload

# Check status
firewall-cmd --list-all

Performance Monitoring and Optimization

System Monitoring Tools

# Basic system information
htop              # Interactive process viewer
free -h           # Memory usage
df -h             # Disk usage
iostat            # I/O statistics

# Install advanced monitoring
apt install sysstat    # For Debian/Ubuntu
dnf install sysstat    # For CentOS/Rocky/Alma/Fedora

Performance Optimization

  • Swap Configuration

    # Create swap file (if needed)
    fallocate -l 2G /swapfile
    chmod 600 /swapfile
    mkswap /swapfile
    swapon /swapfile
    echo '/swapfile none swap sw 0 0' >> /etc/fstab
    
  • I/O Scheduler Optimization

    # Check current scheduler
    cat /sys/block/sda/queue/scheduler
    
    # Set to deadline for SSDs (temporary)
    echo deadline > /sys/block/sda/queue/scheduler
    
  • Network Tuning in /etc/sysctl.conf

    # Increase TCP max connections
    net.core.somaxconn = 4096
    net.ipv4.tcp_max_syn_backlog = 4096
    
    # Apply changes
    sysctl -p
    

Common Server Applications Setup

Web Server: Nginx

# Install
apt install nginx     # Debian/Ubuntu
dnf install nginx     # CentOS/Rocky/Alma/Fedora

# Start and enable
systemctl start nginx
systemctl enable nginx

# Basic configuration file
nano /etc/nginx/sites-available/default    # Debian/Ubuntu
nano /etc/nginx/conf.d/default.conf        # CentOS/Rocky/Alma/Fedora

Database: MariaDB/MySQL

# Install
apt install mariadb-server     # Debian/Ubuntu
dnf install mariadb-server     # CentOS/Rocky/Alma/Fedora

# Start and enable
systemctl start mariadb
systemctl enable mariadb

# Secure installation
mysql_secure_installation

PHP Setup

# Install PHP with common extensions
apt install php-fpm php-mysql php-curl php-gd php-mbstring php-xml    # Debian/Ubuntu
dnf install php-fpm php-mysqlnd php-curl php-gd php-mbstring php-xml  # CentOS/Rocky/Alma/Fedora

# Start and enable
systemctl start php-fpm
systemctl enable php-fpm

Backup and Recovery

Built-in Contabo Backups

  • Access through Contabo customer control panel
  • Daily, weekly, or monthly options
  • Instant restoration through control panel

Manual Backups

# Database backup
mysqldump -u root -p --all-databases > all_databases.sql

# Files backup with rsync
rsync -av /var/www/html/ /backup/www/

# Compress backup
tar -czvf backup-$(date +%Y%m%d).tar.gz /backup/

# Transfer to local machine
scp username@your_server_ip:/path/to/backup-*.tar.gz /local/backup/

Common Challenges and Solutions

ChallengeSolution
SSH connection refusedCheck firewall settings, SSH service status (systemctl status sshd), and network configuration
Website not loadingVerify web server running (systemctl status nginx), check error logs (/var/log/nginx/error.log), confirm DNS settings
High CPU/RAM usageUse htop to identify resource-heavy processes, optimize application settings, consider upgrading plan
Disk space running lowUse du -sh /* to identify large directories, remove temporary files (/tmp, /var/log), clean package caches
Server responding slowlyCheck for network issues, configure caching, optimize database queries, implement CDN

Best Practices for Contabo VPS Management

  1. Regularly update your system to patch security vulnerabilities

    apt update && apt upgrade -y    # Debian/Ubuntu
    dnf update -y                   # CentOS/Rocky/Alma/Fedora
    
  2. Implement automated backups for disaster recovery

    # Add to crontab
    crontab -e
    # Add: 0 2 * * * /path/to/backup-script.sh
    
  3. Monitor system resources to anticipate scaling needs

    # Install Netdata for real-time monitoring
    bash <(curl -Ss https://my-netdata.io/kickstart.sh)
    
  4. Secure your server with proper user management and firewall rules

  5. Document configuration changes in a central location

  6. Use version control for application code and configuration files

  7. Set up monitoring and alerting for critical service failures

    # Simple monitor script example
    if ! systemctl is-active --quiet nginx; then
      echo "Nginx is down" | mail -s "Server Alert" admin@example.com
    fi
    

Contabo VPS Management Tools

Control Panel Options

  • Contabo Customer Panel: Billing, server reinstallation, IP management
  • cPanel/WHM: Available as add-on, web hosting management interface
  • Plesk: Available as add-on, server management platform
  • Webmin: Free alternative, can be self-installed

CLI Management Tools

# Remote server management
ssh-copy-id username@your_server_ip    # Set up passwordless login
scp local_file username@your_server_ip:/remote/path    # Copy files

# Configuration management
git init /etc    # Version control for configuration
etckeeper         # Alternative configuration management

Resources for Further Learning

Official Contabo Resources

Community and Learning

Documentation for Common Software

This cheatsheet provides a comprehensive overview of Contabo VPS management, but server administration is always evolving. Stay updated with the latest best practices and security recommendations through the resources provided.

Scroll to Top