How to Configure VPS Hosting on Linux Server with PingRack
Complete step-by-step guide to provision, secure, and optimize a Linux VPS on PingRack — covering SSH hardening, web stack installation (Nginx, PHP 8.3+, MariaDB 10.6+), DNS configuration, and HTTP/2/3 enablement for production-ready hosting.
How to Configure VPS Hosting on Linux Server with PingRack
This guide walks you through provisioning and hardening a Linux VPS on PingRack, configuring DNS, securing SSH access, and deploying a modern web stack optimized for performance and security.
1. Provision Your VPS in the PingRack Dashboard
- Log in to the PingRack cloud Panel.
- Navigate to Services → My Services → Order New Service.
- Select VPS Plan.
- Pick an OS image: Ubuntu 22.04 LTS, Ubuntu 24.04 LTS, Debian 12, AlmaLinux 9, or Rocky Linux 9.
- Choose resources (CPU, RAM, NVMe storage) based on your workload.
- Complete checkout. Your VPS will be provisioned within minutes.
Tip: PingRack VPS instances come with a dedicated IPv4 block by default.
2. Set Hostname & Configure Reverse DNS (PTR)
Set the hostname
# Run as root after first login
hostnamectl set-hostname yourdomain.comConfigure PTR (rDNS) for IPv4 & IPv6
- In the PingRack Client Area, go to Services → My Services → [Your VPS] → Manage → Network.
- Click Edit PTR Records.
- Enter your fully qualified domain name (e.g.,
mail.yourdomain.comoryourdomain.com) for both IPv4 and IPv6 addresses. - Save changes. Propagation typically completes within 5–15 minutes.
Why it matters: Proper PTR records are essential for email deliverability and security reputation.
3. Add DNS A, AAAA, and PTR Records
Point your domain to the VPS using PingRack DNS or your registrar:
| Record Type | Name | Value | TTL |
|-------------|------|-------|-----|
| A | @ | | 300 |
| AAAA | @ | | 300 |
| A | www | | 300 |
| AAAA | www | | 300 |
| MX | @ | mail.yourdomain.com (priority 10) | 300 |
If using PingRack DNS (included free with VPS), manage records under Domains → DNS Management.
4. Secure SSH Access
4.1 Connect as root
ssh root@<your-vps-ipv4>4.2 Create a sudo user
adduser deploy
usermod -aG sudo deploy4.3 Add your SSH public key
mkdir -p /home/deploy/.ssh
cp ~/.ssh/authorized_keys /home/deploy/.ssh/
chown -R deploy:deploy /home/deploy/.ssh
chmod 700 /home/deploy/.ssh
chmod 600 /home/deploy/.ssh/authorized_keys4.4 Harden SSH daemon
Edit/etc/ssh/sshd_config:
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
Port 2222 # Optional: change from default port 22Reload SSH:
systemctl reload sshdImportant: Test the new user login in a separate terminal before closing the root session.
5. System Updates & Firewall
apt update && apt upgrade -y # Ubuntu/Debian
dnf update -y # AlmaLinux/RockyInstall and enable UFW (Ubuntu/Debian) or firewalld (RHEL-based)
ufw allow 2222/tcp # Your custom SSH port
ufw allow 80/tcp # HTTP
ufw allow 443/tcp # HTTPS
ufw allow 443/udp # HTTP/3 (QUIC)
ufw enableEnable automatic security updates:
apt install unattended-upgrades -y
dpkg-reconfigure --priority=low unattended-upgrades6. Install Modern Web Stack
6.1 Nginx (with HTTP/2 & HTTP/3 support)
# Ubuntu 24.04 / Debian 12 include Nginx 1.24+ with HTTP/3 (QUIC) support
apt install nginx -yVerify HTTP/3 module:
nginx -V 2>&1 | grep -o http_v3_module6.2 PHP 8.3+ (Performance & Security Support Window)
# Ubuntu 24.04 ships PHP 8.3 by default
apt install php8.3-fpm php8.3-cli php8.3-mysql php8.3-curl php8.3-gd php8.3-mbstring php8.3-xml php8.3-zip php8.3-opcache -yConfigure PHP-FPM pool for your site in /etc/php/8.3/fpm/pool.d/www.conf:
pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35Restart: systemctl restart php8.3-fpm
6.3 MariaDB 10.6+ (or MySQL 8.0+)
# MariaDB 10.11 LTS on Ubuntu 24.04
apt install mariadb-server -y
mysql_secure_installationWhy MariaDB 10.6+ / MySQL 8? Better indexes (descending, functional), native JSON functions, CTEs, window functions, and improved replication — critical for modern applications.
7. Configure Nginx Site with HTTP/2 & HTTP/3
Create /etc/nginx/sites-available/yourdomain.com:
server {
listen 80;
listen [::]:80;
server_name yourdomain.com www.yourdomain.com;
return 301 https://$server_name$request_uri;
}server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
listen 443 quic reuseport;
listen [::]:443 quic reuseport;
http3 on;
server_name yourdomain.com www.yourdomain.com;
root /var/www/yourdomain.com/public;
index index.php index.html;
ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
# Security headers
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
add_header Referrer-Policy "strict-origin-when-cross-origin";
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_hide_header X-Powered-By;
}
location ~ /\.ht {
deny all;
}
}
Enable site and test:
ln -s /etc/nginx/sites-available/yourdomain.com /etc/nginx/sites-enabled/
nginx -t && systemctl reload nginx8. Obtain TLS Certificates (Let's Encrypt)
apt install certbot python3-certbot-nginx -y
certbot --nginx -d yourdomain.com -d www.yourdomain.comCertbot auto-configures HTTPS, HTTP/2, and OCSP stapling. Renewal is handled by systemd timer.
9. Deploy Your Application
mkdir -p /var/www/yourdomain.com/public
chown -R deploy:deploy /var/www/yourdomain.com
Deploy your code as the 'deploy' user via Git, rsync, or CI/CD
10. Post-Setup Checklist
- [ ] Verify SSH key login for
deployuser on port 2222 - [ ] Confirm root login is disabled (
ssh root@...should fail) - [ ] Test HTTPS with HTTP/2:
curl -I --http2 https://yourdomain.com - [ ] Test HTTP/3:
curl -I --http3 https://yourdomain.com - [ ] Run
mysql_secure_installationif not done - [ ] Set up automated backups via PingRack Backup Service (Client Area → Backups)
- [ ] Configure monitoring: PingRack Monitoring (free tier includes uptime, CPU, disk, network)
- [ ] Harden PHP: disable dangerous functions in
php.ini(exec,shell_exec,system,passthru,proc_open,popen)
PingRack-Specific Notes
- IPv6 is enabled by default — ensure your application listens on
::(not just0.0.0.0). - PingRack DDoS Protection (included on all VPS plans) mitigates L3/L4 attacks automatically.
- Snapshot backups can be taken instantly from the Client Area before major changes.
- Rescue Mode is available for recovery: Client Area → VPS → Manage → Rescue Mode.
- Support: 24/7 via ticket (Client Area) or email
support@pingrack.com— average first response < 15 minutes.
Next Steps
- Configure Redis/Memcached for caching
- Set up Docker & Docker Compose for containerized apps
- Implement Fail2Ban for additional SSH/HTTP protection
- Enable PingRack CDN for static asset acceleration
Need help? PingRack's managed services team can handle full stack setup, hardening, and ongoing maintenance. Contact sales@pingrack.com for a quote.
