Use-case and Deployment Scenarios - Version 2.5.0

Use-case and Deployment Scenarios

How can I use and deploy Akka?

Akka can be used in different ways:

  • As a library: used as a regular JAR on the classpath and/or in a web app, to be put into WEB-INF/lib
  • As an application packaged with sbt-native-packager
  • As an application packaged and deployed using Lightbend ConductR.

Native Packager

sbt-native-packager is a tool for creating distributions of any type of application, including Akka applications.

Define sbt version in project/ file:


Add sbt-native-packager in project/plugins.sbt file:

addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.1.5")

Follow the instructions for the JavaAppPackaging in the sbt-native-packager plugin documentation.

In a Docker container

You can use both Akka remoting and Akka Cluster inside of Docker containers. But note that you will need to take special care with the network configuration when using Docker, described here: Akka behind NAT or in a Docker container

For an example of how to set up a project using Akka Cluster and Docker take a look at the "akka-docker-cluster" sample.