How to Host Your Own Website from Home (Plus 5 Pros & Cons)

Pros and cons of hosting your own website from home

Let’s imagine a world where hosting a website yourself is as simple and reliable as browsing the web. You could host your company’s site, your personal portfolio, your email server, and even messaging apps, while perusing Amazon’s feed or reading the latest Hacker News highlights, all from the comfort of your couch. The web would certainly be a more democratic place, from both an information-serving and information-browsing perspective.

Though the original vision for the World Wide Web included pieces of this idealism (e.g., directly showing filesystem content using hyperlinks), the reality turned out somewhat differently. Unfortunately, hosting your own website still has some serious obstacles, including dynamic IP addresses, bandwidth constraints, and electricity costs.

In this article, we look at how to host your own website on Microsoft Windows and on Linux, and also some of the drawbacks to doing this. For both platforms, we will install and use the AMP (Apache, Mysql, PHP) web stack. This AMP stack is commonly called WAMP on Windows and LAMP on Linux for obvious reasons.

Windows: How to Host a Website Using Your PC as a WAMP Server

First, let’s try hosting a website using your personal computer with the Windows operating system.

Step 1: Install the WAMP Software

To make this super easy, we’ll use a WAMP installation program (of which there are several) called WampServer. You could also opt to install each package manually, but this process requires much more work and is error-prone.

The WampServer package is delivered with the latest releases of Apache, MySQL, and PHP.

WampServer screenshot

WampServer is one of several environments available to create Apache, MySQL, and PHP applications on Windows.

First, download the 32-bit or 64-bit WAMP-binary here, and begin the installation. Just follow the on-screen instructions, and when it’s done, launch WampServer.

Note: There may be a port 80 conflict with your Skype software, but there’s a fix for that.

Step 2: Using WampServer

Upon installation, a www directory will be created automatically. You’ll likely find it here: c:\wamp\www

From that directory, you can create subdirectories (called “projects” in WampServer), and put any HTML or PHP files inside those subdirectories.

Main screen of WampServer

The main screen of your localhost in WampServer should look something like this.

If you click on the localhost link in the WampSever menu or open your internet browser with the URL http://localhost, you should be shown the main screen of WampServer.

Step 3: Creating an HTML Page

To test our WampServer, we can put an example file called “info.php” into our www-directory.

Go directly to this directory by clicking “www directory” in the WampServer menu.

From there, create a new file with the contents below, and save it.

Now you can browse to http://localhost/info.php to see the details of your PHP installation. You can create any HTML and PHP file structure to suit your needs.

Step 4: Configure MySQL

If you click on the phpMyAdmin menu option, you can start configuring your MySQL databases (which may be needed for a CMS like WordPress).

The phpMyAdmin login screen will open in a new browser window. By default, the admin username will be root, and you can leave the password field blank.

From there, you can create new MySQL databases and alter existing ones. Most software, like WordPress, will automatically set up a new database for you, though.

Step 5: Make the Site Public

By default, the Apache configuration file is set to deny any incoming HTTP connections, except in the case of someone coming from the localhost.

To make your site publicly accessible, you need to change the Apache configuration file (httpd.conf). You can find and edit this file by going to the WampServer menu, clicking “Apache,” and selecting “httpd.conf.”

Replace the two lines above with the ones below:

Restart all WampServer services by clicking “Restart all Services” in the menu.

The site should now be accessible from beyond your localhost. Confirm there isn’t a PC firewall blocking web requests. You may need to set up port-forwarding on your internet router as well.

Step 6: Using a Domain Name

To use a domain name, such as example.com, with your WAMP installation, we’ll need to configure some files first. Let’s assume our example.com domain has an A record in your DNS with the IP address 100.100.100.100.

First, we need to add the following line to the C:\Windows\system32\drivers\etc\hosts file:

Now, we need to edit httpd.conf again (accessible via the WampServer menu) to add a virtual host. Once that file is open, look for “Virtual hosts,” and uncomment the line after it, like this:

