Build and Run Your First NGINX Web Server with Docker - Step by Step Tutorial
π 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 formatsNo download links available.