Skip to content
LEMP stack/LAMP stack/LNMP stack installation scripts for CentOS/Redhat Debian and Ubuntu
Shell HTML Other
Branch: master
Clone or download

PayPal donate button 支付宝捐助按钮 微信捐助按钮

This script is written using the shell, in order to quickly deploy LEMP/LAMP/LNMP/LNMPA/LTMP(Linux, Nginx/Tengine/OpenResty, MySQL in a production environment/MariaDB/Percona, PHP, JAVA), applicable to CentOS 6 ~ 8(including redhat), Debian 8 ~ 10, Ubuntu 14 ~ 19, Fedora 27+ of 32 and 64.

Script properties:

  • Continually updated, Provide Shell Interaction and Autoinstall
  • Source compiler installation, most stable source is the latest version, and download from the official site
  • Some security optimization
  • Providing a plurality of database versions (MySQL-8.0, MySQL-5.7, MySQL-5.6, MySQL-5.5, MariaDB-10.4, MariaDB-10.3, MariaDB-10.2, MariaDB-5.5, Percona-8.0, Percona-5.7, Percona-5.6, Percona-5.5, AliSQL-5.6, PostgreSQL, MongoDB)
  • Providing multiple PHP versions (PHP-7.4, PHP-7.3, PHP-7.2, PHP-7.1, PHP-7.0, PHP-5.6, PHP-5.5, PHP-5.4, PHP-5.3)
  • Provide Nginx, Tengine, OpenResty and ngx_lua_waf
  • Providing a plurality of Apache version (Apache-2.4, Apache-2.2)
  • According to their needs to install PHP Cache Accelerator provides ZendOPcache, xcache, apcu, eAccelerator. And php extensions,include ZendGuardLoader,ionCube,SourceGuardian,imagick,gmagick,fileinfo,imap,ldap,phalcon,yaf,yar,redis,memcached,memcache,mongodb,swoole,xdebug
  • Installation Pureftpd, phpMyAdmin according to their needs
  • Install memcached, redis according to their needs
  • Jemalloc optimize MySQL, Nginx
  • Providing add a virtual host script, include Let's Encrypt SSL certificate
  • Provide Nginx/Tengine/OpenResty/Apache, MySQL/MariaDB/Percona, PHP, Redis, Memcached, phpMyAdmin upgrade script
  • Provide local,remote(rsync between servers),Aliyun OSS,Qcloud COS,UPYUN,QINIU,Amazon S3,Google Drive and Dropbox backup script
  • Provided under HHVM install CentOS 6,7


Install the dependencies for your distro, download the source and run the installation script.


yum -y install wget screen


apt-get -y install wget screen

Download Source and Install

tar xzf lnmp-full.tar.gz
cd lnmp

If you disconnect during installation, you can execute the command screen -r lnmp to reconnect to the install window

screen -S lnmp

If you need to modify the directory (installation, data storage, Nginx logs), modify options.conf file before running


How to install another PHP version

~/lnmp/ --mphp_ver 54

How to add Extensions


How to add a virtual host


How to delete a virtual host

~/lnmp/ --del

How to add FTP virtual user


How to backup

~/lnmp/    // Backup parameters 
~/lnmp/    // Perform the backup immediately 
crontab -l    // Can be added to scheduled tasks, such as automatic backups every day 1:00 
  0 1 * * * ~/lnmp/  > /dev/null 2>&1 &

How to manage service


service nginx {start|stop|status|restart|reload|configtest}


service mysqld {start|stop|restart|reload|status}


service postgresql {start|stop|restart|status}


service mongod {start|stop|status|restart|reload}


service php-fpm {start|stop|restart|reload|status}


systemctl {start|stop|status|restart} hhvm
service supervisord {start|stop|status|restart|reload}


service httpd {start|restart|stop}


service pureftpd {start|stop|restart|status}


service redis-server {start|stop|status|restart|reload}


service memcached {start|stop|status|restart|reload}

How to upgrade


How to uninstall



Follow the instructions in Wiki Installation page

For feedback, questions, and to follow the progress of the project:
Telegram Group

You can’t perform that action at this time.