Script to install LEMP stack in Debian 9

by Daniel Pham
Published: Updated:

This article will give you a script to quickly install LEMP stack in Debian 9.

Test environment

The lab environment I use is a Linux machine with the following configuration, you can customize it according to your environment.

  1. OS: Debian GNU/Linux 9 (stretch) 64 bit.
  2. IP: 192.168.56.30.
  3. RAM: 1 GB.
  4. HDD: 10 GB.
  5. CPU: 1 vCPU.
  6. User: root.

LEMP version stack installed

This script will install the LEMP stack in Debian 9 with the following packages.

  • Nginx: 1.14.2 Stable.
  • MariaDB: Ver 15.1 Distrib 10.3.13-MariaDB.
  • PHP: 7.3.3-1+0~20190307202245.32+stretch~1.gbp32ebb2 (cli).

Recommended Reading: Script to install LEMP on Debian 8

Steps to use the script

First, download the script using the command below.

wget https://gitlab.com/Danny_Pham/WriteBash.com/raw/master/Install/10-Script_install_LEMP_PHP_7.3_on_Debian_9.sh -O install_lemp.sh

Next, you grant the script permission.

chmod 700 install_lemp.sh

And finally, you execute the script to install the LEMP stack.

./install_lemp.sh

Unlike installing LEMP in Ubuntu 16, when installing on Debian 9, it only requires you to set mysql root password. There is no requirement to select a geographic area …

Recommended Reading: Script to install LEMP stack in Ubuntu 16

Configuring mariadb-server-10.3
-------------------------------

While not mandatory, it is highly recommended that you set a password for the MariaDB administrative "root" user.

If this field is left blank, the password will not be changed.

New password for the MariaDB "root" user:

Installation will take about 10 minutes. After installation is complete, type the following commands to check the LEMP stack version.

install lemp stack in debian 9
Install LEMP stack in Debian 9.

Check Nginx.

nginx -v

Check MariaDB.

mysql -V

And check PHP.

php -v

Conclusion

Simple script but can save you some time. The source code is completely public, so you can view and edit it as you like.

(This is an article from my old blog that has been inactive for a long time, I don’t want to throw it away so I will keep it and hope it helps someone).

0 0 votes
Article Rating

You may also like

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

DevOps Lite is a personal blog specializing in technology with main topics about DevOps, DevSecOps, SRE and System Administrator. Articles are shared for free and contributed to the community.

SUPPORT US

FOLLOW US

Subscribe my Newsletter for new blog posts. Stay updated from your inbox!

© 2021-2024 DevOpsLite.com – All rights reserved.

Please write sources “DevOpsLite.com” when using articles from this website.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

0
Would love your thoughts, please comment.x
()
x

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.