One-Click Remote Deployment of SpringBoot Projects with IntelliJ IDEA and Docker
This tutorial explains how to set up IntelliJ IDEA and Docker for one‑click remote deployment of a SpringBoot application, covering prerequisite installations, SSH configuration, Docker daemon basics, Dockerfile creation, and the step‑by‑step configuration within IDEA to streamline project deployment and log monitoring.
This article demonstrates how to use IntelliJ IDEA together with Docker to achieve one‑click remote deployment of a SpringBoot project, comparing the traditional manual java -jar approach with the automated IDE+Docker workflow.
Prerequisites : Install Docker on the server, install IntelliJ IDEA locally, and have a SpringBoot project that can be packaged as a JAR.
Jar Deployment vs Remote Deployment :
Jar deployment requires uploading the JAR to the server, stopping the existing process, uploading the new JAR, and restarting the application using java -jar , which is cumbersome.
IDEA+Docker remote deployment allows you to configure SSH, Docker daemon connection, and a Dockerfile so that clicking a green triangle in IDEA builds the image and deploys the container in a single step, also providing real‑time log viewing.
Configuration Steps :
Set up SSH in IDEA (File → Settings → Search "ssh"). Choose Key pair authentication for smoother connections.
Configure Docker daemon access in IDEA (File → Settings → Search "docker").
Write a Dockerfile for the SpringBoot application. Example: # 基础镜像 FROM openjdk:17 # 复制主机jar包至镜像内,复制的目录需放置在 Dockerfile 文件同级目录下 ADD target/demo-0.0.1-SNAPSHOT.jar app.jar # 容器启动执行命令 ENTRYPOINT ["java","-jar","/app.jar","--spring.profiles.active=prod"] EXPOSE 8080 Place the Dockerfile alongside the JAR file. In IDEA, create a new Remote Deployment configuration, specify the SSH host, Docker daemon, and the Dockerfile path. After saving the configuration, click the green run triangle to build the image, push it to the server, and start the container automatically.
The article includes screenshots of the IDEA settings, Docker daemon explanation, and the final running result showing successful HTTP response and live logs.
By following these steps, developers can significantly speed up backend deployment workflows and enjoy convenient log monitoring directly from the IDE.
Top Architecture Tech Stack
Sharing Java and Python tech insights, with occasional practical development tool tips.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.