Centmin Mod LEMP Stack Install on CentOS

The following steps will allow you to install Nginx based Centmin Mod LEMP stack on CentOS 7 only based server or check out public beta testing for AlmaLinux & Rocky Linux EL8+.

Installation Notes:

  1. SELINUX must be disabled.
  2. Initial Centmin Mod installation needs to be done as full root user rather than as sudo user and centmin.sh shell based menu needs to be run as full root user.
  3. Tip #1: For best security and performance you would want to use CentOS 7 with KVM based VPS server or dedicated servers. Centmin Mod can detect whether OpenVZ or Xen/KVM virtualization is being used and auto optimise the server environment based on that info. OpenVZ VPS due to the limitations and use of host level Kernel can not be auto optimized to the level that KVM, Xen or dedicated servers can.
  4. Tip #2: Centmin Mod currently DOES NOT fully support LXD/LXC containers due to the fact that not all web hosts properly configure LXD/LXC container at the LXD/LXC host level for CentOS support. Centmin Mod 123.09beta01 and newer, has preliminary and on-going developmental LXD support if LXD containers are properly configure at LXD host node level first. But it's still a work in progress. See comment here & some of the LXD config issues LXD web host providers need to be aware of for CentOS here. If you're using and configuring your own server with LXD containers, then you'd need to properly configure LXD at LXD host level. For least problems, use KVM VPSes instead.
  5. Tip #3: For best performance and latest feature improvements, ensure you're using PHP 7.4+, 8.0+ or 8.1+ provided your web app supports the versions. See PHP 7.4 vs 7.3 vs 7.2 vs 7.1 vs 7.0 benchmarks here and PHP 8.0 JIT vs 8.0 vs 7.4 vs 7.3 vs 7.2 vs 7.1 vs 7.0 benchmarks here.
  6. Currently, only x86/x86_64 architecture is supported and ARMv7/8 based cpus isn't supported fully due to CentOS ARM compatibility with 3rd party YUM repositories that Centmin Mod uses. Hopefully, in future it maybe so keep an eye on Centmin Mod Community Forum's Beta Release forums for any updates.
  7. For disk partitioning it's recommended to have one large single root / partition. Especially for CentOS 7.x.. If you plan to use Docker, pay attention to default file system used EXT4 versus XFS when formatting partitions (on dedicated servers). Details here.
  8. Optimally, for KVM/Xen/VMWare or dedicated you should configure your server with at least 1GB to 2GB swap space if possible. This does not apply to OpenVZ VPS where you may not have control over swap depending on how OpenVZ is configured.
  9. Choose non-OpenVZ based VPS server i.e. dedicated, KVM, Xen or VMWare if you want to be able to tune TCP settings (sysctl.conf), update and use own Linux Kernels. You are not able to do those tasks with OpenVZ VPSes.
  10. Minimum system requirements are 1GB memory for CentOS 7.x 64bit and 20GB disk space for OpenVZ VPS virtualization & 30GB for KVM and Xen virtualisation. These requirements were recently revised here.
  11. Recommended memory & disk requirements are double the mininum for CentOS 7.x 64bit at 2GB memory and disk space of 40GB for OpenVZ and 60GB for KVM/Xen virtualisation.
  12. If you plan on using PHP Composer for your web applications, you will want to have at least 3-4GB of memory on your server as Composer can use up to 1.5+ GB memory requirements itself and may require you raising the PHP memory_limit up to 1.5GB or more
  13. After install, check out the next steps in the Getting Started Guide and be sure to read how to update Centmin Mod code itself via Centmin Mod Upgrade page.
  14. If you're looking for cheap VPS hosting for Centmin Mod, the following are highly recommended & proven to work with Centmin Mod LEMP web stack - Upcloud - signees also get US$25 credits to use as well, BuyVM.net KVM Slices, RamNode, Linode, DigitalOcean and Vultr. If using OVH or SoYouStart servers, make sure to use CentOS OS template with distro kernels and not OVH/SYS provided custom kernels.
  15. Check out Centmin Mod VPS hosting & Centmin Mod Dedicated server hosting forums for VPS and dedicated hosting reviews, benchmarks and discussions with other Centmin Mod users.
  16. The Configuration Files page outlines all the Centmin Mod LEMP stack environments' configuration files and their paths.
  17. After initial install, you can invoke the centmin.sh menu as outlined at here.

