Installing a LEMP Stack on VDS (Ubuntu)

VDS / VPS Servers · 18.02.2025
Installing a LEMP Stack on VDS (Ubuntu)

Installing LEMP on Ubuntu 22.04

1. Nginx

apt install nginx -y
systemctl enable nginx
systemctl start nginx

2. MySQL

apt install mysql-server -y
mysql_secure_installation

3. PHP

apt install php8.2-fpm php8.2-mysql php8.2-curl php8.2-gd php8.2-mbstring -y

4. Configure Nginx for PHP

Edit /etc/nginx/sites-available/default:

location ~ \.php$ {
    fastcgi_pass unix:/run/php/php8.2-fpm.sock;
    include fastcgi_params;
}
← Back to Knowledge Base Ask Support