Download ArticleDownload Article

This How.com.vn teaches you how to host a website on your own home network. You'll use a free program called MAMP to do so.

Part 1
Part 1 of 6:

Preparing to Host a Website

Download Article
  1. How.com.vn English: Step 1 Make sure your Internet Service Provider permits hosting.
    While small-time local hosting is usually fine regardless of your Internet Service Provider's policy, creating a website that has a significant amount of traffic from other networks may go against your ISP's terms of use.
    • In most cases, you can upgrade your Internet plan to a "Business" (or similar) account in order to enable support for larger-scale hosting.
  2. How.com.vn English: Step 2 Create your website's source code if necessary.
    If you don't have a website document that you can use for your home page, you'll need to create one.
    Advertisement
  3. How.com.vn English: Step 3 Install a text editor that can handle PHP documents.
    Depending on whether you use a Windows computer or a Mac, this will vary:
  4. Advertisement
Part 2
Part 2 of 6:

Installing MAMP

Download Article
  1. How.com.vn English: Step 1 Open the MAMP website.
    Go to https://www.mamp.info/en/downloads/ in your computer's web browser.
    • Make sure you're doing this on the computer on which you want to host your server.
  2. How.com.vn English: Step 2 Select a download option.
    Click either MAMP & MAMP PRO 4.0.1 for the Windows version of MAMP or MAMP & MAMP PRO 5.0.1 for the Mac version of MAMP. The MAMP setup file will begin downloading.
    • You may have to confirm the download or select a save location before the file will download.
  3. How.com.vn English: Step 3 Wait for MAMP to finish downloading.
    Once the MAMP setup file has downloaded onto your computer, you can continue.
  4. How.com.vn English: Step 4 Double-click the MAMP setup file.
    Doing so will open the installation window.
    • On a Mac, this is a PKG file.
  5. How.com.vn English: Step 5 Follow the on-screen installation instructions.
    These will mostly vary depending on your computer's operating system, but make sure to de-select the "Install MAMP PRO" box if it's checked during the installation process.
  6. How.com.vn English: Step 6 Wait for MAMP to finish installing.
    Once MAMP has finished installing, you can proceed with configuring it.
  7. Advertisement
Part 3
Part 3 of 6:

Configuring MAMP

Download Article
  1. How.com.vn English: Step 1 Open MAMP.
    Click or double-click the grey elephant app icon to do so. You should see the MAMP dashboard window appear.
    • On a Mac, you can find the MAMP app icon inside the Applications folder.
  2. How.com.vn English: Step 2 Click Use next free port when prompted.
    This will allow MAMP to skip using port 80 in favor of using the next free port.
    • In virtually all cases, MAMP will use port 81 if port 80 isn't free.
  3. How.com.vn English: Step 3 Click Yes when prompted.
    Doing so will allow MAMP to use its selected port.
  4. How.com.vn English: Step 4 Confirm any Firewall requests.
    If you're on a Windows computer, Firewall will ask for permission to let both Apache and MySQL through. Click Allow on both prompts before you proceed.
    • Skip this step on a Mac.
  5. Advertisement
Part 4
Part 4 of 6:

Uploading Your Website

Download Article
  1. How.com.vn English: Step 1 Copy your website's source code.
    Open the document containing your website's source code, highlight the document's text, and press Ctrl+C (Windows) or Command+C (Mac).
  2. How.com.vn English: Step 2 Click Preferences….
    It's on the left side of the MAMP window. Doing so opens a pop-up window.
  3. How.com.vn English: Step 3 Click the Web Server tab.
    This option is at the top of the pop-up window.
  4. How.com.vn English: Step 4 Click Open.
    It's in the middle of the window. Doing so opens your MAMP "htdocs" folder.
    • On a Mac, click the folder-shaped icon to the right of the "Document Root" heading.
  5. Step 5 Open the "index.php" file.
    Right-click the "index.php" file, then click Edit with Notepad++ in the resulting drop-down menu.
    • On a Mac, click once the "index.php" file, click File, select Open With, and click the BBEdit option. If this doesn't work, open BBEdit, then drag the "index.php" file into its window.
  6. How.com.vn English: Step 6 Replace the "index.php" file's contents with your source code.
    Press either Ctrl+A (Windows) or Command+A (Mac) to select all of the text in the "index.php" document, then press Ctrl+V or Command+V to paste in your copied website source code.
  7. How.com.vn English: Step 7 Save the document.
    Press Ctrl+S (Windows) or Command+S (Mac) to do so.
  8. How.com.vn English: Step 8 Close the document and its host folder.
    This should take you back to the MAMP "Preferences" pop-up window.
  9. How.com.vn English: Step 9 Click OK.
    It's at the bottom of the window. Doing so will save your settings and close the pop-up window.
  10. Advertisement
Part 5
Part 5 of 6:

Accessing Your Website

Download Article
  1. How.com.vn English: Step 1 Click Start Servers.
    It's on the right side of the window.
  2. How.com.vn English: Step 2 Click Open start page.
    You'll find this option on the left side of the window. The MAMP start page will open in your default web browser.
  3. How.com.vn English: Step 3 Click the My Website tab.
    It's at the top of the page. Doing so opens your website.
  4. How.com.vn English: Step 4 Review your website.
    Scroll through your website to view it in its entirety.
  5. How.com.vn English: Step 5 Check your website's address.
    You can find the website's address in the address bar at the top of the browser; your website's address should be something like "localhost:81". This is the address you'll enter to access your website when you're on your current network while MAMP is running.
  6. Advertisement
