To start with the web UI, head to https://app.netlify.com and sign in.
For anything larger than a one page landing, you really should be using a static site generator or a front-end build tool like grunt or gulp.
If you’re using any of those, Netlify can make the process of collaborating and deploying much smoother.
Netlify lets you link a GitHub repository to a site. Each time you push to GitHub, Netlify runs a build with your tool of choice and deploys the result to our powerful CDN.
If you are creating a new site on Netlify, or just moving a pre-existing site onto the platform, it’s good to keep the following things in mind:
NodeJS (including React)
If the static site generator you are using is built with NodeJS:
Make sure your
package.json contains the name of your tool. Do so by running the following command in your terminal:
npm install TOOLNAME --save
If your project directory has the same name as your tool, the above command will fail. So make sure your project name is something different.
You also need a
.nvmrc file at the root of your project to tell Netlify which version of NodeJS to use. In the terminal, enter this command:
node -v > .nvmrc
To create a file to tell Netlify which version of Node.js to use. The version of node you use is dynamically fetched using
nvm and then cached to speed up builds. If you don’t specify a version, we default to using node 8 as of this writing (March 2018).
If you are using a static site generator built with Ruby:
You need a
Gemfile and a
Gemfile.lock to tell Netlify which versions of your preferred tool to use. If there isn’t one, run the following command from the root directory of your project in the terminal:
Open the resulting Gemfile in your favorite text editor. Replace the following line:
# gem "ruby"
with this line:
Make sure you delete the #, then save.
Now run this command:
This will install the gem for the tool you’ve chosen and create a file called Gemfile.lock. This file will ensure that Netlify always uses the same version of your tool that you used to build your site, thus avoiding any nasty surprises.
We also recommend specifying a version of Ruby that matches your build environment. You can set a Ruby version via a
/.ruby-version file. You must choose from among rvm’s supported versions. As of this writing, the following versions are already installed and will create the fastest builds:
If your static site generator is built with Python:
It’s usually a good idea (but not necessary) to set up a virtual environment for Python projects. If you don’t know how to do so, follow these directions.
You want to make sure that Netlify knows exactly which versions of various Python plugins you are using. Do this by creating a file called
requirements.txt in your project’s root directory:
pip freeze > requirements.txt
You can tell Netlify which version of Python to use to build your site by placing a
runtime.txt file in your project’s root directory. We currently support versions 2.7, 3.4, 3.5, and 3.6.