If you find Centmin Mod useful, please consider a donation or a community forum Premium Membership

Support Centmin Mod Donate

Quick Curl Installer

The curl installer method was added from Centmin Mod 1.2.3-eva2000.08+ onwards and is the easiest way to install Centmin Mod which allows for fully unattended installs. It is the preferred method of installation as opposed to centmin.sh menu option 1 method. It's just one line you type in SSH session as root user on a fresh virgin CentOS 6 or CentOS 7 OS environment. Resource video also has an example install at Centmin Mod .08 beta SSH one liner install on CentOS 6 + CentOS 7 simultaneously.

Stable Release

Centmin Mod Stable Release Install: 124.00stable (released May 8th, 2022 and is based off of the work from 123.09beta01 branch with max PHP 8.1 branch supported. For PHP 8.2, use 130.00beta01 or newer listed below)

default PHP 7.4 installation

yum -y update; curl -O https://centmin.com/installer.sh && chmod 0700 installer.sh && bash installer.sh

default PHP 8.0 installation

yum -y update; curl -O https://centmin.com/installer80.sh && chmod 0700 installer80.sh && bash installer80.sh

default PHP 8.1 installation

yum -y update; curl -O https://centmin.com/installer81.sh && chmod 0700 installer81.sh && bash installer81.sh

Beta Release

Centmin Mod Latest Beta Release Install: 130.00beta01

If you want to try new and much improved latest Centmin Mod beta, you can switch to using the betainstaller.sh one liner below. There's a separate beta installer for public beta testing AlmaLinux & Rocky Linux EL8+ support as well.

The beta installer has a choice of which version of PHP you want to default to on initial install. The PHP default options are below:

default PHP 7.4 beta installer

yum -y update; curl -O https://centmin.com/betainstaller.sh && chmod 0700 betainstaller.sh && bash betainstaller.sh

PHP 7.0.x default beta installer

yum -y update; curl -O https://centmin.com/betainstaller7.sh && chmod 0700 betainstaller7.sh && bash betainstaller7.sh

PHP 7.1.x default beta installer

yum -y update; curl -O https://centmin.com/betainstaller71.sh && chmod 0700 betainstaller71.sh && bash betainstaller71.sh

PHP 7.2.x default beta installer

yum -y update; curl -O https://centmin.com/betainstaller72.sh && chmod 0700 betainstaller72.sh && bash betainstaller72.sh

PHP 7.3.x default beta installer. See PHP 7.3 release information and PHP 7.3 vs 7.2 vs 7.1 vs 7.0 benchmarks.

yum -y update; curl -O https://centmin.com/betainstaller73.sh && chmod 0700 betainstaller73.sh && bash betainstaller73.sh

PHP 7.4.x default beta installer. See 7.4 vs 7.3 vs 7.2 vs 7.1 vs 7.0 benchmarks.

yum -y update; curl -O https://centmin.com/betainstaller74.sh && chmod 0700 betainstaller74.sh && bash betainstaller74.sh

PHP 8.0.x default beta installer. See PHP 8.0 GA release & benchmarks.

yum -y update; curl -O https://centmin.com/betainstaller80.sh && chmod 0700 betainstaller80.sh && bash betainstaller80.sh

PHP 8.1.x default beta installer. See 8.1.0 vs 8.0.13 vs 7.4.26 vs 7.3.33 vs 7.2.34 benchmarks.

yum -y update; curl -O https://centmin.com/betainstaller81.sh && chmod 0700 betainstaller81.sh && bash betainstaller81.sh

PHP 8.2.x default beta installer.

yum -y update; curl -O https://centmin.com/betainstaller82.sh && chmod 0700 betainstaller82.sh && bash betainstaller82.sh

Once install completes, you'll have some basic info including mysql root password, memcached password and a post-install check list of major software installed's version numbers and also some install time stats.

Total Curl Installer YUM Time: 92.0033 seconds
Total YUM Time: 43.166100082 seconds
Total YUM + Source Download Time: 58.0522
Total Nginx First Time Install Time: 135.9561
Total PHP First Time Install Time: 130.5067
Download Zip From Github Time: 4.1942
Total Time Other eg. source compiles: 206.9870
Total Centmin Mod Install Time: 531.5020
Total Install Time (curl yum + cm install + zip download): 627.6995 seconds

