- Published on
Free Static Website Hosting With a Custom Domain Name
- Authors
- Name
- Harendra Kumar Kanojiya
- @harendraverma2
Do you already own a custom domain name and a static website that you'd want to host for free? Yes, truly free of charge, with no advertisements!
Thanks to surge.sh for making it possible.
Steps:
- Install the most recent Nodejs version.
- Run the following command to install surge-cli:
npm install --global surge
- Now, log in to your custom domain provider account (e.g., GoDaddy, NameCheap, 1and1) and navigate to the DNS setting page for CNAME configuration.
- Create a new CNAME record for your domain.
- Change the hostnames @ and www to:
na-west1.surge.sh
Here is a step-by-step guide for configuring CNAME for surge.sh.
Deploying to your own domain
You may now deploy your project to your own domain. You may use the Surge command line tool to perform the following command:
surge path/to/my-project my-custom-domain.com
That's it!
After some time, you should be able to visit your custom-domain-name> and it should load the webpage from surge.sh.