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

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 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.

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.

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:

DEDICATED RATING
★★★★★ 4.9/5.0
  • FREE incoming bandwidth and choice of operating system
  • Custom configurations with SSDs and instant provisioning
  • Auto-migrations, backups, and 24/7 Sonar Monitoring™
(read more)
Starting Price/Mo. $79.00
Money Back Guarantee N/A
Disk Space 211 GB - 1,775 GB SSD
Domain Name New or Transfer
Dedicated Hosting Plans www.liquidweb.com/dedicated
Our Expert's Liquid Web Review
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... read more +

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 security.

Fully, Core-, or Self-Managed — Plus Storm® Servers

Liquid Web offers single, dual, and quad processor servers with fully, core-, or self-managed plans. All dedicated server customers reap the benefits and support of the Heroic Support® team and the 24/7 protection of the Sonar Monitoring™ team.

Redundantly Built, Multi-Tiered Network

Featuring top-of-the-line Cisco equipment, the Liquid Web N+1 network is redundantly built to allow routing devices to quickly self-heal. They're designed to bounce back and correct system failures without interrupting the customer's connection. With the integration of premier providers, Level 3, Verizon, Comcast, Cogent, and Equinix, the Liquid Web network is optimized for rapid and fault-resistant performance.

Highly Available Sites with the Tech of 50+ Developers

Liquid Web boasted an incredible 99.995% uptime rate in 2014, a bragging right that's helped shape their reputation for performance. With the maintenance of 50+ developers, the Liquid Web infrastructure is engineered to evade and survive typical site disasters.

24/7 Proactive Protection from the Sonar Monitoring™ & Heroic Support® Teams

Should disaster strike, the Sonar Monitoring™ team is trained to catch the issue first, performing system-level health checks and patches 24/7, so they can hopefully have it handled before you're even aware of the situation. Meanwhile, the Heroic Support® team of 300+ experts is available anytime to help with any troubleshooting need.

Storm® Servers & Add-Ons

For the dev nerds out there, one of our favorite facets of Liquid Web as a hosting provider is the commitment to in-house-built technology. All of their team members' experience and expertise becomes very evident once you check out their custom Storm® Platform.

All the Power Plus All the Flexibility

If you're in need of dedicated resources, drawn to the customization of the Cloud, and know you need screaming fast performance, the Storm® Dedicated Server may be your solution. These custom server systems allow for cloud-like flexibility that traditional dedicated servers aren't capable of, like instant provisioning and automatic migrations.

Added Extras Make the Dedicated Cost a Done Deal

The Liquid Web development team is constantly coming up with new Storm® Add-Ons, like Load Balancers, Block Storage, Object Storage, and a VPN. Think you can't afford such full-featured and flexible hardware? Think again. With pricing starting around $110/month, the Storm® Platform is great for the cost-conscious dedicated server shopper.

Liquid Web Dedicated Servers in Review

If you want feature-rich dedicated resources and relentlessly reliable technical support, Liquid Web should be on your short list. They're known for strong managed service offerings, but the drawback to managed hosting is usually the cost. Liquid Web doesn't leave you hanging there though — in-house solutions like the Storm® Dedicated Server keep the cloud-level flexibility and performance up and the cost down.

collapse info -
DEDICATED RATING
★★★★★ 4.9/5.0
  • Rebootless kernel updates
  • 1-click installs and FREE SSDs
  • cPanel/WHM licences with FREE SSL
(read more)
Starting Price/Mo. $99.99
Money Back Guarantee 30 days
Disk Space 500 GB - 1.2 TB SSD
Domain Name FREE (1 year)
Dedicated Hosting Plans www.inmotionhosting.com/dedicated
Our Expert's InMotion Review
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... read more +

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 and large-scale operations, featuring a truly reliable dedicated host.

Unlike some hosts, InMotion gives SSH and Root access to their servers. Each plan is managed and comes with between two and four hours of SysAdmin time at launch, which is an excellent help in getting your site configured to meet your needs. Each server also is set up with cPanel and WHM for easy management.

Plenty of CPU power, RAM, and storage, plus lots of IP addresses, come with each plan. Perhaps our favorite feature of InMotion is their zero-downtime, rebootless kernel updates, which are partially the reason for their superb 99.999% uptime.