Now we need to add a file manually in “C:\wamp\bin\apache\Apache-VERSION\conf\extra\” (VERSION is your Apache version).

Then create a file in Notepad with the following content, and save it in that Apache directory.

Click “Restart All Services” in the WampServer menu to activate these changes.

Now your site should also be accessible via its domain name.

Linux: How to Host A Website on a Linux Machine

Let’s now cover how to set up Apache, MySQL, and PHP on a Linux system.

Step 1: Install Software

To start our LAMP software install, type the following in the terminal:

During the installation process, you will be asked to enter (and re-enter) a password for the MySQL root user.

MySQL password memo

Have your MySQL root password handy during the LAMP installation process.

Technically, it’s not necessary (as it should have been done upon installation), but just to be sure, we will restart the Apache web server.

Any time you change the global configuration of Apache, you need to execute the command below, unless you do the configuration using local .htaccess files.

Step 2: Check PHP

To confirm your PHP server works and see what PHP modules are currently available, you can place a test PHP file in the web server root directory (/var/www/html/):

We can now visit that PHP page by browsing to http://localhost/info.php.

You should see the currently running PHP version, current configuration, and currently installed modules. Note that you can later install other PHP modules using the Ubuntu package manager, as some PHP applications might require that.

To determine which extra modules are available, search within the graphical package manager, or simply use the command line:

Step 3: Check MySQL

As most CMS systems (e.g., WordPress) use MySQL, we will also look at that part.

To see if your MySQL installation is working, type “service mysql status.”

We see that MySQL is up and running. If you don’t see this, you can type “sudo service mysql restart” to restart the MySQL server.

From here, we can use the MySQL command line client to manage databases.

For this, we need to use the admin credentials we typed earlier when MySQL was installed.

From here, we can do anything we want with MySQL, e.g., create a new database:

Often times, the CMS will automatically create the database for you, but sometimes you need to do something to the database manually (e.g., create a backup or optimize tables).

PHPMyAdmin is a friendly database management tool most web experts will recommend.

You can install PHPmyadmin by typing the following into the terminal:

Finally, configure the /etc/phpmyadmin/config.inc.php file using the steps described here.

Step 4: Configure DNS

To use your own domain (e.g., example.com) for your local web server, you’ll need to configure Apache to accept web requests for your domain.

First, make sure your domain’s DNS has an A record (which points to a specific IP address) for your domain name, e.g., www.example.com. Your DNS hosting provider will have online tools to correctly set up these DNS records.

Once that is done, you should be able to see something like this using the dig tool. To request the A record for www.example.com, type:

Here, a web link for http://www.example.com would be directed to the server with IP address 100.100.100.100.

Step 5: Configure Apache

Now we need to tell Apache to accept web requests for our name www.example.com and from what directory to serve content when we get those requests.

First, we set up a directory for our example.com domain, then we create an example index.html file, and finally, we set some filesystem permissions:

To see this page, the last step is to set up a Virtual Host file for Apache for our domain.

Now edit the file to look like this (the optional comments are not shown here):

Now reconfigure and reload Apache for the changes to take effect:

Edit your local /etc/hosts file by adding a line with your IP address and domain name. Be sure to change the “100.100.100.100” to match the IP address of your domain:

We should now be able to visit our self-hosted site by going to http://www.example.com.

Step 5: Install Your CMS System of Choice

You can install a CMS platform of your choice — popular options being WordPress, Joomla, and Drupal — either manually or by using the package management of Ubuntu.

Why We Say Hosting a Website Yourself is a Bad Idea (1 Pro, 4 Cons)

So we’ve covered that it’s doable — but just because you can do something doesn’t mean you should. Let’s look at the pros and cons.

The Up Side (1)

The upshot: Setting up your own website and its hosting is not just a highly educational experience but it’s rather fun to execute. It’s a geeky project, sure, but if you’re reading this, you probably fall into the category of folks who would call that fun. So there.

Once you’ve done it, you will have the power to make any system changes you desire. A lot of folks have gone from learning to host a site locally to learning more about programming, web design, and online commerce. The experience is the biggest draw.

