How to Install Apache in Windows 10

To install Apache on Windows 10, install the Microsoft Visual C++ Redistributable (x64), download the Apache 2.4 Win64 ZIP from Apache Lounge, and extract the Apache24 folder to C:\Apache24. Then open Command Prompt as administrator, go to C:\Apache24\bin, check the configuration with httpd -t, and install the Windows service with httpd -k install followed by httpd -k start. Open http://localhost in a browser: an It works! page means Apache is running.

Applies to: Apache HTTP Server 2.4 (the current stable branch; version 2.4.69 was released on October 1, 2026) on 64-bit Windows 10 version 22H2. The same steps work on Windows 11. Windows 10 reached end of support on October 14, 2025, so keep an Apache server on Windows 10 for local development and testing rather than public hosting.

Where Apache for Windows comes from

This is the part that confuses most people. The Apache HTTP Server Project only releases source code, and there’s no official installer on apache.org. The project’s Using Apache HTTP Server on Microsoft Windows page says you can either compile it yourself or get a binary package from a third-party distribution, and it names Apache Lounge (a plain ZIP of Apache) and WampServer (Apache bundled with PHP and a database). The official download page sends Windows users to that same list.

Apache Lounge is the usual choice for a standalone install, and it’s what this guide uses. If you mainly want a ready-made PHP and MySQL/MariaDB stack with a control panel, a bundle such as XAMPP or WampServer is quicker (see Which install route to choose).

If an older guide tells you to run an “official Apache installer,” skip that part: the project doesn’t publish Windows binaries or installers for current 2.4 releases, so the ZIP route below is the one to follow.

Before you start

  • 64-bit Windows 10. Check under Settings > System > About > System type. Download the Win64 build for a 64-bit system.
  • An administrator account. Installing and controlling the Apache service needs an elevated Command Prompt or PowerShell window.
  • Port 80 should be free. Apache listens on port 80 by default and can’t share it with another program. IIS, another web server, or a development tool may already be using it. You’ll check this during setup.
  • A plain text editor. Notepad is fine for editing httpd.conf. Don’t use Word or WordPad, which can add formatting.
  • Two terms to know. httpd is the Apache server program (httpd.exe). httpd.conf is its main configuration file. Lines that start with # are comments that Apache ignores, so “uncomment a line” means deleting the # at its start.

Install Apache on Windows 10 step by step

  1. Install the Visual C++ Redistributable. Current Apache Lounge builds are compiled with Visual Studio 2026 and need the latest Microsoft Visual C++ v14 Redistributable (the “Visual Studio 2017-2026” package). Get the x64 installer from Microsoft’s latest supported Visual C++ Redistributable downloads page, run it, and choose Install (or Repair if it’s already there). Without it, Apache stops with a missing VCRUNTIME140.dll error.
  2. Download Apache. Open the Apache Lounge download page and download the newest Apache 2.4 Win64 ZIP (its file name looks like httpd-2.4.xx-xxxxxx-Win64-VS18.zip). The page is busy, so make sure you click the ZIP link itself and not an ad. The page also publishes checksums and PGP signatures if you want to confirm the download is intact.
  3. Extract the Apache24 folder to C:\. Right-click the ZIP, choose Extract All, and open the extracted files. Copy the Apache24 folder to the root of drive C: so you end up with C:\Apache24\bin, C:\Apache24\conf, C:\Apache24\htdocs and so on. Don’t leave an extra layer such as C:\Apache24\Apache24.
File Explorer showing the extracted Apache24 folder at C:\Apache24 with bin, conf and htdocs folders
The folder portion of C:\Apache24 shows bin for programs, conf for configuration, and htdocs for website files. These eleven directories follow Apache’s Windows install layout; additional root files are outside this focused recreation.
  1. Point Apache at its folder (only if you didn’t use C:\Apache24). The bundled configuration expects C:\Apache24. If you chose another location, such as D:\Apache24, open conf\httpd.conf in Notepad, find the line Define SRVROOT "c:/Apache24" near the top, and change the path to match. Use forward slashes in Apache paths. The ServerRoot line below it reads that value, so you don’t need to edit it separately.
  2. Set the server name. Still in httpd.conf, find #ServerName www.example.com:80, delete the # and change it to ServerName localhost:80. This stops the “Could not reliably determine the server’s fully qualified domain name” (AH00558) warning. Save the file.
  3. Open an elevated Command Prompt. Select Start, type cmd, right-click Command Prompt and choose Run as administrator, then select Yes. (Right-clicking Start and choosing Windows PowerShell (Admin) works too.) Type cd C:\Apache24\bin and press Enter.
  4. Check the configuration. Run httpd -t. You should see Syntax OK. If you see an error instead, it names the file and line number to fix. httpd -v shows the version you installed.
Administrator Command Prompt in C:\Apache24\bin showing httpd -t returning Syntax OK
Expected example output: httpd -t reports Syntax OK, while httpd -v shows the server version. Apache 2.4.69 is used for this illustration and the build timestamp is hidden. No commands were executed and no server was installed.
  1. Do a quick test run. Run httpd. The cursor sits on a blank line with no message, which means Apache is running in this window. The first time it runs, Windows Defender Firewall may ask whether to allow Apache HTTP Server on your networks. For a development machine, allow private networks only and leave public networks unchecked. Open a browser and go to http://localhost. When you see It works!, go back to the Command Prompt and press Ctrl + C to stop Apache.