InMotion has a 30-day money-back guarantee on their dedicated plans, which is fairly rare and just another reason you can’t go wrong selecting them as your dedicated host.

collapse info -
DEDICATED RATING
★★★★★ 4.9/5.0
  • RAID 1 mirrored storage
  • Minimum 3 IP addresses per plan
  • Modern hardware, spec'd and maintained in house
(read more)
Starting Price/Mo. $79.99
Money Back Guarantee 30 days
Disk Space 1 TB
Domain Name FREE (1 year)
Dedicated Hosting Plans www.bluehost.com/dedicated
Our Expert's Bluehost Review
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... read more +

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 great management console, and their dedicated offerings are no different.

Designed and maintained in house, Bluehost uses only the latest technologies on their dedicated servers. Their most recent upgrade moved all CPUs to four cores, 1TB of RAID storage, and between four and 16 gigs of available RAM. Each server is provisioned instantly and can be upgraded at any time with essentially just a few mouse clicks.

One reason we’ll always consider Bluehost for our hosting needs is their fantastic 24/7 support team. They do have a premium team of engineers for their dedicated servers. The expert technicians are incredibly helpful and available at a moment’s notice.
Already one of our favorite hosting companies, when you combine their fanatical support and the value offered in their dedicated hosting plans, Bluehost is hard to pass up.

collapse info -

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:

VPS RATING
★★★★★ 4.9/5.0
  • 50% off the first month with added discounts the first year
  • Real-time redundancy powered by a cloud infrastructure
  • FREE cPanel/WHM licenses with enterprise-grade CentOS
(read more)
Starting Price/Mo. $19.99
Money Back Guarantee 90 days
Disk Space 75 GB - 260 GB SSD
Domain Name New or Transfer
VPS Hosting Plans www.inmotionhosting.com/vps
Our Expert's InMotion Review
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,... read more +

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 secure. Each of their plans also come with an awesome amount of RAM for the server cost, so the speed-to-dollar ratio is high with this host.

InMotion’s VPS packages run on CentOS 6 Linux operating systems and all feature a license for cPanel. Each plan also comes with Web Hosting Management (WHM) software, making it super-easy to resell some unused server resources.

InMotion's reputation for uptime is second-to-none, with a solid track record as a large-scale VPS host and a large, friendly support team available at any time.

Lastly, InMotion has a 90-day money-back guarantee and offers a choice of datacenters, which are nice customer-centric features. Their support is top-notch and 24 hours. We highly recommend you check them out if you are looking for a VPS with great hardware and reseller options at a low price.

collapse info -
VPS RATING
★★★★★ 4.9/5.0
  • Only pay for resources you use with daily billing
  • 5TB of outgoing bandwidth and FREE incoming bandwidth
  • API access and cPanel available
(read more)
Starting Price/Mo. $29.50
Money Back Guarantee N/A
Disk Space 50 GB - 1.6 TB SSD
Domain Name FREE (1 year)
VPS Hosting Plans www.liquidweb.com/vps
Our Expert's Liquid Web Review
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... read more +

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 tab over to the WordPress Review for more info on this awesome addition.).

Perks of a Managed VPS: Support Meets Reliability

They offer a high-powered VPS solution as well as their in-house-built, cloud-based Storm® Servers, all of which are backed by their popular SLAs (service-level agreements) promising high uptime rates and highly reliable help from the Heroic Support® experts.

Better Performance with Liquid Web Virtual Servers

With high-powered SSDs and, of course, the Heroic Support® team, the VPS platform shines among the managed services offered at Liquid Web. You'll pay a bit of a premium for managed hosting, but there's a reason customers rave about the Heroic Support®, incredible SLAs, and excellent uptime rates.

SSD Power & Fully Managed Support

RAID-protected SSD storage comes standard for Liquid Web VPS users, which decreases latency and keeps your page loads fast and secure. They offer a range of management plans, as well as cPanel control and API access, so you get the perfect level of infrastructural management support for you and your site.

Cloud-Level Flexibility & Supreme Uptime

The Liquid Web VPS infrastructure was engineered with customer priorities in mind. These solutions are ideal for users that want cloud-like flexibility, such as billing by the day and custom configurations, but also seek the affordability of shared hosting. Customers can instantly provision and deploy their virtual server, easily upgrade, downgrade, clone, or resize, and only pay for the resources they use.

