How To Setup A Web Server On Windows 10 : IIS And PHP Installation Guide

Creating a web server on Windows 10 begins with enabling IIS through the “Turn Windows features on or off” menu. If you have ever wondered how to setup a web server on windows 10, you are in the right place. This guide walks you through every step, from enabling Internet Information Services to testing your first webpage. You do not need any prior server experience—just a Windows 10 PC and a bit of patience.

Many people think setting up a web server is complicated, but Windows 10 makes it surprisingly easy. By the end of this article, you will have a fully functional local web server. You can use it for testing websites, hosting small projects, or learning web development. Let us get started.

How To Setup A Web Server On Windows 10

Before we begin, make sure your Windows 10 is up to date. You also need administrator access to your computer. The process involves enabling IIS, configuring it, and testing your server. Follow these steps carefully.

Step 1: Enable Internet Information Services (IIS)

IIS is the built-in web server for Windows. It is not enabled by default, so you need to turn it on. Here is how:

  1. Open the Control Panel. You can search for it in the Start menu.
  2. Click on “Programs” and then “Turn Windows features on or off.”
  3. In the list, find “Internet Information Services.” Check the box next to it.
  4. Expand the IIS node to select additional features. For a basic server, check “Web Management Tools” and “World Wide Web Services.”
  5. Click OK and wait for Windows to install the features. This may take a few minutes.
  6. Restart your computer when prompted.

After the restart, IIS is installed. You can verify this by typing “inetmgr” in the Run dialog (Win + R). The IIS Manager window should open.

Step 2: Configure IIS For Your Web Server

Now that IIS is installed, you need to configure it. Open IIS Manager from the Start menu. The interface looks a bit technical, but do not worry. We will keep it simple.

  • In the left panel, expand your computer name and then “Sites.”
  • You will see a default website called “Default Web Site.” This is your server’s root.
  • Right-click on “Default Web Site” and select “Explore.” This opens the folder where your website files go.
  • The default path is usually C:\inetpub\wwwroot. You can change this later if needed.

For now, leave the default settings. Your web server is already running. To test it, open a web browser and type http://localhost. You should see the IIS welcome page. If you see it, your server works.

Step 3: Create Your First Web Page

To make your server useful, you need to add content. Create a simple HTML file to test. Open Notepad and type the following:

<!DOCTYPE html>
<html>
<head>
    <title>My Web Server</title>
</head>
<body>
    <h1>Hello, World!</h1>
    <p>This is my first web page on Windows 10.</p>
</body>
</html>

Save this file as index.html in the C:\inetpub\wwwroot folder. Make sure to choose “All Files” in the save dialog, not “Text Documents.” Now refresh your browser at http://localhost. You should see your new page.

Congratulations! You have just set up a basic web server. But there is more you can do to make it secure and functional.

Step 4: Configure Firewall And Ports

By default, IIS listens on port 80. Windows Firewall usually allows this, but you should check. If you want to access your server from other devices on your network, you need to open port 80.

  • Open Windows Defender Firewall from Control Panel.
  • Click “Advanced settings” on the left.
  • In the left panel, click “Inbound Rules.”
  • Look for rules named “World Wide Web Services (HTTP Traffic-In).”
  • If it is not enabled, right-click and select “Enable Rule.”

If you do not see this rule, you can create one. But for most users, enabling the existing rule works. After this, other devices on your network can access your server using your computer’s IP address.

To find your IP address, open Command Prompt and type ipconfig. Look for the IPv4 address under your network adapter. Share this address with others on your network. They can type it into a browser to see your site.

Step 5: Add Multiple Websites (Optional)

If you want to host more than one site, you can add additional websites in IIS. Here is how:

  1. In IIS Manager, right-click on “Sites” and select “Add Website.”
  2. Give your site a name, like “MySecondSite.”
  3. Choose a physical path for the site’s files. Create a new folder, e.g., C:\MySites\Site2.
  4. Set the port to a different number, like 8080. You can also use host headers for domain names.
  5. Click OK.

Now you can access this site at http://localhost:8080. You can add as many sites as you want, each with its own port or host header.

Step 6: Enable HTTPS With A Self-Signed Certificate

For secure connections, you can enable HTTPS. This is important for testing modern web features. IIS includes a tool for creating self-signed certificates.

  • In IIS Manager, select your server node (top level).
  • Double-click “Server Certificates.”
  • In the right panel, click “Create Self-Signed Certificate.”
  • Give it a friendly name, like “MyLocalCert.”
  • Click OK.