Windows Defender Firewall security alert for Apache HTTP Server with only private networks allowed
For a trusted local development server, allow Apache HTTP Server on Private networks while leaving Public networks unchecked. This recreated alert hides publisher and path details and leaves Allow access pending; no firewall rule was added.

If httpd returns straight to the prompt with an error such as “could not bind to address”, another program is using port 80. Jump to Troubleshooting, fix it, and run the step again.

Run Apache as a Windows service

A console test run stops when you close the window. Installing Apache as a service lets it run in the background and start automatically with Windows. Apache’s documentation recommends running it as a service, because the service shuts down cleanly.

  1. In the administrator Command Prompt at C:\Apache24\bin, run httpd -k install. Apache reports that the Apache2.4 service was installed and tests the configuration.
  2. Run httpd -k start (or net start Apache2.4). Nothing visible opens; the server is now running in the background.
  3. Refresh http://localhost in your browser. The It works! page should load again.
Microsoft Edge showing the Apache It works! page at http://localhost
Apache’s upstream 2.4.69 default page displays It works! as plain text. A Windows binary package may style its welcome page differently. This single-tab Edge recreation illustrates the localhost check; it is not evidence of a server running on this computer.
  1. To choose whether it starts with Windows, press Windows + R, type services.msc, and double-click Apache2.4. Set Startup type to Automatic (always on) or Manual (start it only when you’re working).

Commands you’ll use later, all from an elevated prompt in the bin folder:

  • httpd -k restart reloads Apache after you edit httpd.conf. Run httpd -t first so a typo doesn’t stop the server.
  • httpd -k stop stops the service.
  • httpd -k uninstall removes the service (stop it first).
  • httpd -k install -n "Apache-Test" installs a second copy under a different service name. If you name a service, add the same -n name to every other -k command.

For a tray icon with start, stop and restart buttons, run ApacheMonitor.exe from C:\Apache24\bin. To launch it with Windows, put a shortcut to it in your Startup folder (type shell:startup in the Run box to open it).

Tip: To run httpd commands from any folder, add C:\Apache24\bin to the Path variable, which is covered in setting environment variables in Windows 10. It’s optional.

Which install route to choose

RouteBest forTrade-off
Apache Lounge ZIP, run in a consoleTrying Apache or occasional testingStops when you close the window
Apache Lounge ZIP, installed as a serviceDaily local development, learning Apache configurationYou add PHP and a database yourself
A bundle such as XAMPP or WampServerA quick PHP and MySQL/MariaDB stack, for example to run WordPress locally on Windows 10Its own folder layout and control panel; don’t run it alongside a separate Apache on the same port

Put your own website in Apache

Apache serves whatever is in its document root, C:\Apache24\htdocs by default. Replace index.html there with your own page, or add files and folders. For example, a file saved as C:\Apache24\htdocs\projects\demo.html opens at http://localhost/projects/demo.html.

To serve a folder elsewhere, such as D:\Sites\alex-portfolio, edit two lines in httpd.conf: change DocumentRoot "${SRVROOT}/htdocs" to DocumentRoot "D:/Sites/alex-portfolio", and change the <Directory "${SRVROOT}/htdocs"> line right below it to the same path. Run httpd -t, then httpd -k restart.

The other folders worth knowing:

  • C:\Apache24\conf holds httpd.conf, plus extra files in conf\extra such as httpd-vhosts.conf for hosting several sites with virtual hosts.
  • C:\Apache24\logs holds error.log and access.log. error.log is the first place to look when something fails.
  • C:\Apache24\modules holds optional modules. You turn one on by uncommenting its LoadModule line in httpd.conf. For example, uncomment LoadModule rewrite_module modules/mod_rewrite.so for URL rewriting, and set AllowOverride All in your document root’s Directory block if your site relies on .htaccess files.
  • For HTTPS with mod_ssl you also need a certificate and key. For local testing you can make a self-signed pair once you install OpenSSL in Windows 10.

Add PHP (optional)

Apache on its own serves static files. To run PHP pages, download PHP from windows.php.net, choosing the x64 Thread Safe ZIP: the PHP for Windows site states that Apache’s module setup requires the Thread Safe build. You then add a LoadModule php_module line, a PHPIniDir line and a PHP handler to httpd.conf and restart Apache. The complete walk-through is in installing PHP in Windows 10.

Let other devices connect, safely

By default, Apache answers on every network address of your PC, but Windows Defender Firewall decides who can reach it. To test from a phone or another computer on your home network:

  1. Make sure Apache is allowed on private networks and that your Wi-Fi or Ethernet connection is set to a private network profile.
  2. If you dismissed the firewall prompt, open Windows Security > Firewall & network protection > Allow an app through firewall, select Change settings, and allow httpd.exe, as described in Microsoft’s guide to allowing apps through Windows Firewall. Or add a rule for the port itself, as shown in opening a port in Windows 10 Firewall.
  3. Find your PC’s IPv4 address with ipconfig and browse to it from the other device, for example http://192.168.1.25.

