Hosting your website with Netlify

Gaute Meek Olsen
1 min readOct 22, 2019

--

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 💙

p.s. check out my similar article for how to deploy with Firebase.

--

--