LEMP Laravel is automation bash script to install LEMP Stack (Linux, Nginx, MySQL and PHP).
The script also install essential services that required by Laravel like redis cache and supervisord.
Tested on AWS EC2 Ubuntu 18.04 LTS and Ubuntu 20.04 LTS server.
New Update: LEMP Laravel script for Centos see README_CENTOS.md
Login as root
$ sudo su -Install essential tools
$ apt-get install screen wget curl vimCreate screen session
$ screenUse quick bash installer with default settings:
$ curl https://raw.githubusercontent.com/yasapurnama/lemp-laravel/master/lemp-laravel.sh | bash $ wget https://raw.githubusercontent.com/yasapurnama/lemp-laravel/master/lemp-laravel.sh
$ vim lemp-laravel.shHere are variables that you can change base on your need.
| Variables | Default | Note |
|---|---|---|
| PHP_VERSION | 8.5 | Find LTS support https://www.php.net/supported-versions.php |
| PHPMYADMIN_VERSION | 5.2.3 | Check latest version https://www.phpmyadmin.net/downloads/ |
| NVM_VERSION | v0.40.4 | Check latest version https://github.com/nvm-sh/nvm/releases |
| NODE_VERSION | v22.22.1 | Find LTS support https://nodejs.org/en/about/releases/ |
| NGINX_MAX_BODY_SIZE | 64M | Nginx max body size |
| PHP_MEMORY_LIMIT | 256M | PHP memory limit |
| PHP_UPLOAD_MAX_FILESIZE | 32M | PHP upload max file size |
| PHP_POST_MAX_SIZE | 32M | PHP post max size |
| PHP_MAX_EXECUTION_TIME | 300 | PHP max execution time (in seconds) |
| PHP_MAX_INPUT_TIME | 300 | PHP max input time (in seconds) |
| PHP_MAX_FILE_UPLOAD | 100 | PHP max file upload |
| FPM_MAX_CHILDREN | 20 | PHP FPM max children |
| FPM_START_SERVERS | 6 | PHP FPM start servers |
| FPM_MIN_SPARE_SERVERS | 4 | PHP FPM min spare servers |
| FPM_MAX_SPARE_SERVERS | 10 | PHP FPM max spare servers |
| FPM_MAX_REQUESTS | 500 | PHP FPM max requests |
| REDIS_MAX_MEMORY | 256mb | Redis max memory |
$ chmod +x lemp-laravel.sh
$ ./lemp-laravel.shIf there's Broken pipe in ssh connection you can continue the installation.
List screen sessions and find the session id (SID)
$ screen -lsRestore screen session
$ screen -r $SIDContributions are always welcome!
Licensed under the MIT License, see LICENSE for more information.
