Creating a web server at home isn’t really too much of a complicated hassle. If you’re willing to use your PC to host a website, you have enough storage to save the website’s data and files, your internet gives you good download and upload speeds, and your PC can run for 24 hours a day to ensure uptime for your website, you might as well get your own Web Server for FREE!
However, the recommended option is still to opt for a web hosting service. A web hosting provider can help you access better storage needs, internet, and security, but that’s not all.
Hosting plans aren’t too expensive either. Providers like Googiehost can have your website up for running for free, or Hostinger can help you get a free website for just $1.99.
Still keen on having your own web server? Let’s start with the right steps to having your own web server for web hosting.
Step 1: Setting Up Your PC And Internet
Your PC will act as a web server. This means it will store all the website’s files and host the website that will be running on the internet.
Your PC doesn’t need to be a strong one. Anything with good storage space and processing speed can work just fine.
Here are the basic requirements for a PC hosting a website:
- 2GB RAM
- 2GHZ Processor (2 cores)
- 100 GB Hard Drive (at least 30 GB free)
- US port and DVD Drive
- Updated operating system and firewall protection
- No power issues- can run 24/7
Almost everyone would have a PC that can satisfy those requirements, so let’s jump into the internet connection requirements.
The internet aspect will help users from different MAC addresses, connected to different networks, access your website on the internet.
This means your internet’s upload speed should be great.
Most home internets offer good download speed but not much for an upload speed.
The internet speed you require depends on how many visitors your website hosts.
Here are the internet requirements for hosting a website:
- At least 20 Mbps download speed
- At least 20 Mbps upload speed
- Free Ports 80 and 443
Step 2: Linux vs. Windows
The next step would be choosing the right operating system to run on your PC.
The only practical options are Windows OS or Linux OS.
Most websites, around 70%, use Linux for hosting websites.
However, Windows is the more popular choice of OS installed on most computers.
The table below breaks down the pros and cons of choosing Windows or Linux to host a website.
My personal recommendation: Go for Linux. If you’re deciding to host a website by yourself and not do it the easy way by going for a hosting plan, why should you compromise on functionalities just because Windows is an easier platform to work on? For a starter, consider the Ubuntu distro which works best for ex-windows users.
|Most popular for web hosting||Less compatible with apps|
|Free||Complicated for users switching from Windows|
|Fewer hackers and malware attacks|
|Friendlier and familiar OS environment||Paid License|
|Compatible with most apps||Less secure from hackers or malware|
|Automatic software updates|
|Easier to use|
Step 3: Hosting A Server
Now that your machine has a good internet connection and is running a reliable operating system, the next step is to get the right software and tools to create a server.
There are many applications that can help you host a server. Here, we will consider only the most popular and reliable options for either operating system.
If you’re running Windows, your computer needs Apache, MySQL, and PHP to host a server.
This is called a WAMP server (Windows, Apache, MySQL, and PHP). The complete package for this is XAMPP.
Download and install XAMPP. XAMPP will take care of your Apache, MySQL, and PHP needs.
Once it is installed, stick to the default settings.
Now you will need the XAMPP server to use the site files you choose.
The host directory for this should be C:\xampp\htdocs.
If you want to choose a website template or use WordPress to build your website easily, download and extract their files into this directory.
Lastly, you will need to make your website public. Once you’re satisfied with your website, go to Apache, and select the httpd.conf file, and change the settings to the following:
Order Allow, Deny
Allow from all
And that is all!
Your website should now be public and accessible through the world wide web!
Note: For ease of accessibility, purchase a domain name that can help users from all around the world access your website. If you want to try a free domain, click here.
For a Linux PC, you will need LAMP. That are Linux, Apache, MySQL, and PHP.
To install those tools, head to the Linux terminal and type in:
- sudo apt install apache2 Mysql-server Php libapache2-mod-php7.0
Once the software is downloaded, you will need to add the website’s files to its directory.
Just like with WAMP, head towards the root directory and make use to use the .php file extension.
All of that should complete your website’s layout.
Now configure Apache and allow all permissions to help your website be accessed on the World Wide Web.
That is all!
Congratulations! You have successfully created your own web server at home for web hosting in 3 simple steps!
And you did it without relying on a hosting provider, offering you complete control over the website.
Good luck and have fun!
On a side note, if you want a website but want to keep it limited to a local network, check out our guide on how to host a website in a personal network.