Chapter 11. Deploying Your Web App

I can’t speak for others, but I personally prefer programming to system administration. But the fact is that eventually you’ll need to serve your app somehow, and odds are that you’ll need to be the one to set it up.

There are some promising initiatives in the Haskell web community toward making deployment easier. In the future, we may even have a service that allows you to deploy your app with a single command.

But we’re not there yet. And even if we were, such a solution will never work for everyone. This chapter covers the different deployment options, and gives some general recommendations on what you should choose in different situations.

Keter

The Yesod scaffolding comes with some built-in support for the Keter deployment engine, which is also written in Haskell and uses many of the same underlying technologies, like WAI and http-client. Keter works as a reverse proxy to your applications, as well as a system for starting, monitoring, and redeploying running apps. If you’d like to deploy with Keter, follow these steps:

  1. Edit the config/keter.yaml file in your scaffolded application as necessary.

  2. Set up some kind of server for hosting your apps. I recommend trying Ubuntu on Amazon EC2.

  3. Install Keter on that machine (follow the instructions on the Keter website, as they will be the most up to date).

  4. Run yesod keter to generate a Keter bundle (e.g., myapp.keter).

  5. Copy myapp.keter to the /opt/keter/incoming directory on your server. ...

Get Developing Web Apps with Haskell and Yesod, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.