video-15;
How To Make Your Own PC a Web Hosting Server? | Nginx Webserver | [Nepali]
1-own-web-server-using-nginx-server-on-windows-10
From Quora bots:
Yes, you can host your own website using your own computer. Here’s a step-by-step guide on how to do it:
1. Choose Your Web Hosting Software
Web Server Software: You need to install web server software. Popular options include:
Apache: A widely used open-source web server.
Nginx: Known for its performance and low resource usage.
IIS: If you’re using Windows, Internet Information Services (IIS) is a built-in option.
2. Install the Web Server
For Apache (on Windows/Mac/Linux):
Windows: Use XAMPP or WAMP, which packages Apache, PHP, and MySQL together.
Linux: Install via package manager (e.g., sudo apt install apache2 for Ubuntu).
For Nginx:
Install using a package manager (e.g., sudo apt install nginx).
For IIS:
Enable it through Windows Features.
3. Configure Your Web Server
Set up your web server’s configuration files to define your website’s settings, such as the document root (where your website files are stored).
For Apache, this is typically located in /etc/apache2/sites-available/ on Linux or in the httpd.conf file on Windows.
4. Create Your Website Files
Build your website using HTML, CSS, JavaScript, and any other necessary files.
Place these files in the document root directory specified in your web server configuration.
5. Test Your Website Locally
Open a web browser and enter or to see if your website is running correctly.
6. Make Your Website Accessible Externally
Port Forwarding: Access your router settings and set up port forwarding for port 80 (HTTP) and/or 443 (HTTPS) to your computer’s local IP address.
Dynamic DNS (optional): If you don’t have a static IP address, consider using a Dynamic DNS service to map a domain name to your changing IP address.
7. Secure Your Website
Consider using HTTPS by obtaining an SSL certificate. You can get free certificates from services like Let’s Encrypt.
Update your firewall settings to allow traffic on the necessary ports.
8. Keep Your Server Updated
Regularly update your web server software and any other software you use to ensure security and performance.
Additional Considerations
Performance: Your home internet connection may not provide the best performance or uptime compared to professional hosting services.
Security: Hosting a website from home can expose your network to security risks. Make sure to secure your server and keep software updated.
Legal and ISP Policies: Check your Internet Service Provider’s policies to ensure that hosting a website from home is allowed.
By following these steps, you can successfully host your own website from your computer!
Let’s do it:
Note: While doing this project, you are most likely to come across your ISP block port forwarding or your ISP is implemented CGNAT concept in this scenario, your webserver as hosting static files on internet will not work out side of your router. To expose your static files on local webserver on the router you need portforwarding but it’s most likely you cannot do that because nowadays our internet provider(ISPs) use CGNAT concept on public ipv4.
The solution is:
1. Use Static IP ( which you have to pay extra charge for ISP)
2. Contact your ISP and tell them to allow portforwarding on your router just for testing purpose.(but it’s most likely they will not reply straight forward)
3. Third solution is to use Tailscale VPN or any third party tool to bypass CGNAT on your router. I recommend tailscale. Just for the quick solution, you can use VSCODE editor and setup portforwarding via terminal. You can check more videos on my channel about: Tailscale, NAT, CGNAT topics. Thanks