The Downsides (4)

Unfortunately, there are still quite significant downsides to self-hosting your website:

  1. You’ll experience slow connections compared to professional hosts. Your ISP upload speed is likely much slower than your download speed, so serving content to your website visitors will be very slow, too.
  2. You have to deal with an ever-changing (dynamic) IP address. Though there are DNS configuration tools to help with this somewhat, this can potentially cause problems at any time.
  3. It costs a lot of electricity and you’ll run into power outages often.
  4. You’re responsible for hardware and software maintenance.

So you can see why we highly encourage investing in a quality web host for your site or application. And we have you covered there, too. Take a look at the types of hosting available to see what hosting options are out there and within your budget.

Alternatives to Hosting a Website From Home

Instead of trying to host a website locally, you can go through a hosting provider and manage the servers yourself. Dedicated or VPS options are a much more cost-effective means of taking physical ownership of your web presence.

Best Dedicated Servers

The perks to dedicated hosting include as much RAM and processing power as you want, complete isolation so a neighboring website’s demise won’t bring down your own, and the best uptime and performance stats money can buy — and we’re not talking a boatload of money. While dedicated servers are the priciest of the server types, they’re a dream when compared to the costs of hosting a website yourself. Below are a few top-recommended dedicated server plans:

1.
LiquidWeb.com

Liquid Web review

Monthly Starting Price $79.00

  • 100% network and power uptime guarantees
  • Custom configurations, SSDs, and instant provisioning
  • Auto-migrations, backups, and 24/7 Sonar Monitoring™
  • Block/object storage and load balancer add-ons
  • Our visitors pay $96.75/month! (usually $129/month)
  • Get started on Liquid Web now.
DEDICATED
RATING
4.9
★★★★★
Liquid Web: Our Expert's Review
Setup time: 8 minutes
Alexandra Leslie (HostingAdvice.com): Liquid Web's strong suit is their managed dedicated server hosting. They own and operate three state-of-the-art datacenters in the US and have over 50 developers working tirelessly to build and maintain custom solutions for added performance and... Go to full review »
Money Back Guarantee Disk Space Domain Name Dedicated Hosting Plans
N/A 211 GB - 1,775 GB SSD New or Transfer www.liquidweb.com/dedicated

2.
InMotionHosting.com

InMotion review

Monthly Starting Price $99.99

  • Rebootless kernel updates
  • 1-click installs and FREE SSDs
  • cPanel/WHM licences with FREE SSL
  • Tier 1 network with redundancy
  • 99.999% net uptime via Smart Routing™ technology
  • Get started on InMotion now.
DEDICATED
RATING
4.9
★★★★★
InMotion: Our Expert's Review
Setup time: 5 minutes
PJ Fancher (HostingAdvice.com): InMotion offers amazingly fast, reliable dedicated hosting on market-leading hardware — making it an easy choice for anyone seeking a premium dedicated host. From free SSDs to a fanatical support team, InMotion has all the bases covered for both small-scale... Go to full review »
Money Back Guarantee Disk Space Domain Name Dedicated Hosting Plans
30 days 500 GB - 1.2 TB SSD FREE (1 year) www.inmotionhosting.com/dedicated

3.
Bluehost.com

Bluehost review

Monthly Starting Price $79.99

  • RAID 1 mirrored storage
  • Minimum 3 IP addresses per plan
  • Modern hardware, spec'd and maintained in house
  • 24/7 expedited support from the dedicated team
  • Sign up today for 50% off first month
  • Get started on Bluehost now.
DEDICATED
RATING
4.9
★★★★★
Bluehost: Our Expert's Review
Setup time: 5 minutes
Ryan Frankel (HostingAdvice.com): Built on OpenStack technology, with a minimum of four cores per server, Bluehost offers reliable and flexible dedicated hosting options at an extremely reasonable price. We continually praise their shared hosting options for having fantastic hardware and a... Go to full review »
Money Back Guarantee Disk Space Domain Name Dedicated Hosting Plans
30 days 1 TB FREE (1 year) www.bluehost.com/dedicated

