Want to host a tiny website on your machine without building a custom image every five minutes like a chaotic chef rewriting the recipe? This guide walks through using the official Apache httpd Docker image with a bind mount so edits show up instantly in the browser. It is simple, fast, and wonky only when you forget which port you already used for a million apps.
By the end you will have a running Apache server inside a container that serves files from a host folder. Edit files locally and see changes live in the browser while you pretend this was effortless.
Make a folder for your site. Keep the document root shallow so Apache can find it and you can find your dignity.
mkdir site
printf "<h1>Hello from Docker Apache</h1>" > site/index.html
Use the official httpd image and bind mount your local site folder into Apache's document root. The command below maps host port 8080 to container port 80 and mounts ./site as the server root.
docker run -d -p 8080:80 -v $(pwd)/site:/usr/local/apache2/htdocs httpd
If you are on Windows use an absolute path for the volume. If you are on Linux and permission drama starts, try running the command with sudo or fix ownership on the host folder.
Visit http://localhost:8080 and admire your handiwork. If nothing appears first check that the container is running.
docker ps
Edit site/index.html with your editor of choice. Because the folder is mounted, Apache will serve the modified files instantly. No rebuild required. This keeps a fast dev feedback loop and fewer reasons to rage at Docker.
docker ps -a
docker logs <container id or name>
docker port <container id or name>
Bind mounts are perfect for development and live editing. If you need custom modules, configuration files in the image, or repeatable production builds then make a Dockerfile and bake them in. For quick testing and local hosting keep the mount and move fast.
If anything breaks remember this checklist in order: is the container running, is the port free, are your host file permissions sane, and did you name the folder correctly. If the problem persists try the logs before composing a dramatic tweet about Docker.
Now go edit index.html and reload the page. Live reload not included but highly encouraged via your editor or a live reload tool if you enjoy automation and fewer manual F5s.
I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!
This is a dedicated watch page for a single video.