Deploy LEMP Stack on AWS EC2 from Scratch! Nginx + MariaDB + PHP | CloudDost Project 01

Опубликовано: 05 Август 2026
на канале: CloudDost
69
3

Welcome to CloudDost — Learn Cloud with Friends!

In this video, I will show you how to deploy a complete LEMP Stack
application on AWS EC2 Free Tier, step by step from scratch.

We will install Nginx, MariaDB and PHP on a single EC2 instance,
create a simple PHP form that stores data into a MariaDB database,
and open it live in the browser using the EC2 Public IP.

This is a great beginner project if you are preparing for
cloud job interviews or just starting your AWS journey.


WHAT YOU WILL LEARN

In this video you will learn what LEMP Stack is and how each
component works together. You will see how to launch a free AWS
EC2 instance, connect to it using SSH, and install all the required
software. We will also create a simple HTML + PHP file that
connects to the database, and finally test the whole app live on the browser.


ALL COMMANDS USED IN THIS VIDEO

Step 1 — Connect to EC2
ssh -i your-key.pem ec2-user@your-public-ip

Step 2 — Install LEMP Stack
sudo yum install nginx mariadb105-server php php-fpm php-mysqlnd -y

Step 3 — Start all Services
sudo systemctl start nginx
sudo systemctl start mariadb
sudo systemctl start php-fpm

Step 4 — Enable Services on Boot
sudo systemctl enable nginx
sudo systemctl enable mariadb
sudo systemctl enable php-fpm

Step 5 — Login to MariaDB
sudo mysql -u root -p

Step 6 — Setup Database and Password
CREATE DATABASE database;
USE database;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'YourPassword123';

Step 7 — Go to Web Root Folder
cd /usr/share/nginx/html/

Step 8 — Create HTML Form File
sudo nano index.html

Step 9 — Create PHP Backend File
sudo nano submit.php

Step 10 — Restart Nginx
sudo systemctl restart nginx

Step 11 — Open in Browser
http://your-ec2-public-ip/index.html

Step 12 — Check Data in Database
sudo mysql -u root -p
USE database;
SELECT * FROM table-name;


SECURITY GROUP REMINDER

Before testing in browser, make sure these ports are open
in your EC2 Security Group settings.
Port 22 for SSH and Port 80 for HTTP.


TECH STACK USED

AWS EC2 t2.micro Free Tier
Amazon Linux 2
Nginx Web Server
MariaDB Database
PHP and PHP-FPM


If this video helped you, please like and subscribe.
New project every week on CloudDost.
Drop your questions in the comments — I reply to every one!


CloudDost — Learn Cloud with Aish
YouTube and Instagram — @CloudDost


#CloudDost #AWS #LEMPStack #Nginx #MariaDB #PHP #EC2
#AWSProjects #DevOps #CloudComputing #AWSFreeTier
#CloudForBeginners #AWSTutorials #LearnCloud #TechWithAish