Version 2, last updated by jaredcasper at December 26, 2011 19:21 UTC

Lift applications can be deployed to the Run@CloudBees cloud hosting platform. As of May 2011, the company allows free Tomcat-based .war file application hosting, with an optional MySQL instance.

There’s nothing special you need to do with your Lift app to deploy to CloudBees. You can use their command-line tools to deploy your .WAR file or try the CloudBees SBT Plugin.

However, there are two points to note:

  • Free web applications are hibernated after a few hours of inactivity. They are automatically relaunched on a web request.
  • Cloudbees does not allow you to directly set the Lift run.mode, meaning your will run in development mode. But we have a fix for that…

Setting run.mode

Tim’s original solution to this problem is to replace the Lift filter in web.xml with an alternative which forces the run.mode to be “production”. You can read about this on the Lift mailing list.

A modified version makes use of a CloudBees-specific WEB-INF configuration file to switch to production mode based only when running in the CloudBees environment. The code for this is on GitHub.