DEV Community

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

Posted on • Edited on

35

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.

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay