{"slug": "i-deployed-netflix-s-web-server-in-30-seconds-and-so-can-you-docker-project-1", "title": "I Deployed Netflix's Web Server in 30 Seconds (And So Can You) - Docker Project 1", "summary": "This article is a tutorial from a \"Docker Zero to Hero\" series that guides readers through deploying an Nginx web server inside a Docker container. It demonstrates how to run a container in seconds, customize the HTML page, and use volume mounts to ensure data persists even after the container is deleted or crashes. The tutorial emphasizes project-based learning and explains key Docker concepts like port mapping, container ephemerality, and persistent storage.", "body_md": "Introduction\nWhat You Will Build Today\nBy the end of this tutorial, you will have:\nA live web server running inside Docker\nYour custom HTML page served from a container\nA persistent website that survives container death\nScreenshots proving every step works\nTime required: 20 minutes\nPrerequisites: Docker installed (I will show you how to check)\nWhy Project-Based Learning\nWhen I started learning Docker, I watched hours of videos and forgot everything. Then I switched to building real projects. This is Project 1 of 6 in my \"Docker Zero to Hero\" series.\nLet me show you what I built, step by step.\nSection 1: Verifying Docker\nStep 1: Is Docker Alive?\nFirst, I opened my terminal (PowerShell on Windows with WSL2 enabled).\ncommand: docker --version\ndocker ps\nThe docker ps command showed an empty table - that is normal. No containers running yet.\nWhat I learned: docker ps only shows RUNNING containers. Use docker ps -a to see all containers including stopped ones.\nSection 2: Running Your First Container\nStep 2: The 5-Second Web Server\nHere is where the magic happened. I ran one command and got a production-grade web server.\nCommand:\ndocker run -d --name my-first-website -p 8080:80 nginx\nBreaking down what this means:\nCommand part What it does\ndocker run Create and start a container\n-d Run in background (detached mode)\n--name my-first-website Give it a friendly name\n-p 8080:80 Map my computer's port 8080 to container's port 80\nnginx The image name (web server used by Netflix)\nI got back a long container ID - that is proof it worked.\nMy container appeared in the list with status \"Up\".\nSection 3: Seeing It in the Browser\nStep 3: Opening Your Website\nI opened my browser (Chrome) and went to:\nhttp://localhost:8080\n\"Welcome to nginx!\" appeared.\nIn 5 seconds, I deployed the same web server that runs Netflix, Airbnb, and Uber.\nMy reaction: This is insane. No Apache setup. No Nginx installation. No dependency hell.\nWhat I learned: Containers package the application AND its dependencies together. That is why it \"just works.\"\nSection 4: Making It Your Website\nStep 4: Modifying the Website\nA default \"Welcome to nginx\" page is useless for real work. Let me change it to a maintenance page my boss would actually use.\nFirst, I created my own HTML file:\necho \"\nBack at 9am.\n\" > index.htmlThen I copied it into the running container:\ndocker cp index.html my-first-website:/usr/share/nginx/html/index.html\nRefreshed my browser:\nWhat I learned: docker cp works like regular cp - but it copies files INTO a running container. The path /usr/share/nginx/html/ is where nginx looks for web files\nStep 5: Simulating a Crash\nHere is where I learned the most important lesson about containers.\nI stopped and removed my container:\ndocker stop my-first-website\ndocker rm my-first-website\nChecked if it was gone:\ndocker ps -a\nRefreshed my browser:\nThe page was dead. My custom HTML was gone forever.\nWhy? Containers are ephemeral - when they die, everything inside them dies too.\nThe problem: If I deployed a real app this way, a simple restart would wipe all my data. That is unacceptable for production.\nSection 6: Fixing It with Volumes (Production Solution)\nStep 6: Persistent Storage with Volumes\nThe solution is volume mounts - share a folder from MY computer with the container.\nI created a dedicated project folder:\nmkdir docker-project-1 && cd docker-project-1\nCreated a new HTML file:\necho \"\nThis survives container death.\n\" > index.htmlRan the container with a volume mount (-v):\ndocker run -d --name persistent-site -p 8080:80 -v \"$(pwd):/usr/share/nginx/html\" nginx\nWhat -v \"$(pwd):/usr/share/nginx/html\" means:\nPart Meaning\n-v Volume mount flag\n\"$(pwd)\" My current folder on my computer\n: Separator\n/usr/share/nginx/html Folder inside the container\nTranslation: \"Docker, mirror my computer's folder inside the container. When I change files on my computer, change them in the container too.\"\nRefreshed my browser:\nNow for the real test. I deleted the container again:\ndocker stop persistent-site && docker rm persistent-site\nRan the SAME command again:\ndocker run -d --name persistent-site -p 8080:80 -v \"$(pwd):/usr/share/nginx/html\" nginx\nRefreshed my browser:\nIT STILL WORKED.\nWhat I learned:\nWithout volumes: Data dies with container\nWith volumes: Data lives on your computer, containers just read it\nThis is how databases, file uploads, and user data survive restarts in production", "url": "https://wpnews.pro/news/i-deployed-netflix-s-web-server-in-30-seconds-and-so-can-you-docker-project-1", "canonical_source": "https://dev.to/peter_samuel_052b9056e236/i-deployed-netflixs-web-server-in-30-seconds-and-so-can-you-docker-project-1-ha1", "published_at": "2026-05-23 09:16:28+00:00", "updated_at": "2026-05-23 09:31:47.261854+00:00", "lang": "en", "topics": ["developer-tools", "cloud-computing", "open-source"], "entities": ["Netflix", "Docker", "PowerShell", "WSL2", "Windows", "Nginx"], "alternates": {"html": "https://wpnews.pro/news/i-deployed-netflix-s-web-server-in-30-seconds-and-so-can-you-docker-project-1", "markdown": "https://wpnews.pro/news/i-deployed-netflix-s-web-server-in-30-seconds-and-so-can-you-docker-project-1.md", "text": "https://wpnews.pro/news/i-deployed-netflix-s-web-server-in-30-seconds-and-so-can-you-docker-project-1.txt", "jsonld": "https://wpnews.pro/news/i-deployed-netflix-s-web-server-in-30-seconds-and-so-can-you-docker-project-1.jsonld"}}