Run Apache Web Server on Docker Linux

In this blog post, I will show you how to run an Apache web server inside a Docker container.

Apache Web Server is the #1 web server in the world and powers most of the web servers on the internet.

With Docker, we can deploy Apache without needing to configure it on our host machine.

Download image

To download the latest Apache web server container image, I will use the following command.

docker pull httpd

Deploy Container

To deploy a Docker container with Apache server I will use the following command.

The web server will be available on port 80.

docker run -d --name apache-web -p 80:80 httpd:latest

As you can see above the web server is working. To access it I need to browse the Docker host IP address using port 80.

If port 80 is used, you can use a different port like 8080. Use that port in the browser.


Posted

in

by