If you’d like to test your website locally or ex­per­i­ment with custom-developed scripts before pub­lish­ing them, you’ll need a local test server. The free Apache HTTP Server allows you to quickly set up the Apache web server as a de­vel­op­ment en­vi­ron­ment on your Windows computer.

Free VPS Trial
Try a virtual server risk-free for 30 days

Try out your VPS for 30 days. If you're not satisfied, you get your money back.

Overview of the Apache HTTP Server

The Apache HTTP Server (often simply called “Apache”) is open-source, free web server software from the Apache Software Foun­da­tion. As a server-side service, it listens on port 80 by default and delivers HTML documents or other resources. Thanks to its modular design, ad­di­tion­al features such as SSL/TLS, URL rewriting, or scripting languages like PHP, Perl, or Python can be added as needed. Apache is part of various software bundles such as LAMP, MAMP, WAMP, or XAMPP, but it can also be run as a stand­alone component. For years, Apache has been one of the most popular web servers, and the community continues to develop the software. The current stable version is 2.4.66 (released on December 4, 2025).

Run the in­stal­la­tion

To run Apache on Windows, all you need is the ap­pro­pri­ate binary package for your operating system. Working binaries for Windows can be found on community sites such as Apache Lounge. These pre­com­piled Windows binaries are usually provided as ZIP archives. Download the latest version and verify its integrity (e.g., using a PGP signature) before you use it.

ZIP-based Windows packages can be used without a tra­di­tion­al in­stal­la­tion. In that case, proceed as follows:

  1. Save the software package as a ZIP file in any directory on your local Windows PC.
  2. Extract the ZIP file by double-clicking the folder icon.
  3. Select the “Apache24” folder and copy it to “C:\”.

All files you need to run your local Apache web server are now located under “C:\Apache24”.

Start a test run

After in­stalling Apache web server, it’s a good idea to run a test. To do so, navigate to “C:/Apache24” and open the “bin” folder. There you will find the “httpd” ap­pli­ca­tion. Double-click it to start your Apache web server.

Typically, your system will show two error messages. One in­di­cat­ing that certain software com­po­nents must be installed, and another stating that the Apache web server is being blocked by the operating system’s firewall.

The httpd.exe system error

If you install Apache web server on your Windows PC for the first time, your system will likely report that the web server can’t be started because the file “VCRUNTIME140.dll” was not found.

Image: System error message when starting the Apache web server
System error: the file VCRUNTIME140.dll was not found

You can resolve this issue by in­stalling the required software com­po­nents. Because Apache is developed in C++, it needs a com­pat­i­ble runtime en­vi­ron­ment on Windows. This runtime is supplied through Microsoft’s Visual C++ compiler package.

Missing runtime com­po­nents can be installed using the Visual C++ Re­dis­trib­utable Packages, which Microsoft provides for free. In­stal­la­tion is straight­for­ward and can be completed locally by simply double-clicking the .exe file.

Windows Security Alert

Your PC is typically protected by a firewall, which blocks unau­tho­rized network access from external programs. If you want to make your local Apache HTTP Server ac­ces­si­ble on a home or work network, you must ex­plic­it­ly allow Apache through the firewall. This can be done via the security alert shown below, which notifies you that certain functions of your web server have been blocked by the firewall.

Image: Windows security alert: Firewall is blocking program features
In the default con­fig­u­ra­tion, Windows Firewall blocks some functions of the web server

If you want to allow access to your server on one of the listed networks, check the ap­pro­pri­ate box and click the “Allow access” button. This action typically requires ad­min­is­tra­tor rights.

After in­stalling the runtime com­po­nents and allowing it through the firewall, start the web server again via the “httpd” file. A command-line window will open. Close this window to stop the Apache web server. Al­ter­na­tive­ly, Apache can be set up as a Windows service to run con­tin­u­ous­ly in the back­ground.

Image: Apache web server command-line window
Start the command-line window for your Apache web server by double-clicking the httpd file

To access your web server with any web browser, type “localhost” or the default IP address “127.0.0.1” into the search bar.

If all settings have been applied correctly, your web browser will display the default index.html page with the message: “It works!”. You can then move on to con­fig­ur­ing your web server.

Image: Opening the index.html file via localhost in the web browsermind­scan­nershut­ter­stock
Content of the sample index.html after the web server has been con­fig­ured correctly: It works!

Con­fig­ur­ing Apache HTTP Server

By default, the Apache HTTP Server software package is con­fig­ured to run without any ad­di­tion­al ad­just­ments. The content you want to make available through the web server is stored in the directory defined as “Doc­u­men­t­Root” in the httpd.conf con­fig­u­ra­tion file. By default, this is the “htdocs” folder located in “C:\Apache24”.

Image: The httpd.conf configuration file
In the httpd.conf con­fig­u­ra­tion file, C:\Apache24\htdocs is specified as “Doc­u­men­t­Root” and “Directory”

If you want to store your website’s documents and files in a different folder, you must update the httpd.conf file ac­cord­ing­ly by modifying the “Doc­u­men­t­Root” and “Directory” entries.

For demon­stra­tion purposes, we create a new folder called MyHomepage in C:\ to serve as the web directory for a fictional website. We then save two HTML files, test-1 and test-2, in this folder. Finally, we update the “Doc­u­men­t­Root” and “Directory” di­rec­tives in httpd.conf, replacing C:/Apache24/htdocs with C:/MyHomepage in both entries so that Apache uses the new website directory.

Image: Adjusting the “DocumentRoot” and “Directory” entries in the httpd.conf file
In the httpd.conf file, the default entries for “Doc­u­men­t­Root” and “Directory” are replaced by the newly created website directory

After restart­ing Apache, you can access the web server via localhost. The browser will then display the index of the new website directory, including the HTML files test-1.html and test-2.html.

Image: Index of the website directory with two HTML pages
To check whether your changes were applied correctly, access the index of your website directory via localhost after restart­ing the web server

Reviewers

Go to Main Menu