- Starting
- How to set up a local web server on a Windows 10 PC
- How to set up a local web server on a Mac
- How to configure a local web server in Ubuntu?
- How to configure a local web server on a Linux device
- How to configure a LAN web server
- How to configure a local HTTP server
- Additional FAQs
- From a normal computer to a powerful web server
The most efficient way to test dynamic content is through a local web server. If you need to know how to set one up, you’re in the right place.
In this article, we will show you how to configure a local web server on various operating systems and how to test a successful installation.
Starting
A local web server is essentially set up by installing software on your computer to give it web server capabilities; It is “local” since you are in charge of managing it. We will show you how to turn your computer into an HTTP server, mainly based on installing the Apache software. But first, here are some prerequisites:
- A dedicated computer to become your server
- Running Windows, Linux, or a Mac computer with macOS
- An Internet connection
- Dual core 2 GHz or higher
- 4GB RAM
- 1 GB of free disk space.
How to set up a local web server on a Windows 10 PC
Windows 10 is not Unix-based, so we will install XAMPP, which is a combination of Apache, MySQL, and PHP. To install XAMPP, do the following:
- Navigate to XAMPP and proceed to install the Windows version.

- When prompted, run the installer.
- Select “Apache” to install only one web server.
- Once the installation is complete, click “Finish” to open the XAMPP control panel.
To confirm successful installation, enter “127.0.0.1” either “localhost” in the address bar of your web browser. The XAMPP configuration page should appear.
How to set up a local web server on a Mac
MacOS has the Apache web server preinstalled; To turn it on, do the following:
- Click “Finder.”

- Click “Applications” > “Utilities”, double-click “Terminal”.

- Now go in and run this command to turn on Apache:
sudo apachectl start
- To confirm that Apache is active, enter “
127.0.0.1” either “localhost” in the address bar of your web browser. You should see a “It works!” message.
How to configure a local web server in Ubuntu?
To install the Apache web server on Ubuntu Linux 18.04, do the following:
- Access a terminal and enter the command:
sudo apt-get install apache2 - Confirm the installation and then sit back while Apache installs.
- To confirm that the installation was successful, enter the following in the address bar of a web browser:
https://local.server.ip
• In the web browser, you should see the default Apache2 Ubuntu page.
How to configure a local web server on a Linux device
- Access a terminal for Debian and Ubuntu/Ubuntu-based distro and enter the command:
sudo apt install apache2• For CentOS and Red Hat, enter the command:sudo dnf install httpd - To confirm that the installation was successful enter “
localhost” either “127.0.0.1” in your web browser.
• The default Apache welcome page should display “It works”.
How to configure a LAN web server
Now we will show you how to set up a LAN network through Windows that connects to the Internet. First of all, you will need the following:
- a computer (server)
- a network switch
- Broadband connection
- a router (with built-in modem)
- The devices you want to connect to the network.
- ethernet cables
Connect your first computer:
Connect your router or network switch to the computer using an Ethernet cable, then turn it on. If you are setting up for the first time, the “Set up a network” wizard will do this automatically. If it doesn’t appear, do the following:
- Click “Network and Sharing Center” from the “Control Panel” or “Settings.”

- Select “Set up a new connection or network.”
- Follow the instructions on the screen.
Set up your Wi-Fi:
If you want your devices to be connected to your network wirelessly, you’ll need to set up Wi-Fi; If not, you can use ethernet cables.
Follow the instructions provided in your router/network switch manual to enable Wi-Fi. To make it as safe as possible, do the following:
- Consider changing the default SSID (network name), Wi-Fi login, and password. This can be done by logging into your router, either through network settings or a web browser on your PC.
- Be sure to choose the most advanced security protection – currently it is WPA2.
- Now, for the changes to take effect, restart your PC.
Connect your LAN to the Internet:
For your LAN web access, connect your router and modem to the main telephone line, using the WAN port.
Connect your devices to the LAN:
Whether you connected your devices to the LAN using Wi-Fi or an Ethernet cable, do the following:
- On your devices, turn on Wi-Fi

- Select your network

- Enter your new password when prompted

To connect to your LAN using Ethernet cables:
- Connect the cable to your network switch/router
- Connect the other end to your device
- Do the same with your other device.[s]You can access them from any device on your LAN.
Now start sharing:
To set up a “homegroup” to share resources on your network, do the following:
- Navigate to “Control Panel” > “Network and Internet” > “Homegroup”.
- Select “Create a homegroup”, it will start the homegroup setup wizard and give you the password needed for the other devices to connect to the LAN.
There are several ways to share and provide access to resources on a LAN, including:
- Right-clicking on files or folders > “Share with…”
- Add files to public folders and turn on “Public Folder Sharing” through the Network and Sharing Center.
How to configure a local HTTP server
Now we’ll show you how to set up a local web server for testing. For a Python installation on Windows, do the following:
- Navigate to the Python home page python.org.

- In the “Download” p, select the Python “3.xxx” link.

- Towards the bottom of the screen, select the “Windows x86” exe file to download.
- Run the file when you download it.
- From the first page, make sure to select the “Add Python 3.xxx to PATH” checkbox.
- Select “Install” and then “Close” when finished.
- Go to the command prompt and enter this command to check if the installation was successful:
python -V# Or you may have command py available,# in that case attempt py -V
This will show the version. If the number is correct, type the following command “cd”, then in the directory where your example resides:
# add the directory name to enter, e.g.cd Desktop# use two dots to go up a directory level if necessary
cd ..
Now to start the server in the directory, enter the following commands:
# If the Python version displayed is more than 3.Xpython3 -m http.server# In windows as an alternative enter “python” to substitute “py -3”, or “python3”# If Python version 2.X is displayed
python -m SimpleHTTPServer
To view a list of the directory contents, go to the server from your web browser’s address bar, enter “localhost:8000“
If port 8000 is already in use, use another port, for example:
python3 -m http.server 7800(Python 3.x) orpython -m SimpleHTTPServer 7800(Python 2.x)
Then enter “localhost:7800” to access the server.
Additional FAQs
What is a LAN?
A LAN (local area network) connects a set of devices in an area, for example in a home, office, or building. The size of a LAN can vary from thousands of users and devices to a single user.
What is a WAN?
A WAN (wide area network) connects telecommunications geographically. It is typically used by government entities, schools, and businesses to transmit data between each other, allowing people to carry out their functions regardless of their physical location.
From a normal computer to a powerful web server
Local web servers are great for hosting websites and storing virtually anything you want to allow others to access. With software packages that magically turn your regular PC or computer into a web server, it’s pretty easy to set one up.
Now that we’ve shown you how to set up your own, were you able to get your web server up and running? What kinds of things do you use your web server for? We’d love to hear from you, leave a comment in the p below.