My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more
How to deploy your first website on netlify?

How to deploy your first website on netlify?

Kiran Rai's photo
Kiran Rai
·Jun 7, 2021·

2 min read

There are many platforms which can be use to deploy your website without any cost but let me talk about my favourite, netlify. It is a platform where you can deploy your static website(build with html, css and javascript) free of cost. The process is very simple but if you have never deployed your website than it might cause you some problem.

There are two methods through which you can deploy your website on netlify –

  1. By dragging and dropping you folder where all your html, css and javascript files are present.
  2. Deploying through github, if you have github account and repository where your html,css and javascript files are present than you can simply link your repository to the netlify account. Which method is the best one? According to me the second method is the best one because it give you flexibility to make any changes to your website with the help of git and github where as in the first method if you want any changes than you have to delete the website from netlify account and again re deploy it to see the changes. But if you are just starting and don’t have any knowledge about git and github than you should go for the first method. Netlify make your website live and anyone can visit it through an url generated by it. You can also buy a custom domain name but it will cost you some penny so as a beginner I advise you to go with the free account.

Important point to note while deploying your website on netlify:- The most important point to be noted is that while making folders for your respective files such html, css and javascript, don’t put html file to any sub-folder keep it in the main folder itself and name it as index.html, if you give any other name to your html file than you cannot deploy it. Html file should be the head node and other files should link with it. Steps to make folders and subfolders for files:-

  1. Make a directory for your project. Eg:- blog
  2. Keep your index.html file inside that directory.
  3. Make subfolders for your images, css file and javascript file. Eg- Blog -> index.html , css(sub-directory), images (sub-directory), javascript(sub-directory).
  4. Keep your files to their respective sub-directories
  5. Now you ready to deploy your website

Now your website will be live and you can easily share the url to your friends, relative or anyone to see the website. I hope you have learn something new today and also you know how to deploy a website on netlify so, enjoy your coding journey and help others too to deploy their first website.