More dedicated server providers »

Best VPS Hosting

You could also host with a VPS instead. The primary advantage here is scalability — and the fact that you can scale up resources only as you need them, making it cost-efficient, too. You get maximum flexibility, whether you choose a managed service or opt to handle server configurations and maintenance yourself.

HostingAdvice runs on virtual servers, and we manage them all in house, which gives us utmost control over server resources and performance. Check out reviews of the VPS providers we recommend if this alternative sounds up your alley:

1.
InMotionHosting.com

InMotion review

Monthly Starting Price $19.99

  • 50% off the first month with added discounts
  • Real-time redundancy powered by a cloud infrastructure
  • FREE cPanel licenses with enterprise-grade CentOS
  • FREE server management for patches and updates
  • FREE SSDs and SSL certificate for fast, secure hosting
  • Get started on InMotion now.
VPS
RATING
4.9
★★★★★
InMotion: Our Expert's Review
Setup time: 4 minutes
PJ Fancher (HostingAdvice.com): Boasting market-leading VPS hardware, slick management software, and free SSD drives and backups, InMotion offers the most attractive VPS plans you'll find anywhere.Each VPS plan comes with free SSD storage arranged in RAID 6, which is incredibly fast and... Go to full review »
Money Back Guarantee Disk Space Domain Name VPS Hosting Plans
90 days 75 GB - 260 GB SSD New or Transfer www.inmotionhosting.com/vps

2.
LiquidWeb.com

Liquid Web review

Monthly Starting Price $29.50

  • Only pay for resources you use with daily billing
  • 5TB of outgoing bandwidth and FREE incoming bandwidth
  • API access and cPanel available
  • Instant provisioning and SSD speed
  • FREE Storm® Firewall and real-time server monitoring
  • Get started on Liquid Web now.
VPS
RATING
4.9
★★★★★
Liquid Web: Our Expert's Review
Setup time: 7 minutes
Alexandra Leslie (HostingAdvice.com): It's no secret by now that Liquid Web is known for best-in-class technology and reliability that exceeds expectations (from uptime to technical support). Their VPSs embody that reputation to its fullest — including a new Managed WordPress product (Hop one... Go to full review »
Money Back Guarantee Disk Space Domain Name VPS Hosting Plans
N/A 50 GB - 1.6 TB SSD FREE (1 year) www.liquidweb.com/vps

3.
Bluehost.com

Bluehost review

Monthly Starting Price $19.99

  • 2-4 cores and 4-16GB of RAM
  • Endorsed by the WordPress team
  • Redundant storage and optional SiteLock security
  • Seamless migration from Bluehost shared plans
  • Get 50% off your first month (was $29.99, now $14.99)
  • Get started on Bluehost now.
VPS
RATING
4.9
★★★★★
Bluehost: Our Expert's Review
Setup time: 5 minutes
Ryan Frankel (HostingAdvice.com): When comparing the performance versus price of VPS plans, Bluehost brings supreme value to the table. In addition to competitive pricing, they offer premium support and excellent uptime compared to other VPS options in the industry. If you’ve outgrown shared... Go to full review »
Money Back Guarantee Disk Space Domain Name VPS Hosting Plans
30 days 30 GB - 240 GB SSD FREE (1 year) www.bluehost.com/vps

More VPS providers »

Learning How to Host a Website From Home Is Fun But Impractical

Though we covered the steps to setting up a good website hosting system on both Windows and Linux, I’d like to remind everyone that self-hosting is ultimately not practical for any serious project. While we can hope this will become more feasible in the future, it’s not the case as of late.

Fun fact: There are folks working on things like IPFS, and several other distributed content-serving ideas, which could allow people to create decentralized content hosting networks — eventually. The internet keeps surprising us, so who knows what the future of hosting holds! Follow us to follow the industry and all its twists and turns.

Alexandra Leslie

Questions or Comments? Ask Alexandra!

Ask a question and Alexandra will respond to you. We strive to provide the best advice on the net and we are here to help you in any way we can.