Welcome to Do LEEEEE :))

Deploy a Website on Ubuntu VM

Why Does This Website Exist?

This website is designed to demonstrate the deployment of a simple server, tracing back to the classic era of web development. The goal is to help you understand how everything works at its most fundamental level— the foundation upon which more advanced systems can be built.

Understand what you do and do what you are passionate about.

1. Create a Virtual Machine

Create a VM using any cloud provider (AWS, GCP, Azure, etc.) with:

2. Connect & Update System

ssh your_username@YOUR_PUBLIC_IP
sudo apt update && sudo apt upgrade -y

3. Install Nginx

What is nginx?
sudo apt install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx

Test by visiting: http://YOUR_PUBLIC_IP (Note: the website is only accessed via Public IP now)

4. Configure DNS

Go to your domain provider and create an A record:

Wait for DNS propagation. Test by:

nslookup yourdomain.com

5. Install Certbot (SSL)

What is certbot
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com

Follow prompts to complete SSL setup.

6. Configure Nginx

sudo nano /etc/nginx/sites-available/yourdomain
server {
    listen 80;
    server_name yourdomain.com www.yourdomain.com;

    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name yourdomain.com www.yourdomain.com;

    ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;

    root /var/www/html;
    index index.html;

    location / {
        try_files $uri $uri/ =404;
    }
}
sudo ln -s /etc/nginx/sites-available/yourdomain /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx

7. Done 🎉

Your website should now be live at: