One‑Click Remote Deployment of SpringBoot with IDEA & Docker

This guide walks you through preparing the environment, comparing traditional JAR deployment with IDEA‑plus‑Docker one‑click deployment, configuring SSH and Docker daemon, writing a Dockerfile, and setting up IntelliJ remote run configurations, culminating in a fully automated SpringBoot launch with live logs.

Top Architect
Top Architect
Top Architect
One‑Click Remote Deployment of SpringBoot with IDEA & Docker

1. Introduction

This article demonstrates how to use IntelliJ IDEA together with Docker to achieve one‑click remote deployment of a SpringBoot application, dramatically improving deployment efficiency compared with manual JAR upload and execution.

2. Prerequisites

Install Docker on the server and be familiar with a simple Dockerfile (or let GPT generate one).

Install IntelliJ IDEA on the local machine.

Have a SpringBoot project that can be packaged as a JAR (a demo project is used for illustration).

3. JAR Deployment vs. Remote One‑Click Deployment

JAR Deployment

Traditional deployment requires installing a Java runtime on the server, uploading the JAR, and starting it with java -jar. Each update forces you to stop the application, re‑upload the JAR, and start again, which is cumbersome and makes log monitoring difficult.

IDEA + Docker One‑Click Deployment

After a series of configurations, deployment can be triggered with a single click on the green triangle, automatically handling build, image creation, container start, and log streaming.

Real‑time logs are displayed directly in IDEA, making debugging much easier.

4. Configuring Remote Deployment

4.1 SSH Configuration

To connect to the server, configure SSH in IDEA (File → Settings → Search "ssh"). Using the Key pair authentication type is recommended; you can switch to Password if needed.

Reference blog for key‑pair setup:

https://blog.csdn.net/cnds123321/article/details/121947896

4.2 Docker Daemon Connection

Configure Docker daemon access in IDEA (File → Settings → Search "docker"). The Docker daemon runs on the host and manages container lifecycle, images, networking, and storage.

4.3 Writing a Dockerfile

Create a Dockerfile that defines the base image, copies the JAR, sets the entry point, and exposes the service port.

# Base image
FROM openjdk:17
# Copy JAR into image (place Dockerfile alongside the JAR)
ADD target/demo-0.0.1-SNAPSHOT.jar app.jar
# Container start command
ENTRYPOINT ["java","-jar","/app.jar","--spring.profiles.active=prod"]
# Expose port
EXPOSE 8080

Example of copying the JAR into the image:

4.4 Setting Up Remote Run Configuration

1) Open the "Create Configuration" dialog in IDEA. 2) Choose Docker as the deployment target. 3) Fill in the SSH and Docker daemon settings created above, select the Dockerfile, and specify the build context.

After saving the configuration, click the green triangle to start the build and deployment process.

When the container starts, the application runs successfully and logs appear in the IDE console.

5. Conclusion

The initial setup may be a bit involved, but once configured, deploying or updating a SpringBoot service becomes a single‑click operation, saving time and simplifying log monitoring.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

BackendDockerIntelliJ IDEADockerfileRemote Deployment
Top Architect
Written by

Top Architect

Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn together.

0 followers
Reader feedback

How this landed with the community

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.