How to host your own website for free

Prerequisites: A computer, an internet connection, and a router.

If you already pay for a home internet service, chances are you are at least somewhat familiar with modems and routers. If you are renting a device from your ISP, consider returning it and purchasing your own.
It will give you better performance and control and also will eventually pay for itself since you won't be paying monthly to lease theirs.
If you need a place to start shopping a popular replacement is the "Arris Surfboard".

What the basic process is: A quick summary of how it works.

1.) You'll install a web server on your operating system which will host your website.
2.) You'll configure some firewall rules to allow traffic in and out of your system.
3.) Then you'll log into your router to direct the traffic from the internet to your local computer.

1.) Installing a Web Server:

The easiest method to installing a web server on MS Windows is to download either Xampp - Apache, MariaDB, PHP, Perl or Wamp - Apache, PHP, MySQL. Each are easy to install and offer more control than IIS. As a more familiar and user friendly option I'll cover how to install IIS (Internet Information Services) in Windows.

How to setup an IIS Web Server on WIndows:

First things first, download and install .NET Framework

https://www.microsoft.com/net/download/dotnet-framework-runtime
https://www.microsoft.com/net/download/windows

Next it's time to turn on Internet Information Services (IIS)
Open the control panel (Start Menu > control)
Control Panel //> Programs and Features
Turn Windows features on or off

Turn on the following: (check the box next to each)

Internet Information Services

  • FTP Server
  • Web Management Tools
  • World Wide Web Services
    Internet Information Services Hostable Web Core

Next navigate to:
Control Panel > Administrative Tools > View Local Services
Locate and Start: IIS Administrative Services

Internet Information Services (IIS) Manager

Run IIS Manager

Select "Application Pool"
Select "DefaultAppPool"
Right Click "Edit Basic Settings"
Choose ".NET Framework"
Managed pipeline mode: Integrated
Check "Start application pool immediately"
Click "OK"

Select "Sites" > Default Web Site"
Right Click and choose "Edit Bindings"
Click "Add"
Type: http
IP address: All Unassigned
Port: 80
Host name: blank

Select "Sites > Default Web Site"
Right Click and choose "Edit Bindings"
Click "Add"
Type: http
IP address: 192.168.0.1 (local ip address if you don't know yours open command prompt (cmd) and type "ipconfig" look for your IPv4 Address.
Port: 80
Host name: blank

Click Application Pools
Right Click "Default Application Pool"
Click "Advanced Settings"
Expand "Process Model"
Change "Idle Time-out (minutes) to "0"

INSTALL PHP and SQL

Visit: https://www.microsoft.com/web/downloads/platform.aspx
and download "Microsoft Web Platform Installer 5.0" It's basically an app store for IIS.

Install and open it.

PHP and SQL are located under "Products/Frameworks"
Also download .NET Frameworks and Powershell

Optional: Download MySQL Community Server
By visiting: https://dev.mysql.com/downloads/file/?id=476476
It's a SQL installer similar to Microsoft Web Platform for IIS)
Optional: Install SQL Work Bench for easy administration

Your site should be live (on your own network) and accessible by visiting 127.0.0.1 or localhost in a web browser.

2.) Configuring Windows Firewall

Launch Windows Firewall (start menu "windows firewall")
Click "Advanced Settings" to set Inbound rules on specific ports.

Set two rules:

Click "Inbound Rules"
Click "New Rule"
Click "Port"
Click "Next"
Select "TCP"
Specific local ports: 80
Select "Domain"
Select "Private"
Select "Public"
Click "Next"
Select "Allow the connection"
Click "Next"
Name: server
Click "Finish"

Click "Inbound Rules"
Click "New Rule"
Click "Port"
Click "Next"
Select "TCP"
Specific local ports: 8080
Select "Domain"
Select "Private"
Select "Public"
Click "Next"
Select "Allow the connection"
Click "Next"
Name: server 80
Click "Finish"

3.) Make it reachable on the world wide web.

log into you router
Once logged in go to Advanced > Port Forwarding

In order to host your own website you'll need to log into your route by visiting it's admin page via a web browser.
The standard address for routers is 192.168.0.1
After you've logged in you'll need to find the option for "Port Forwarding" and then an option to "Create IPv4"

Set two rules:

External IP Address & Start/End Point = 0.0.0.0 = 80= 80
Local IP Address & Start/End Point = 192.168.0.2 = 80 =80
(this IP address should match your computers.
To find it open command prompt "cmd" and type "ipconfig" look for your IPv4 address.)
Description = server
Protocol = TCP
Forwarding = YES

External IP Address & Start/End Point = 73.239.189.169 = 8080= 8080
(this IP should be the address of your router. )
Local IP Address & Start/End Point 192.168.0.2 = 8080= 8080
Description = server = 80 = 80
Protocol = TCP
Forwarding = YES

Next locate your DHCP settings

Locate your computer in the list of devices connected to your network.
Reserve it's local IP address so it doesn't change the next time you reboot your router.

To attach a domain name to your website visit https://domains.google.com and purchase one.
(Usually about $12 a year)
Then select "Manage" and "Forward", enter your routers IP and click save.
Now when people visit your domain name it will redirect traffic to your website.