You can also find this info later on in Centmin Mod logs directory at /root/centminlogs. Every centmin.sh menu run has a log created and is time stamped for easier reference. For example listing in reverse time ascending order (most recent last).

ls -lAhrt /root/centminlogs/
total 4.0M
-rw-r--r-- 1 root root  19K Jun 16 05:31 centminmod_1.2.3-eva2000.08_160615-012722_yuminstall_centos6.log
-rw-r--r-- 1 root root  71K Jun 16 05:32 centminmod_yumtimes_160615-012722.log
-rw-r--r-- 1 root root   38 Jun 16 05:32 centminmod_profiletimes_160615-012722.log
-rw-r--r-- 1 root root 251K Jun 16 05:32 centminmod_downloadtimes_160615-012722.log
-rw-r--r-- 1 root root  199 Jun 16 05:32 securedtmp.log
-rw-r--r-- 1 root root   44 Jun 16 05:34 centminmod_libresslinstalltime_160615-012722.log
-rw-r--r-- 1 root root 1.2K Jun 16 05:34 gcc_native.log
-rw-r--r-- 1 root root 959K Jun 16 05:35 centminmod_ngxinstalltime_160615-012722.log
-rw-r--r-- 1 root root   58 Jun 16 05:38 centminmod_phpinstalltime_160615-012722.log
-rw-r--r-- 1 root root  21K Jun 16 05:41 centminmod_1.2.3-eva2000.08_160615-012722_yum-log.log
-rw-r--r-- 1 root root   20 Jun 16 05:41 install.utc.time.log
-rw-r--r-- 1 root root 2.7M Jun 16 05:41 centminmod_1.2.3-eva2000.08_160615-012722_install.log

Getting Started Guide

Read, bookmark and regularly check back with the Getting Started Guide. Also read the How to troubleshoot Centmin Mod initial install issues guide. Reading Getting Started Guide is the most important thing you can do after Centmin Mod install as it gives you a good understanding and starting point to everything else - including adding Nginx vhost/domains (centmin.sh option 2), upgrade/downgrade/recompiling Nginx (centmin.sh menu option 4), PHP (menu option 5) etc.

Log out of SSH and log back into SSH and run centmin.sh command to invoke the menu options. You can find the resource video for finding centmin.sh at How to find and run centmin.sh menu options for Centmin Mod LEMP stack based servers

     Centmin Mod Menu 124.00stable centminmod.com     
1).  Centmin Install
2).  Add Nginx vhost domain
3).  NSD setup domain name DNS
4).  Nginx Upgrade / Downgrade
5).  PHP Upgrade / Downgrade
6).  XCache Re-install
7).  APC Cache Re-install
8).  XCache Install
9).  APC Cache Install
10). Memcached Server Re-install
11). MariaDB MySQL Upgrade & Management
12). Zend OpCache Install/Re-install
13). Install/Reinstall Redis PHP Extension
14). SELinux disable
15). Install/Reinstall ImagicK PHP Extension
16). Change SSHD Port Number
17). Multi-thread compression: zstd,pigz,pbzip2,lbzip2
18). Suhosin PHP Extension install
19). Install FFMPEG and FFMPEG PHP Extension
20). NSD Install/Re-Install
21). Data Transfer (TBA)
22). Add Wordpress Nginx vhost + Cache Plugin
23). Update Centmin Mod Code Base
24). Exit
Enter option [ 1 - 24 ] 

Check out how to setup centmin.sh menu option 23, submenu option 1 so you can setup git environment for easier Centmin Mod LEMP script code updates Beta Branch - New .08 beta menu option - updating Centmin Mod via git. You can also setup a cronjob to auto update too see Beta Branch - Cronjob Auto Updating Centmin Mod .08 beta03 How To Guide

centmin.sh option 23 submenu options

        Centmin Mod Updater Sub-Menu      
1). Setup Centmin Mod Github Environment
2). Update Centmin Mod Current Branch
3). Update Centmin Mod Newer Branch
4). Back to Main menu
Enter option [ 1 - 4 ]

Once git environment setup, hit submenu option 4 to go back to main menu, hit menu option 24 to exit centmin.sh. Then log out of SSH and back in to complete setup.