Skip to content
Edi Septriyanto edited this page Jul 24, 2021 · 10 revisions

Installing LEMPer Stack

LEMP/LNMP is an open-source web application stack used to develop web applications. The term LEMP/LNMP is an acronym that represents L for the GNU/Linux operating system, Nginx (pronounced as engine-x, hence the E in the acronym) web server, M for MariaDB/MySQL database, and P for PHP scripting language.

Every component of the LEMP/LNMP stack communicates with each other and required to install and run correctly. Meanwhile, installing each component manually is time-consuming and error-prone.

One of the easiest ways to install LEMP/LNMP Stack is to use an automatic installer such as LEMPer Stack. Follow this step by step guide to install LEMPer Stack on your machine.

Clone or Download the LEMPer Stack Repository

Before you start, you need to clone the LEMPer Stack repository. To do this, open a terminal and run the following command:

git clone https://github.com/joglomedia/LEMPer.git

If you are not familiar with Git or doesn't have Git installed, you can download the repository as a zip file from the releases page. We recommend that you download the zip file from the latest version, then extract it to a directory on your machine.

mkdir -p /path/to/directory
cd /path/to/directory
wget -O lemper-stack.tar.gz https://github.com/joglomedia/LEMPer/archive/refs/tags/v3.1.0.tar.gz
tar -xvf lemper-stack.tar.gz

After those operations, you should have a directory named LEMPer-v3.1.0 in your current directory. The version number of the LEMPer Stack is v3.1.0, its number depend on the version of the LEMPer Stack that you have downloaded. Now, cd to the LEMPer-v3.1.0 directory.

cd LEMPer-v3.1.0

Configure the LEMPer Stack Installation

Next, make change to the LEMPer Stack installation configuration by running the following command:

cp .env.dist .env

Edit the .env file with your favorite editor. The .env file contains the configuration parameters for LEMPer Stack.

vim .env

Adjust all the parameters to your needs.

Environment Variables

The .env file contains environment variables used during installation. Each of environment variables are grouped in a section. The section names represents the software stack names.

Installer Variables [installer]

  • AUTO_INSTALL - If this is set to true, the LEMPer Stack will automatically install the software stack in unattended installation mode, otherwise you will be prompted to install the software stack in interactive mode. The valid value is true or false, and the default value is false.
  • AUTO_REMOVE - If this is set to true, the LEMPer Stack will automatically remove existing software stack during installation and in unattended uninstallation mode, otherwise you will be prompted to uninstall or keep the existing software. The valid value is true or false, and the default value is false.
  • FORCE_REMOVE - If this is set to true, the LEMPer Stack will completely remove all files and configs related to uninstalled existing software stack during installation and in unattended uninstallation mode, otherwise you will be prompted to remove or keep them. The valid value is true or false, and the default value is false.
  • ENABLE_SWAP - If this is set to true, the LEMPer Stack will enable swap space on the server. The valid value is true or false, and the default value is true.
  • DEBUG - If this is set to true, the LEMPer Stack will output debug information during installation. The valid value is true or false, and the default value is false.
  • LOGGING - If this is set to true, the LEMPer Stack will output log information during installation to log file. The valid value is true or false, and the default value is true.
  • LOG_FILE - The path to the log file. The default value is /var/log/lemper-stack.log.
  • BUILD_DIR - The path to the directory where the software stack will be built during installation. The default value is /usr/local/src/lemper. This build directory will be deleted after installation.
  • DRY_RUN - If this is set to true, the LEMPer Stack will not actually install or uninstall software stack, but will show the installation or uninstallation process. The valid value is true or false, and the default value is false.

LEMPer Stack Variables [lemper]

  • ENVIRONMENT - This is the name of the environment that you want to install. The valid values are development and production, the default value is development. The development environment is used for development purposes, while production environment is used for production purposes.
  • SERVER_HOSTNAME - The hostname of the server that you want to install. The default value is localhost. In production environment, server hostname must be valid FQDN format (e.g. localhost.localdomain or hostname.example.com).
  • SERVER_IP - The IP address of the server that you want to install. The default value is 127.0.0.1.
  • TIMEZONE - The timezone of the server that you want to install. The default value is UTC. For detailed timezon format reference, please refer to timezone database.
  • LEMPER_USERNAME - The default username used by LEMPer Stack. The default value is lemper. This username will be created if it doesn't exist.
  • LEMPER_PASSWORD - The password used by LEMPer Stack user. If not set (empty), the password will be created automatically during installation process.
  • LEMPER_ADMIN_EMAIL - The email address of the LEMPer Stack admin. You must set the value to valid email address. It is used for Let's Encrypt certificates and email notifications.

SSH Variables [ssh]

  • SSH_PORT - The port number of the SSH server. For security reasons, avoid using default SSH port 22. The default LEMPer Stack ssh port is 2269 and it is recommended that you change it to a different port number. If your server instance behind firewalls, you must allow inbound connections on the firewall to the SSH port.
  • SSH_ALLOW_ROOT_LOGIN - If this is set to true, the LEMPer Stack will allow SSH login with root user. To prevent brute-force SSH attacks that targeting root account, by default the value is set to false.
  • SSH_PASSWORDLESS_LOGIN - If this is set to true, the LEMPer Stack will allow SSH login without password. SSH passwordless login requires public-private key pairs generated from ssh-keygen.
  • RSA_PUB_KEY - The strings value of the RSA public key file generated from ssh_keygen. Follow this tutorial SSH Passwordless Login Using SSH Keygen Authentication to setup public-private key pairs.
  • RSA_HASH_LENGTH - The length of the hash value of the RSA public key. The valid value is 2048 or 4096, and the default value is 2048.

For further reading:

  • [https://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/]
  • [https://www.ssh.com/academy/ssh/copy-id]

Ngin Variables [nginx]

PHP Variables [php]

MySQL/MariaDB Variables [mysql]

Memcahed Variables [memcached]

MongoDB Variables [mongodb]

Redis Variables [redis]

DNS Variables [dns]

Not implemented yet.

Mail Variables [mail]

Certbot Variables [certbot]

Firewall Variables [firewall]

Fail2Ban Variables [fail2ban]

Clone this wiki locally