Deploy SpringBoot Apps Instantly with IDEA + Docker: One-Click Remote Setup

This tutorial shows how to use IntelliJ IDEA and Docker to remotely deploy SpringBoot applications with a single click, comparing traditional jar uploads with modern containerized deployment, and provides step‑by‑step configuration, Dockerfile creation, and troubleshooting tips.

macrozheng
macrozheng
macrozheng
Deploy SpringBoot Apps Instantly with IDEA + Docker: One-Click Remote Setup

You shouldn't still be manually building jar files, uploading them, and running java -jar to deploy projects; this guide teaches you to use IDEA + Docker for one‑click remote deployment.

1. Introduction

This article teaches how to use IDEA + Docker to remotely deploy a SpringBoot project, comparing it with the traditional method of uploading a jar to a server and running it, dramatically improving deployment efficiency.

2. Jar Package Deployment vs Remote Deployment

Jar Package Deployment

Normally you install Java on the server, upload the locally built jar, and start it with java -jar. Each redeployment requires stopping the app, uploading a new jar, and restarting, which is cumbersome and makes log viewing difficult.

IDEA + Docker Remote One‑Click Deployment

After configuring the environment, redeploying only requires clicking a green triangle to complete the deployment automatically.

You can also conveniently view real‑time logs.

3. Configure Remote Deployment

(1) SSH Configuration

To connect to the server you must configure SSH (File → Settings → Search "ssh"). It is recommended to use the "Key pair" authentication type, though you can start with "Password" and switch later if needed.

(2) Connect Docker Daemon

Next configure the connection to the Docker daemon (File → Settings → Search "docker").

(3) Write Dockerfile

Create a Dockerfile to define the image for your SpringBoot application. Adjust the file according to your project needs.

# Base image
FROM openjdk:17
# Copy jar to image (place the jar in the same directory as the Dockerfile)
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

(4) Set Up Remote Deployment

1) Create a new deployment configuration.

2) Fill in the previously configured SSH and Docker settings.

3) Click the green triangle to deploy automatically.

After deployment the application starts, logs appear, and the browser shows the expected response.

Now the tutorial ends. The initial setup may be a bit involved, but subsequent deployments become extremely convenient.

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.

DockerSpringBootIDEARemote 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

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.