How to Self-Host a Website on a Freename Web3 Domain
Welcome to the step-by-step guide on how to set up you own Website hosting on a Web3 Domain
Prerequisites
The next steps will require you to use your terminal and run some commands.
1. Installing NGINX
sudo apt update
Install NGINX:
Start and enable NGINX:
sudo systemctl start nginx
sudo systemctl enable nginx
2. Configuring NGINX for Your Domain
sudo mkdir -p /var/www/yourdomain.yourtld/html
Set Permissions:
sudo chown -R $USER:$USER /var/www/cederico.metaverse/html
Create a Sample HTML File:
Edit a new file in this directory (/var/www/yourdomain.yourtld/html/index.html)
and add your HTML content.
Configure NGINX to Serve Your Site:
Create a new configuration file in /etc/nginx/sites-available/cederico.metaverse
and add the following:
server {
listen 80;
listen [::]:80;
root /var/www/cederico.metaverse/html;
index index.html;
server_name cederico.metaverse www.cederico.metaverse;
location / {
try_files $uri $uri/ =404;
}
}
Enable the file by creating a link:
sudo ln -s /etc/nginx/sites-available/yourdomain.yourtld /etc/nginx/sites-enabled/
Test NGINX Configuration:
sudo nginx -t
Reload NGINX:
sudo systemctl reload nginx
3. Adjusting the Firewall
sudo ufw allow ‘Nginx Full’
4. Testing your Website
You should see your static HTML page.