Back to Browse

Build and Run Your First NGINX Web Server with Docker - Step by Step Tutorial

257 views
Oct 31, 2025
13:09

πŸš€ Learn how to build, run, and test a complete NGINX web server using Docker β€” all in just a few minutes! No installation, no complex setup β€” just pure hands-on Docker magic! If you’re new to Docker or DevOps, this video is the perfect quick start guide to help you understand how containers really work. πŸ•’ Timestamps 00:00 – Introduction: Run a full web server with just a few Docker commands 00:18 – Install Docker on Ubuntu 00:44 – Pull the official NGINX image 01:24 – Check existing images 01:50 – Run your first NGINX container 03:20 – Create and copy a custom HTML page 04:10 – Access and test the NGINX container 06:18 – Build a custom Docker image with Dockerfile 08:18 – Tag your custom image version 09:41 – Run a new container from the custom image 10:10 – Test your Dockerized web server 11:00 – Clean up containers and environment 12:03 – Final thoughts & closing CTA πŸ’» Commands Used in This Video (Copy & Paste) # Install Docker on Ubuntu sudo apt update -y sudo apt install -y docker.io sudo systemctl enable docker sudo systemctl start docker # Check Docker version docker version # Pull the latest NGINX image sudo docker pull nginx:latest # List all Docker images docker images ls # Run NGINX container docker run --name nginx-container -d nginx:latest # Check running containers docker container ls # Create and copy a custom web page echo "Welcome to My Custom NGINX Server Page" and save it as index.html. docker cp index.html nginx-container:/usr/share/nginx/html/index.html #Access the Nginx container’s shell: docker exec -it nginx-container /bin/bash # Test NGINX web page curl http://localhost:80 # Create Dockerfile: nano Dockerfile FROM nginx:latest COPY index.html /usr/share/nginx/html/index.html EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] EOF # Build and tag a custom image docker build -t nginx_app . docker tag nginx_app nginx_app:ver1 # Run a container from the custom image docker run -d --name nginx_container_1 -p 8080:80 nginx_app:ver1 # Test on port 8080 curl http://localhost:8080 # Clean up containers docker container stop nginx-container docker container rm nginx-container docker container stop nginx_container_1 docker container rm nginx_container_1 πŸ”— Related Articles & Resources: πŸ“˜ Blog guide: https://bit.ly/3X3b2r4 πŸ“— My website: https://luuhophuong.com - The Fastest Way to Manage Docker Containers (Real DevOps Walkthrough): https://youtu.be/QlESXQ-P5yI - Docker Tutorial: How to Create Docker Registry: https://youtu.be/EQT3o1qkuTo 🐳 Why Containers Can’t Ping Each Other – Docker Networking Deep Dive: https://youtu.be/9Iojgv9Heyo 🐳How to Containerize a Node js App with Docker-Step by Step Guide: https://youtu.be/qa2r9xac8U0 🐳 How to Install Docker and Launch Nginx on Ubuntu 24.04: https://youtu.be/IAiKHPmnml πŸ’¬ Connect with Me If you found this tutorial helpful, don’t forget to: πŸ‘ Like the video πŸ”” Subscribe to the channel πŸ’¬ Comment what Docker or DevOps topic you want me to cover next! 🎯 I’m Phuong, and my mission is to help you master technology faster, smarter, and more practically. See you in the next video! πŸ’ͺπŸ”₯ #Docker #NGINX #DevOps #Ubuntu #Linux #DockerTutorial #DockerForBeginners #DockerFile #Containerization #CloudComputing #PhuongTech

Download

0 formats

No download links available.

Build and Run Your First NGINX Web Server with Docker - Step by Step Tutorial | NatokHD