Part 6
Part 6 of 6:

Viewing Your Website from Another Computer

Download Article
  1. How.com.vn English: Step 1 Make sure your website is live.
    In order for you to be able to access your website, you'll need to have MAMP up and running on your host computer.
    • You cannot connect to your website if MAMP (or your host computer) is turned off.
  2. How.com.vn English: Step 2 Set a static...
    Set a static IP address for your host computer. A static IP address will ensure that your computer's IP address doesn't change, thus making sure that your website's address remains consistent:
    • Open your router's page.
    • Log in if necessary.
    • Find the list of currently connected computers.
    • Find your computer's name.
    • Select the Reserve or Lock option next to your computer's IP address.
  3. How.com.vn English: Step 3 Forward MAMP's "Apache"...
    Forward MAMP's "Apache" port on your router. This will involve opening your router's "Port Forwarding" section, adding the port you used for Apache when configuring MAMP, and saving your settings.
    • You can see the port Apache uses by clicking Preferences... in the MAMP dashboard, clicking the Ports tab, and looking at the number next to the "Apache" heading.
  4. How.com.vn English: Step 4 Find your host computer's public IP address.
    The easiest way to do this is by opening Google, typing in what is my ip, and pressing Enter. You should see your computer's public IP address at the top of the search results.
  5. How.com.vn English: Step 5 Use a computer on a different network.
    To prevent conflicts between your network's local host and the public IP address, try connecting to your website using a different computer than your host computer on a different network.
  6. How.com.vn English: Step 6 Go to your website.
    Using a computer on a different network, open a web browser, type in the public IP address of the host computer, type a colon (:), type the Apache port number, and press Enter. This should take you to the website.
    • For example, if the host computer's public IP address is "123.456.78.901" and you're using port 81 for Apache, you'd type in 123.456.78.901:81 and press Enter.
  7. Advertisement

Community Q&A

Search
Add New Question
  • Question
    Can I host my own website on my computer?
    How.com.vn English: How.com.vn Staff Editor
    This answer was written by one of our trained team of researchers who validated it for accuracy and comprehensiveness.
    How.com.vn English: How.com.vn Staff Editor
    How.com.vn Staff Editor
    Staff Answer
    It is possible to host your own website from your own computer. However, there are some important considerations to account for first, such as how powerful your computer is, whether or not you can guarantee uninterrupted power supply and whether or not your computer can handle being on all the time, which is a requirement for a server. It may also cause your electricity bill to increase, depending on how much data you’re hosting. Check out the steps above to give it a try but also do wider research into the pros and cons of home web hosting. Even if you can meet all of the requirements, you may still want to differentiate between what you host, keeping more important things hosted externally. And, as always, make backups of everything.
  • Question
    Can you host your own domain name?
    How.com.vn English: How.com.vn Staff Editor
    This answer was written by one of our trained team of researchers who validated it for accuracy and comprehensiveness.
    How.com.vn English: How.com.vn Staff Editor
    How.com.vn Staff Editor
    Staff Answer
    Yes, this is possible. However, it requires good technical knowledge and it is time consuming to set up and keep running. First, you must buy the domain name from a recognized seller, then set up your server. Obviously, you need access to the internet and your IP address must not change. From here, due to the fact there are many technical needs, you need to understand how to use the DNS server software and how to configure it and add the domain; if you don’t, then hosting is likely to be too much of a challenge. You’ll need to do a lot of research and be prepared to spend a lot of time working this out.
  • Question
    Can you host a website on Google Drive?
    How.com.vn English: How.com.vn Staff Editor
    This answer was written by one of our trained team of researchers who validated it for accuracy and comprehensiveness.
    How.com.vn English: How.com.vn Staff Editor
    How.com.vn Staff Editor
    Staff Answer
    Yes, it is possible to host a website on Google Drive. You can use it to host both basic and more advanced websites and it can handle HTML, images, audio, video, CSS, etc. Since it requires quite a few steps to set up, it is important to follow a tutorial that will take you through the whole process.
See more answers
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
      Advertisement

      Video

      Tips

      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!
      Advertisement

      Warnings

      • Avoid hosting a server on network connections with significant bandwidth limits.



      Advertisement

      About This Article

      How.com.vn English: Jack Lloyd
      Written by:
      How.com.vn Technology Writer
      This article was co-authored by How.com.vn staff writer, Jack Lloyd. Jack Lloyd is a Technology Writer and Editor for How.com.vn. He has over two years of experience writing and editing technology-related articles. He is technology enthusiast and an English teacher. This article has been viewed 520,751 times.
      How helpful is this?
      Co-authors: 33
      Updated: January 29, 2024
      Views: 520,751
      Article SummaryX

      1.Go to https://www.mamp.info/en/downloads/.
      2.Download MAMP for your operating system.
      3.Double-click the setup file.
      4.Follow the on-screen instructions to install.
      5.Open MAMP.
      6.Click Use next free port.
      7.Add your website to the Htdocs folder.
      8.Start the webserver.

      Did this summary help you?

      Thanks to all authors for creating a page that has been read 520,751 times.

      Reader Success Stories

      • How.com.vn English: Nazmul Hossain

        Nazmul Hossain

        May 28, 2017

        "Thank you for sharing this post. It will be very help full for me. I will try this."
        Rated this article:
      Share your story

      Is this article up to date?

      ⚠️ Disclaimer:

      Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
      Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

      Notices:
      • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
      • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
      • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
      • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

      Advertisement