DEV Community

Cover image for How to Host Website on Netlify for FREE
Vicky Shinde
Vicky Shinde

Posted on • Edited on

30

How to Host Website on Netlify for FREE

Hosting a website on Netlify is a straightforward process. Here are the steps to get your site up and running:

Create a Netlify Account:

Go to Netlify's website and sign up for a free account if you don't have one.

Image description

Connect Your Git Repository:

  • After logging in, click on "New site from Git".
  • Connect to your Git provider (GitHub, GitLab, or Bitbucket) and authorize Netlify to access your repositories.

Choose Your Repository:

  • Select the repository that contains your website code.
  • Netlify will automatically detect the build settings. If it doesn't, you can specify the build command and the publish directory (e.g., npm run build and dist).

Build and Deploy:

  • Click "Deploy site" Netlify will start the build process and deploy your website.
  • Once the build is complete, Netlify will provide you with a temporary URL where your site is live.

Custom Domain (Optional):

  • If you have a custom domain, you can add it to your Netlify site.
  • Go to "Domain settings" in your site's dashboard.
  • Click on "Add custom domain" and follow the instructions to configure your DNS settings.

Continuous Deployment:

  • Every time you push changes to your repository, Netlify will automatically rebuild and redeploy your site.

Additional Features:

  • Form Handling: Netlify offers built-in form handling without any backend code.
  • Redirects and Rewrites: You can configure redirects and rewrites using a _redirects file or netlify.toml.
  • Environment Variables: You can set environment variables for your build process in the site settings.
  • Functions: Netlify supports serverless functions that can be used for dynamic back-end processing.

Example:

Here’s an example for deploying a simple static HTML site:

  • Create a repository on GitHub and push your site’s code to it.
  • Connect the repository to Netlify as described above.
  • Since it’s a static site, you might not need any build command. You can directly specify the publish directory where your HTML files are located.
  • Deploy and check your site.

That’s it! Your site should now be live on Netlify.

Reinvent your career. Join DEV.

It takes one minute and is worth it for your career.

Get started

Top comments (0)

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay