> Markdown version of [Docker Deployment](https://vaadin.com/docs/next/flow/production/docker). Section index: [llms.txt](https://vaadin.com/docs/next/flow/llms.txt)

# Deploying Using Docker

A [Docker container](https://docs.docker.com/get-started/overview/) is a standalone, executable package of software that includes everything needed to run an application: Code, runtime, system tools, system libraries, and settings. Building a Docker image requires creating a `Dockerfile` which is a text document containing all the commands for assembling and running the image.

## <a id="creating-a-dockerfile-for-new-vaadin-applications"></a>Creating a Dockerfile for New Vaadin Applications

For a new Vaadin application, you can generate a `Dockerfile` by selecting the **Docker config** option in <https://start.vaadin.com> in the **Settings** tab. This approach makes building and running your container as simple as running the following commands:

1. Run the following command to make a production build of the Vaadin application:

   ```terminal
   mvn clean package
   ```

2. Run the following command to build your container:

   ```terminal
   docker build . -t myapp:latest
   ```

   > **Note:** The command assumes your project name is `myapp`; replace `myapp` with the name of your project if it’s not.

3. run the following command to run your container on localhost:

   ```terminal
   docker run -p 8080:8080 myapp:latest
   ```

> **Note: Docker Desktop or Docker Server is required**
>
> You need to install [Docker Desktop](https://docs.docker.com/desktop/) or [Docker Server](https://docs.docker.com/engine/install/) on your machine before you can run the above commands.

## <a id="adding-a-dockerfile-to-existing-vaadin-applications"></a>Adding a Dockerfile to Existing Vaadin Applications

The following example shows a suitable Dockerfile for Spring Boot-based Vaadin applications. You get a similar file when you download a project from <https://start.vaadin.com>.

`Dockerfile`

```dockerfile
FROM eclipse-temurin:25-jre
COPY target/*.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/app.jar"]
```

Once you have a `Dockerfile` in the project directory, you can build and run your container using the `docker build` and `docker run` commands shown earlier.

You can find more information on `Dockerfile` and the instructions that are available for it at <https://docs.docker.com/engine/reference/builder/>.

`08DE0256-3D68-4F05-9092-F8ACB1A16C64`
