Skip to content

How to Self-Host a Website on a Freename Web3 Domain

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

A Linux Server: Ensure you have a Linux server (like Ubuntu) with root or sudo access.Your Domain Name should be a registered domain name.DNS Configuration: The domain should point to the IP address of your server. This is done via an A record in your DNS settings.
The next steps will require you to use your terminal and run some commands.

1. Installing  NGINX

Update Package List:

sudo apt update

Install NGINX:

sudo apt install nginx

Start and enable NGINX:

sudo systemctl start nginx
sudo systemctl enable nginx

2.  Configuring NGINX for Your Domain

Create a Directory for Your Site:

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

if you have a firewall, allow traffic to NGINX:

sudo ufw allow ‘Nginx Full’

4. Testing your Website

Open a web browser and navigate to http://yourdomain.yourtld
You should see your static HTML page.

Additional Notes

SSL/TLS: Consider setting up SSL/TLS for secure HTTPS access. This can be done using Let’s Encrypt.

Custom HTML: Customize your /var/www/cederico.metaverse/html/index.html with the desired HTML content.

Domain Propagation: It may take some time for DNS changes to propagate.

This guide assumes a basic setup. Depending on your needs, you might want to explore advanced NGINX configurations, security enhancements, and performance optimizations.

Related Articles