A Spring Boot application can be deployed in a few standard ways, depending on how much control you need over the runtime environment.
Key Points: • As a standalone executable JAR with an embedded server (Tomcat, Jetty, or Undertow), run directly with java -jar app.jar. • As a traditional WAR file deployed to an external servlet container like Apache Tomcat or WebLogic. • As a Docker image, packaging the JAR and JVM together for consistent deployment to any container platform. • Onto Kubernetes, where the Docker image is deployed as a Pod with defined resource limits, health checks, and scaling rules. • To a cloud PaaS (AWS Elastic Beanstalk, Azure App Service, Google Cloud Run) that runs the JAR or container for you.
Example: A typical modern setup builds the app into a Docker image with a Dockerfile based on eclipse-temurin, pushes it to a container registry, and deploys it to a Kubernetes cluster with a Deployment and Service manifest.
Interview Tip: A concise interview answer is:
"The simplest option is packaging as a self-contained JAR with an embedded server and running it with java -jar. For enterprise environments you can still build a WAR for an external Tomcat, but the more common modern path is containerizing the app with Docker and deploying it to Kubernetes or a cloud PaaS for scaling and orchestration."