Backend Development 9 min read

Deploy Spring Boot Apps Instantly with IDEA + Docker: One‑Click Remote Deployment

Learn how to replace manual jar uploads and java -jar commands by configuring IntelliJ IDEA and Docker for one‑click remote deployment of Spring Boot applications, covering prerequisite setup, Docker daemon basics, Dockerfile creation, and step‑by‑step configuration to streamline and automate the deployment process.

macrozheng
macrozheng
macrozheng
Deploy Spring Boot Apps Instantly with IDEA + Docker: One‑Click Remote Deployment

1. Introduction

This tutorial shows how to use IntelliJ IDEA together with Docker to remotely deploy a Spring Boot project with a single click, eliminating the need to manually build a jar, upload it to a server, and run

java -jar

.

2. Prerequisites

Install Docker on the target server and be familiar with writing a simple Dockerfile.

Install IntelliJ IDEA on the local machine.

Have a Spring Boot project that can be packaged as a jar (the demo project is used for illustration).

These steps prepare the environment for the upcoming configuration.

3. Reference Project

The tutorial references the open‑source mall project (SpringBoot3 + Vue) and its cloud version mall‑swarm , which demonstrate a complete e‑commerce system with micro‑service architecture, Docker and Kubernetes deployment.

4. Jar Deployment vs. IDEA + Docker One‑Click Deployment

Jar Deployment

Traditional jar deployment requires installing Java on the server, uploading the jar, and starting the application with

java -jar

. Each update involves stopping the service, uploading a new jar, and restarting, which is cumbersome and makes log monitoring difficult.

IDEA + Docker One‑Click Deployment

After configuring IDEA and Docker, a single click on the green run icon automatically builds the image, pushes it to the server, and starts the container, providing real‑time logs and a much smoother workflow.

5. Configuration Steps

(1) SSH Configuration

Configure SSH in IDEA (File → Settings → Search "ssh"). Use the Key pair authentication type for a stable connection; you can switch to Password if needed and later revert to Key pair .

(2) Connect to Docker Daemon

Set up Docker integration in IDEA (File → Settings → Search "docker") to communicate with the Docker daemon on the server.

Docker daemon (or Docker Engine) runs on the host and manages container lifecycle, image handling, networking, and storage. Container management: create, start, stop, delete containers. Image management: pull, build, cache, and distribute images. Network management: assign IPs and enable communication. Storage management: handle file systems, volumes, and persistent data.

(3) Write Dockerfile

Create a Dockerfile to define the image. Below is a basic example; adjust paths as needed for your project.

<code># Base image
FROM openjdk:17
# Copy the built jar into the image (place the jar in the same directory as Dockerfile)
ADD target/demo-0.0.1-SNAPSHOT.jar app.jar
# Container start command
ENTRYPOINT ["java","-jar","/app.jar","--spring.profiles.active=prod"]
# Expose the application port
EXPOSE 8080</code>

(4) Configure Remote Deployment in IDEA

1. Open the Run/Debug Configurations dialog and create a new Docker deployment configuration.

2. Fill in the SSH and Docker settings you configured earlier.

3. Save the configuration.

4. Click the green run icon; IDEA builds the image, pushes it, and starts the container automatically.

The application starts, logs appear in real time, and you can access the service via the exposed port.

Successful deployment is confirmed when the browser shows the expected response and the console displays logs.

6. Conclusion

Although the initial setup involves several steps, once configured, deploying or updating a Spring Boot project becomes a one‑click operation, dramatically improving efficiency and developer experience.

JavaDockerDevOpsSpring BootIntelliJ IDEARemote Deployment
macrozheng
Written by

macrozheng

Dedicated to Java tech sharing and dissecting top open-source projects. Topics include Spring Boot, Spring Cloud, Docker, Kubernetes and more. Author’s GitHub project “mall” has 50K+ stars.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.