To set up your own server for web hosting, follow these key steps outlined in the article from CodeX on Medium:
1. **Buy a Domain Name**: Register a domain through a registrar like Namecheap.
2. **Choose a Server Provider**: Select a server provider such as Vultr, which offers affordable plans starting at $5 per month. You can sign up for a 14-day free trial with $100 credits to test their services.
3. **Server Configuration**:
- Create a server by selecting "Cloud Compute" and "Regular Performance" on Vultr.
- Choose Debian as the operating system and the $5 server size.
- Disable auto-backups and deploy your server.
4. **Connect Domain to Server**:
- Access your Namecheap dashboard, go to the "Advanced DNS" tab, and add your server's IPv4 and IPv6 addresses using A and AAAA records.
5. **SSH into Your Server**: Use SSH to connect to your server with the command:
```
ssh
[email protected]
```
6. **Install NGINX**:
- Update your server with:
```
sudo apt update && sudo apt upgrade
```
- Install NGINX using:
```
sudo apt install nginx
```
7. **Allow HTTP/HTTPS Ports**:
- Run the following commands to allow traffic:
```
ufw allow http
uf