DEV Community

Cover image for Hosting your website with Netlify

Hosting your website with Netlify

Gaute Meek Olsen
Developer at heart
・1 min read

I love how easy it is to set up automatic hosting of a website with Netlify.

Sign in to Netlify and click the "New site from Git" button. Select your git repository, either GitHub, GitLab or Bitbucket, and give access to the wanted repository.

If you have build commands, such as npm run build, you can enter those. Commands can be chained with &&.

Enter the path of the directory to publish. The directory containing the index.html file

Now hit Deploy site and you are done. New pushes to your git repository will automatically be published to your website. You can change your subdomain in "Site settings" and "Change site name".

Terminal commands you don't need, but might find useful:

# Install netlify cli globally
npm install netlify-cli -g

# Serving your site on localhost
netlify dev

# Connect folder to Netlify project
netlify init

# Serve your local development online ang get a url you can distribute
netlify dev --live

# Manually deploy
netlify deploy --prod

That's all, thank you for reading πŸ’™

This article is part of Hosting a Website series, I usually choose Firebase when I want to deploy manually or are using other Firebase products and Netlify if I want CD (continuous delivery). Though both manually and CD is possible to achieve with both of them.

Discussion (7)

aortizoj15 profile image
Alexis Ortiz Ojeda

Great article! It is crazy how easy it is to host a site on Netlify, I host my blog on there and it makes it very easy! Thanks for the article!

cescquintero profile image
Francisco Quintero πŸ‡¨πŸ‡΄

I tried it a couple of weeks back and I'm still amazed about how easy and wonderful it works.

What a service.

usamaraudo profile image
Usama Raudo

Can you tell your experience about hosting it on Netlify?

I mean their support, their pricing, their services?

gautemeekolsen profile image
Gaute Meek Olsen Author

My experience has been very pleasant, everything has just worked right away. So I have never had the need for any support. They have a very generous free price tier, so you might get everything you need for free. Usually you would upgrade if you need other features such as analytics or the possibility to add multiple team members and owners.

But I have only used Netlify for my own small projects. So I have not used other services from Netlify or tested how it scales.

albertomontalesi profile image

I'm hosting 2 Gatsby sites and one Angular app on Netlify for free. Super easy to use, I found out about it on the podcast and I love it

cescquintero profile image
Francisco Quintero πŸ‡¨πŸ‡΄

Netlify is great. A good alternative is Zeit. Both wonderful services with a free tier.

gautemeekolsen profile image
Gaute Meek Olsen Author

Cool, thanks! I hadn't heard about Zeit before, but it looks great. I will check it out :)