LEMP¶
In this article
Attention
LEMP is an open-source web development technology stack that includes the Linux operating system, the NGINX web server (pronounced "engine-x"), MySQL database, and the PHP scripting language.
- Linux provides hosting and server management.
- NGINX acts as a high-performance web server and proxy server.
- MySQL is a relational database for storing and processing data.
- PHP is a programming language used for creating dynamic web applications.
LEMP: Core Features¶
- Containerized Solution: The LEMP stack is available both in classic deployment and as a containerized solution. A Docker container provides isolation for components and their dependencies, creating an identical environment for development and production.
- High Performance: NGINX's event-driven architecture allows it to effectively handle thousands of concurrent connections. Optimized PHP execution through FastCGI ensures fast processing of dynamic content, and advanced caching of static files reduces server load.
- Flexible Configuration: LEMP offers the ability to configure each component. NGINX supports complex routing schemes, load balancing, and caching. MySQL allows fine-tuning performance and security parameters. PHP can be configured for specific application needs with the option to include necessary extensions and optimize memory usage.
- Multifunctionality: PHP 8.3 comes with a set of features for modern web development. It supports working with various data formats, encryption, and network protocols. MySQL provides reliable data storage with support for transactions, complex queries, and replication. NGINX offers advanced capabilities for routing requests, terminating SSL, and handling media content.
- Security: LEMP includes a multi-layered security system. NGINX protects against DDoS attacks and other web threats. MySQL provides flexible user permission management and data encryption. PHP is configured with modern security requirements in mind. Containerization provides an additional level of isolation, preventing vulnerabilities in one component from affecting others.
- Scalability: The LEMP architecture allows for efficient scaling of applications. NGINX supports load distribution across multiple servers. MySQL provides data replication and sharding for large datasets. PHP-FPM allows precise control over the number of worker processes. Containerization simplifies deploying additional application instances as load increases.
- Ease of Updates: Updating LEMP components can be done independently. NGINX and PHP support updates without interrupting service operation. MySQL provides tools for safe database updates. With containers, it's possible to test updates in an isolated environment before applying them to production.
Deployment Features¶
ID | Compatible OS | VM | BM | VGPU | GPU | Min CPU (Cores) | Min RAM (Gb) | Min HDD/SDD (Gb) | Active |
---|---|---|---|---|---|---|---|---|---|
21 | Ubuntu 22.04 | + | + | + | + | 1 | 1 | - | Yes |
The stack is deployed within a Docker container using the adhocore/lemp:8.3 image. The following directories are used for data storage:
- /root/data for database files;
- /root/webroot for website files.
Note
To work with MySQL, you need to connect through the Docker container, as the MySQL client is not installed on the host system. Use the following command:
Note
Unless otherwise specified, by default we install the latest release version of software from the developer's website or the operating system's repositories.
Getting started after deploying LEMP¶
Once your order is paid, you'll receive an email notification to the address you provided during registration, informing you that your server is ready for use. This email will include your VPS IP address, login, and password for connecting.
Our company clients manage their equipment through the server control panel and API — Invapi. You can find the server's IP address in the "Network" tab. A detailed guide on managing network settings is available here.
-
Login and Password for connecting to the server via SSH: provided in the email notification sent to your registered email address once the server is ready after software deployment. The password for connecting to the database is the same as the SSH server connection password.
-
NGINX:
- The web server is accessible on port 88
- Web content is placed in the
/root/webroot
directory. To host a website, copy your files into this directory. - To test the server's operation, create a test file:
- Access:
http://<your_server_IP>:88/test.html
-
MySQL:
- The database is accessible on port 3306
- Data is stored in
/root/data
- The root password matches the SSH access password for the server.
- To connect, use:
-
PHP 8.3:
- Installed in the container with all necessary extensions
- Works through FastCGI for increased performance.
- To check PHP's functionality, create an info.php file in the
/root/webroot
directory:
-
Ports:
- 88: Web (NGINX)
- 3306: MySQL
- 5432: PostgreSQL
Note
All commands for working with the database must be executed through the Docker container using the docker exec
command. The container operates within a dedicated network, lemp-net, to enhance isolation and security.
Note
Detailed information on working with the database can be found in the developer documentation.
Ordering a server with LEMP using the API¶
To install this software using the API, follow these instructions
Some of the content on this page was created or translated using AI.