How to Set Up a Web Host at Home

Prime Inspire
5 min readAug 12, 2021

--

How to Set Up a Web Host at Home

Step 1: Getting Ready to Host a Website

Check with your Internet Service Provider to see if hosting is permitted.

While small-scale local hosting is normally acceptable regardless of your ISP’s policy, developing a website that receives a substantial amount of traffic from other networks may violate your ISP’s terms of service. You can usually upgrade your Internet plan to a “Business” (or similar) account to enable larger-scale hosting support.

If necessary, write the source code for your website. You’ll need to create a website document for your home page if you don’t already have one. Install a text editor that can work with PHP files.

This will differ depending on whether you use a Windows or a Mac computer: Notepad++ is the finest option for Windows users. Mac — Go to https://www.barebones.com/products/bbedit/ and click Free Download on the right side of the screen to get a free text editor named “BBEdit.”

Step 2: MAMP Installation

Go to the MAMP website and log in. In your web browser, go to https://www.mamp.info/en/downloads/. Make sure you’re doing this on the computer where your server will be hosted. Choose a download method.

For the Windows version of MAMP, select MAMP & MAMP PRO 4.0.1, or MAMP & MAMP PRO 5.0.1 for the Mac version of MAMP. The MAMP installation file will begin to download.

Before the file will download, you may need to confirm the download or choose a save location. Wait for MAMP to complete its download. You can now proceed after the MAMP setup file has been downloaded to your computer.

MAMP’s setup file should be double-clicked. This will bring up the installation window. This is a PKG file on a Mac.

Follow the installation instructions on the screen. These will change based on your computer’s operating system, but if the “Install MAMP PRO” box is checked throughout the installation process, make sure to uncheck it. Wait for MAMP to complete its installation.

After MAMP has completed its installation, you can begin configuring it.

Step 3: Setting up MAMP

MAMP should now be open. To do so, click or double-click the grey elephant app icon. The MAMP dashboard window should now appear. The MAMP app icon can be found in the Applications folder on a Mac.

When prompted, select Use next free port. This will allow MAMP to use the next available port instead of port 80. If port 80 isn’t available, MAMP will almost always utilise port 81. When prompted, select Yes.

MAMP will then be able to use the port you specify. Any Firewall requests should be confirmed. If you’re using a Windows machine, Firewall will ask if you want to allow Apache and MySQL to run. Before continuing, click Allow on both questions. On a Mac PC, you can skip this step.

Step 4: Putting Your Website Online

Copy the source code of your website. Open the document containing the source code for your website, highlight the text, and click Ctrl+C (Windows) or Command+C (Mac) to copy it (Mac).

Select Preferences…. It’s on the MAMP window’s left side. This causes a pop-up window to appear. Select the Web Server option from the drop-down menu. The top of the pop-up window has this option. Click the Open button. It is right in the centre / middle of the window. This will access the MAMP “htdocs” folder.

To the right of the “Document Root” heading on a Mac, click the folder-shaped icon. Open the “index.php” file in your browser. Right-click the “index.php” file, then select Edit with Notepad++ from the drop-down menu that appears. On a Mac, double-click the “index.php” file, then go to File, Open With, and choose BBEdit.

If that fails, open BBEdit and drag the “index.php” file into its window. Replace the contents of the “index.php” file with your source code. Select all of the text in the “index.php” page with Ctrl+A (Windows) or Command+A (Mac), then paste in your copied website source code with Ctrl+V or Command+V.

Save the file to your computer. To do so, press Ctrl+S (Windows) or Command+S (Mac). Close the document as well as the folder in which it is housed. This should return you to the “Preferences” pop-up box in MAMP. Click the OK button.It can be found near the bottom of the window.

By doing so, you’ll be able to save your preferences and close the pop-up window.

Step 5: Getting to Your Website

Start the servers by clicking Start Servers. It’s on the window’s right side. Open the start page by clicking the Open button. This option / feature can be found on the left side of the window. In your default web browser, the MAMP start page will appear.

Select My Website from the drop-down menu. It can be found at the top portion of the page. This will take you to your website. Take a look at your website. To see your website in its entirety, scroll through it. Check the URL of your website. The website’s address can be found in the address bar at the top of the browser; it should be something like “localhost:81.”

This is the address you’ll use to access your website while MAMP is running on your current network.

Step 6: Using a Different Computer to View Your Website

Make sure that your web-site you built is up and running. MAMP must be installed and functioning on your host machine in order for you to view your website. If MAMP (or your host machine) is shut off, you won’t be able to connect to your website.

Make your host computer’s IP address static. A static IP address ensures that your computer’s IP address does not change, ensuring that the address of your website does not change:

Go to the router’s page. If necessary, log in. Get a list of all the machines that are currently connected. Find out what your computer’s name is. Next to your computer’s IP address, select Reserve or Lock. On your router, forward MAMP’s “Apache” port.

This will entail going to your router’s “Port Forwarding” section, adding the port you chose for Apache when setting up MAMP, and saving your changes. The port Apache uses may be found by going to the MAMP dashboard, clicking Preferences…, clicking the Ports tab, and looking at the number next to the “Apache” heading.

Find the public IP address of your host machine. The simplest way to do this is to open Google and type in what is my IP address, then press Enter. The public IP address of your computer should appear at the top of the search results.

Use a PC that is connected to a separate network. To avoid problems between your network’s local host and the public IP address, access to your website from a computer on a separate network than your host computer. Go to your personal webpage.

Open a web browser on a computer on a different network, key in the host machine’s public IP address, a colon (:), the Apache port number, and press Enter. You should be directed to the website as a result of this.

You’d type in 123.456.78.901:81 and hit Enter if the host computer’s public IP address is “123.456.78.901” and you’re using port 81 for Apache.

--

--

Prime Inspire
Prime Inspire

Written by Prime Inspire

Passionate Web Designer, Developer, SEO enthusiast. Let's make the internet beautiful and search-friendly.

No responses yet