Deployment
Once you've designed your site and written your first page of content you want to get it out there for all the world to see.
Nesta sites can be served dynamically (with pages rendered in real-time on the server) with any web server that supports recent versions of Sinatra and Rack. There are plenty of good options, but we'd recommend Puma.
In the pages below we're going to look at how to deploy Nesta:
- with pre-rendered static HTML (on Netlify) and
- with server-side rendering, either on Heroku, on a VPS, or on your own hardware
These aren't the only hosting platforms you could deploy Nesta to — it'll work anywhere that runs Ruby.
-
Deploying to Netlify
Netlify is ideal for static site generators, so it's a great place to host Nesta sites that don't have any dynamically generated pages. Also, it's free.
-
Deploying to Heroku
Heroku was one of the first "Platform as a Service" cloud based hosting platforms. Running Nesta on Heroku is easy, and it's probably fair to say that most Nesta sites are deployed on Heroku.
-
Deploying with Vlad
Though Heroku is awesome, it isn't for everybody. You get more flexibility if you deploy Nesta to your own web server.
-
Publishing Articles with Git
This article will show you how to store the contents of your Nesta web site in a local Git repository, and publish changes by running a single git command. It's not relevant if you're deploying to Heroku.
-
Setting up page caching
If you run your Nesta site on a server or VPS (rather than on a platform like Heroku) your site's performance may benefit from page or fragment caching. Nesta no longer provides support for page caching itself; instead we rely on
sinatra-cache
to do it for us.