Go to your domain registrar (like GoDaddy, Namecheap, etc.)
Set the A record of your domain to point to your server's IP address
Depending on what web server you use (Apache or Nginx), update the configuration:
For Apache:
Edit your virtual host file (usually in /etc/apache2/sites-available/)
Set ServerName to your new domain
Example:
For Nginx:
Update your Nginx config (usually in /etc/nginx/sites-available/)
Restart Apache or Nginx after updating:
Run the following commands (replace yourdomain.com with your domain):
If you want to use SSL (HTTPS), install a certificate (like from Let's Encrypt) and configure your server accordingly.