Initial Setup
1 Setup Server Hostname
Your server hostname should be a subdomain separate from your website domains (e.g., host.yourdomain.com if your site is yourdomain.com).
Add a DNS A record for your hostname subdomain pointing to your server IP. Optionally add a SPF TXT record: "v=spf1 a ~all"
Set the hostname on AlmaLinux/Rocky Linux 8/9/10:
hostnamectl set-hostname host.yourdomain.com
Edit /etc/hosts and add both IPv4 and IPv6 entries:
111.222.333.444 host.yourdomain.com host
Then update the default Nginx vhost at /usr/local/nginx/conf/conf.d/virtual.conf (shortcut: vhostconf) — change server_name localhost; to your hostname.
2 Add Your First Domain Vhost
Use centmin.sh menu option 2 or the nv command to add a new Nginx vhost. You will be prompted for the domain name, whether to create a self-signed SSL vhost, and optional Pure-FTPD credentials.
For free SSL certificates, use the Let's Encrypt integration. If using Cloudflare, use the DNS API validation method.
Files created for yourdomain.com:
/usr/local/nginx/conf/conf.d/yourdomain.com.conf # HTTP vhost
/usr/local/nginx/conf/conf.d/yourdomain.com.ssl.conf # SSL vhost
/usr/local/nginx/conf/ssl/yourdomain.com/ # SSL certificates
/home/nginx/domains/yourdomain.com/public # Web root
/home/nginx/domains/yourdomain.com/log # Log files
Upload files via SFTP to /home/nginx/domains/yourdomain.com/public, then fix ownership:
chown -R nginx:nginx /home/nginx/domains/yourdomain.com/public
3 DNS Settings
Use a third-party DNS provider (Cloudflare, DNSMadeEasy) rather than local NSD for better uptime and performance. Follow the Nginx domain DNS setup guide.
DNS validation tools: whatsmydns.net, intodns.com, Pingdom DNS Check.
4 CSF Firewall
CSF Firewall is auto-installed with Centmin Mod and pre-configured with security tweaks including IPSET support, DShield and Spamhaus blocklists, and UDP flood protection. Your SSH client IP is automatically whitelisted.
Whitelist other servers and monitoring services (Pingdom, NodePing) to prevent lockouts. See the CSF Firewall guide.
Low-memory VPS (under 256MB): Use LOWMEM_INSTALL='y' in your persistent config at /etc/centminmod/custom_config.inc before installation. This disables Brotli, Lua, and NSD to reduce memory usage.
Configuration
5 Proxies and Real IP
If you use a CDN or reverse proxy (Cloudflare, AWS CloudFront, Incapsula), configure Nginx's ngx_http_realip_module so access logs record visitor IPs instead of proxy IPs.
Cloudflare configuration is at /usr/local/nginx/conf/cloudflare.conf — sets real_ip_header CF-Connecting-IP with all Cloudflare IPv4 ranges. This is commented out by default in vhost configs; enable per-vhost as needed.
See the Nginx Cloudflare proxy configuration guide.
6 Nginx Configurations
Key Nginx configuration files and their shortcut commands:
| Shortcut | File |
|---|---|
| nginxconf | /usr/local/nginx/conf/nginx.conf |
| vhostconf | /usr/local/nginx/conf/conf.d/virtual.conf |
| phpinc | /usr/local/nginx/conf/php.conf |
| dropinc | /usr/local/nginx/conf/drop.conf |
| statfilesinc | /usr/local/nginx/conf/staticfiles.conf |
See the full Nginx configurations listing for SSL, WordPress, Xenforo, and more examples.
7 Centmin Mod Addons
Centmin Mod includes 35+ standalone addon scripts in the addons/ directory. Popular addons include:
- acmetool.sh — Let's Encrypt SSL certificates
- opendkim.sh — DKIM email authentication
- maldet.sh — Linux Malware Detect + ClamAV
- wpcli.sh — WordPress CLI management
- redis-server-install.sh — Redis server
- docker.sh, golang.sh, nodejs.sh, ffmpeg.sh
See the full Addons page for the complete list.
8 Email Setup
Centmin Mod installs Postfix by default for server-level email. For @yourdomain.com email, use a third-party provider: Zoho Mail, Google Workspace, Microsoft 365, FastMail, or Amazon WorkMail.
Configure SPF, DKIM (via addons/opendkim.sh), and DMARC DNS records to prevent emails landing in spam. See the email setup guide.
9 PageSpeed Module (Deprecated)
Deprecated
The ngx_pagespeed module has been deprecated and removed from all Centmin Mod branches (132.00stable, 140.00beta01, 141.00beta01). The NGINX_PAGESPEED='y' variable no longer works. See the ngx_pagespeed page for historical reference.
Server Management
10 Server Backups
Centmin Mod provides Menu 21 (Data Management) for comprehensive backup operations including:
- backups.sh — Full server backup automation
- mariabackup-restore.sh — MariaDB hot backup and restore
- tunnel-transfers.sh — SSH tunnel transfers between servers
- keygen.sh — SSH key management
- AWS S3 profiles for cloud backup storage
Additionally, use your VPS provider's snapshot/backup features as a secondary backup layer.
11 MySQL Management
MariaDB 10.4 is the default version. Available versions vary by branch:
| Branch | Versions |
|---|---|
| 132.00stable | 10.2, 10.3, 10.4, 10.5, 10.6 |
| 140.00beta01 | 10.2–10.6, 10.11, 11.4 |
| 141.00beta01 | 10.2–10.6, 10.11, 11.4, 11.8, 12.3 |
Manage users and databases via Menu 6. For a GUI, install phpmyadmin via the addons/phpmyadmin.sh addon, or connect with HeidiSQL over SSH tunnel.
12 Security Updates
Centmin Mod does not auto-install OS security updates. A checker runs every 24 hours on menu exit and prints available updates but does not execute them. Nginx, PHP, and MySQL packages are excluded from automatic updates.
Set up yum-cron for automatic nightly security updates, and install maldet + ClamAV via addons/maldet.sh for malware scanning.
13 Statistics Pages
Centmin Mod installs statistics pages for Zend OPcache, Memcached, PHP Info, and Nginx vhost traffic stats (via ngx_http_vhost_traffic_status_module). These are served from the default hostname web root with randomized URL prefixes unique to your install.
Find the randomized URLs in your install log. IP-restrict access via the virtual.conf vhost using Nginx allow/deny directives.
14 PHP-FPM Security
Harden PHP-FPM by disabling dangerous functions in /usr/local/etc/php-fpm.conf (shortcut: fpmconf):
php_admin_value[disable_functions] = show_source, system, shell_exec, passthru, exec, popen, proc_open
The open_basedir restriction is available via /usr/local/nginx/conf/php.conf but is commented out by default — enable manually to lock PHP execution to each vhost's document root. Restart PHP-FPM after changes: fpmrestart
Advanced
15 Community Forums
Join the Centmin Mod Community Forums for support, customization guides, and advanced configuration tips. The Centmin Mod Insights section covers deeper technical details.
16 Monitoring Tools
Centmin Mod includes several diagnostic tools:
| Tool | Purpose |
|---|---|
| tools/cminfo.sh | System overview and info |
| tools/sitestatus.sh | Maintenance mode toggle |
| tools/kernelcheck.sh | Kernel version check |
| tools/hptweaks.sh | Kernel and system tuning |
| tools/nginx_crypto_check.sh | SSL/TLS cipher audit |
For external monitoring, consider Nginx Amplify or services like Nixstats. See the Server Monitoring page.
17 PHP.ini Customization
Do not edit /usr/local/lib/php.ini directly — it gets overwritten on PHP upgrades. Instead, use the custom ini directory at /etc/centminmod/php.d/.
Default custom file: /etc/centminmod/php.d/a_customphp.ini
To override safely without future Centmin Mod updates overwriting your changes, create a second file with an alphabetically later name:
# Create /etc/centminmod/php.d/b_customphp.ini with your overrides
max_execution_time = 120
upload_max_filesize = 64M
post_max_size = 64M
Restart PHP-FPM after changes: fpmrestart
18 Root User Emails
Configure admin email addresses via tools/email.sh, which saves to /etc/centminmod/email-primary.ini. Root mail accumulates in /var/spool/mail/root — monitor its size periodically.
Common root emails include CSF Firewall SSH login alerts and LFD brute-force block notifications.
19 Keeping Code Updated
Use centmin.sh Menu 23 to update Centmin Mod code and switch between branches. The submenu offers:
- Setup git environment
- Update current branch
- Switch to another branch
- Exit
Alternatively, use the standalone script: tools/cmupdate.sh update
See the Centmin Mod Upgrades guide for details.
20 Email Deliverability
Ensure server-sent emails (password resets, notifications) reach inboxes by configuring:
- SPF TXT record in DNS
- DKIM via
addons/opendkim.sh(supports 1024/2048/4096-bit keys, default 2048) - DMARC TXT record in DNS (manual setup)
- Reverse PTR record for your server IP
Many VPS providers block outbound SMTP port 25 by default. Contact your provider to request unblocking, or use a third-party SMTP relay service with Postfix.
21 Performance Boosting
Advanced performance tuning options include:
- TCP BBR congestion control — enable via
TCP_BBR_ENABLE - TCP Fast Open — disabled by default, enable in
/etc/centminmod/custom_config.inc - File descriptor tuning — raised to 524,288 limit
- Kernel tuning via
tools/hptweaks.sh - I/O scheduler optimization via
tools/setio.sh
Summary
After completing these steps, your server should have:
| Domain | Nginx Vhost | Web Root |
|---|---|---|
| host.yourdomain.com | conf.d/virtual.conf | /usr/local/nginx/html |
| yourdomain.com | conf.d/yourdomain.com.conf | /home/nginx/domains/yourdomain.com/public |
For persistent configuration changes, always use /etc/centminmod/custom_config.inc (shortcut: customconfig).
Need help?
Join the community forums or check the troubleshooting guide for common issues.