Now bind this certificate to your site:

  1. Select your site in IIS Manager.
  2. Click “Bindings” in the right panel.
  3. Click “Add.”
  4. Change the type to “https.”
  5. Select your certificate from the dropdown.
  6. Click OK.

Now you can access your site at https://localhost. Your browser may show a warning because the certificate is self-signed. That is normal for local testing.

Step 7: Configure PHP And MySQL (For Dynamic Sites)

If you want to run PHP applications like WordPress, you need to install PHP and MySQL. This adds more power to your server.

Install PHP on Windows 10

Download the latest PHP version from the official website. Choose the non-thread-safe version for IIS. Extract the files to a folder like C:\PHP. Then configure IIS to use PHP:

  • Open IIS Manager and select your server node.
  • Double-click “Handler Mappings.”
  • Click “Add Module Mapping” on the right.
  • Request path: *.php
  • Module: FastCgiModule
  • Executable: C:\PHP\php-cgi.exe
  • Name: PHP via FastCGI
  • Click OK.

Now create a PHP info file to test. Save a file named info.php in your web root with this content:

<?php phpinfo(); ?>

Access http://localhost/info.php in your browser. You should see the PHP configuration page.

Install MySQL

Download MySQL Community Server from the official site. Run the installer and follow the setup wizard. Choose a root password and remember it. You can use tools like phpMyAdmin to manage databases later.

With PHP and MySQL, your Windows 10 web server is now capable of running dynamic websites. You can install WordPress or any PHP-based application.

Step 8: Secure Your Web Server

Security is important even for a local server. Here are some basic steps:

  • Change the default IIS welcome page. Replace it with your own content.
  • Disable directory browsing. In IIS Manager, select your site and double-click “Directory Browsing.” Click “Disable” on the right.
  • Set strong passwords for any user accounts.
  • Keep Windows and IIS updated.

If you plan to expose your server to the internet, use a firewall and consider a reverse proxy. For local testing, these steps are sufficient.

Step 9: Troubleshoot Common Issues

Sometimes things do not work right away. Here are common problems and fixes:

  • Localhost does not load: Make sure IIS is running. Check the Services panel for “World Wide Web Publishing Service.”
  • Port 80 is in use: Another program like Skype may use port 80. Stop that program or change IIS to a different port.
  • PHP not working: Verify the handler mapping path is correct. Check the PHP folder permissions.
  • Firewall blocking: Temporarily disable the firewall to test. Then create proper rules.

Most issues are easy to fix. Search for error messages online for specific help.

Step 10: Test From Other Devices

To test your server from another computer or phone on the same network, use your computer’s IP address. For example, if your IP is 192.168.1.10, type http://192.168.1.10 in the other device’s browser.

If it does not work, check the firewall rules. Also ensure that network discovery is enabled. You can find this in Network and Sharing Center.

For remote access over the internet, you need to configure port forwarding on your router. This is more advanced and not recommended for beginners due to security risks.

Frequently Asked Questions

What Is The Easiest Way To Setup A Web Server On Windows 10?

The easiest way is to enable IIS from Windows Features. It is built-in and requires no extra software. You can have a basic server running in minutes.

Can I Use Apache Instead Of IIS On Windows 10?

Yes, you can install Apache for Windows. It is a popular alternative. However, IIS is simpler for beginners and integrates well with Windows.

Do I Need To Know Coding To Setup A Web Server On Windows 10?

No, you do not need coding skills. The setup process is mostly clicking through menus. Basic HTML knowledge helps for creating pages, but it is not required.

How Do I Access My Web Server From The Internet?

You need to forward port 80 on your router to your computer’s local IP. Also, use a dynamic DNS service if your IP changes. This is advanced and requires caution.

Is IIS Free To Use On Windows 10?

Yes, IIS is included with Windows 10 at no extra cost. It is a full-featured web server suitable for development and small-scale hosting.

Now you know how to setup a web server on windows 10. The process is straightforward once you understand the steps. Start with IIS, add content, and expand as needed. Your local server is a great tool for learning and testing.

Remember to keep your server updated and secure. Experiment with different features like PHP and MySQL. With practice, you can host complex applications right from your Windows 10 machine.

If you run into problems, take a breack and review the steps. Most errors are simple misconfigurations. The community around IIS is helpful, so do not hesitate to search for solutions.

Your web server is now ready. Go ahead and build something amazing. Whether it is a personal blog, a portfolio site, or a test environment, you have the foundation. Happy hosting!