Some sensible precautions for a home or development machine:

  • Keep it local when you don’t need network access. Change Listen 80 to Listen 127.0.0.1:80 so only your own PC can connect.
  • Don’t port-forward from your router to expose Apache to the internet from a Windows 10 PC that no longer gets regular security updates.
  • Hide version details by adding ServerTokens Prod and ServerSignature Off to httpd.conf.
  • Turn off folder listings by removing Indexes from the Options line in your document root’s Directory block.
  • Leave the service account alone unless you know why. The service runs as LocalSystem. Apache’s Windows documentation warns never to give that account network privileges; if Apache needs to read files on another computer, create a dedicated account for it as that page describes.

Troubleshooting

“VCRUNTIME140.dll was not found” or an api-ms-win-crt error

The Visual C++ Redistributable is missing or too old. Install the latest x64 package from Microsoft (or choose Repair), then run httpd again.

“(OS 10048) Only one usage of each socket address” or “could not bind to address 0.0.0.0:80”

Something else owns port 80. Run netstat -ano | findstr :80 and look for a line in the LISTENING state; the last number is the process ID (PID). Find that PID in Task Manager on the Details tab. If the PID is 4 (System), a Windows web component such as the IIS World Wide Web Publishing Service is usually holding the port; stop or disable that service in services.msc. Otherwise close the program, or move Apache to another port: change Listen 80 to Listen 8080 and ServerName localhost:80 to localhost:8080, then browse to http://localhost:8080. More netstat options are covered in finding port numbers in Windows 10 and in Microsoft’s netstat reference.

“ServerRoot must be a valid directory”

Apache isn’t in the folder its configuration expects. Either move the Apache24 folder so the path is exactly C:\Apache24, or edit the Define SRVROOT line in httpd.conf to the real location, with forward slashes.

“(OS 5)Access is denied” when installing or starting the service

The window isn’t elevated. Close it, open Command Prompt with Run as administrator, and run the command again.

“The service is already installed” or “service name already exists”

An earlier install left the Apache2.4 service behind. Run httpd -k uninstall (from the folder of the old copy if it’s still there), then httpd -k install again. Also check that no bundle such as XAMPP has its own Apache running.

The service won’t start, or error 1067

Error 1067 (“The process terminated unexpectedly”) is a generic startup failure. Run httpd -t, then run httpd in the console, which prints the real error. Also read C:\Apache24\logs\error.log, and look under Event Viewer > Windows Logs > Application for errors Apache logged before it could open its own log.

The browser can’t connect to localhost

Confirm the service is running in services.msc, then try http://127.0.0.1 as well as http://localhost. Include the port if you changed it, and use http, not https, unless you’ve set up SSL.

Your changes to httpd.conf do nothing

Apache only reads the file when it starts. Run httpd -k restart. If you have more than one Apache on the PC, run httpd -V and check the SERVER_CONFIG_FILE line to see which httpd.conf it’s using.

Update or remove Apache

To update to a newer Apache Lounge build: back up the conf and htdocs folders, stop the service with httpd -k stop, extract the new ZIP, and copy its bin, modules and other program folders over the old ones, keeping your conf and htdocs. Update the Visual C++ Redistributable if the download page asks for a newer one, then start the service and check httpd -v.

To uninstall: from an elevated prompt in C:\Apache24\bin, run httpd -k stop and then httpd -k uninstall. Delete the C:\Apache24 folder (copy any site files out first), remove any firewall rule you added, and take C:\Apache24\bin out of Path if you added it. The Visual C++ Redistributable can stay, since other programs use it.

FAQ

Is Apache Lounge safe to use?

It’s one of the two Windows distributions the Apache HTTP Server documentation itself lists, and PHP’s Windows site also recommends its builds. Download only from its own download page, and use the published checksums or PGP signatures if you want to verify the file.

Can Apache and IIS run on the same PC?

Yes, as long as they use different ports. Leave IIS on port 80 and set Apache to Listen 8080, or the other way around.

Does Apache cost anything?

No. Apache HTTP Server is open source under the Apache License 2.0, and the Apache Lounge builds are free downloads.

Do I need the 32-bit or 64-bit version?

Use Win64 on 64-bit Windows 10, which is almost every PC sold in the last decade. Whatever you add later, such as PHP, has to match the same architecture.

How can I host two local sites at once?

Uncomment the Include conf/extra/httpd-vhosts.conf line in httpd.conf, add a <VirtualHost> block for each site with its own ServerName and DocumentRoot, and point those names to 127.0.0.1 in the Windows 10 hosts file.

Will these steps work on Windows 11?

Yes. The Apache Lounge ZIP, httpd.conf and service commands are the same; only the path to an admin terminal differs slightly (Windows 11 offers Terminal (Admin) when you right-click Start).

Once It works! appears, replace the sample page in htdocs with your own project and set the Apache2.4 service to Manual if you only need the server while you work.