Award-Winning Heroic Support® & Sonar Monitoring™

Liquid Web's SLAs promise speedy response times and industry-leading performance. Their blazing fast and fault-resistant servers are backed by the round-the-clock attention of the Sonar Monitoring™ team.

Heroic Support® Team Helps Consistently Earn High Net Promoter Scores

Not only does the Heroic Promise ensure a Heroic Support® technician will get to you quickly, but their policy of Best Effort Support guarantees that they will attempt to help with any problem you encounter. That kind of customer support translates into customer loyalty, and it's a commitment that's rare and wonderful in this industry.

Sonar Monitoring™ Team Helps Yield Virtually No Downtime

In 2014 Liquid Web yielded an incredible uptime rate of 99.995%. With their wholly owned hardware being watched over and maintained by highly trained technicians, there's no reason to doubt their promise of virtually nonexistent downtime in the future.

All server statuses are watched around the clock by the Sonar Monitoring™ team, which is trained to detect system issues quickly, and ideally have problems resolved before a hiccup even shows up on your radar.

Storm® Platform, Private Cloud, & Add-Ons

In addition to a heroic army of support, Liquid Web has 50+ developers dedicated to the build-out and up-keep of custom solutions. A great example would be their Storm® Platform: an in-house innovation based on their top-of-the-line VPS infrastructure.

With automatic migrations and provisioning and easy scaling options, the Storm® Cloud Server offers all the SSD speed and custom functionality you want in an affordable, shared cloud environment. To give users even more options, Liquid Web developers are constantly working on new projects, including the latest Storm® Private Cloud functionality and their Block Storage, Object Storage, and VPN Storm® Add-Ons.

Liquid Web VPS in a Nutshell

If you want easy scaling, screaming fast speed, custom functionalities, and unparalleled support, look no further than Liquid Web for your VPS. They own all the hardware and have a rather large development team in their corner, so the technological possibilities are pretty much limitless. We'd recommend going with their custom Storm® Servers, which offer all the power, flexibility, and scaling options you'd require of a virtual or dedicated server with the affordability and ease of use of a shared hosting solution.

collapse info -
VPS RATING
★★★★★ 4.8/5.0
  • 2-4 cores and 4-16GB of RAM
  • Endorsed by the WordPress team
  • Redundant storage and optional SiteLock security
(read more)
Starting Price/Mo. $19.99
Money Back Guarantee 30 days
Disk Space 30 GB - 240 GB SSD
Domain Name FREE (1 year)
VPS Hosting Plans www.bluehost.com/vps
Our Expert's Bluehost Review
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... read more +

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 hosting, or need the flexibility and security of a VPS, Bluehost is a great choice for you.

Bluehost’s virtual servers boast several benefits compared to standard shared hosting and other VPS offerings. The first is speed; Bluehost offers your choice of two or four cores and 4GB to 16GB of RAM with guaranteed resources, so you have the power you need when you need it. The second perk is security; Bluehost offers redundant storage and optional SiteLock protection to secure your data.

For those new to VPS hosting who may not know exactly what is needed, Bluehost makes it incredibly easy and seamless to switch between their plans to find the perfect package for you. If you have questions or need some advice, their wonderful support staff is standing by to assist 24/7.

Formed in 2003, Bluehost has long since been a hosting innovator and leader. Today, the company powers more than two million websites and carries the official seal of approval given by the WordPress.org team for their managed WordPress services hosted on their VPS platform. With years of experience, competitive pricing, and excellent support, Bluehost is a pick you can take to the bank in the VPS hosting space.

collapse info -

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.

ABOUT THE AUTHOR
Alexandra Leslie

Alexandra Leslie serves as Tech Vertical Manager of Digital Brands Inc, spearheading the charge to deliver technical expertise and thought leadership to our rapidly growing audience of developers, engineers, and website owners here at HostingAdvice. You'll find her engaging with leaders in web hosting and tangentially related industries, enjoying honest discussions of their cutting-edge technologies. She loves getting her hands dirty with comprehensive reviews of popular hosting platforms and services, and she's a die-hard WordPress fan. Alexandra leads the HostingAdvice team with a passion for translating technical jargon into digestible action items anyone can use to build, monetize, and scale a web presence.