How to Deploy Ruoyi Microservice Backend as JAR on a Windows Server

This guide walks you through packaging the Ruoyi microservice project with Maven, copying the resulting JAR files to a Windows server, running each service with the correct Java encoding, and configuring the front‑end proxy via vue.config.js or Nginx for full deployment.

The Dominant Programmer
The Dominant Programmer
The Dominant Programmer
How to Deploy Ruoyi Microservice Backend as JAR on a Windows Server

Prerequisites

Open the Ruoyi microservice project in IntelliJ IDEA, stop any running services, and ensure MySQL, Redis, Nacos, and configuration files are correctly set up.

Package the project

In the project’s bin directory there are two .bat files that execute Maven clean and package. You can also use the Maven panel in IDEA to run clean and package under the top‑level ruoyi module.

After a successful build, all modules are packaged into JAR files.

Navigate to the project directory; each module’s JAR appears in its respective folder.

Deploy to Windows

Copy the gateway, authentication, system, and business module JARs to a chosen path on the Windows server.

Open a cmd window in that directory and start each service in order, for example: java -jar ruoyi-auth-2.2.0.jar Repeat the command for the remaining three JARs.

Fixing encoding issues

If the services fail with errors such as "Failed to configure a DataSource: 'url' attribute is not specified..." it is caused by incorrect YML file encoding when Nacos reads the configuration.

Run the JAR with UTF‑8 encoding explicitly:

java -Dfile.encoding=utf-8 -jar xxx.jar

Front‑end testing

After the back‑end services are up, test the API from the local front‑end project. Ensure the gateway port on the server is open.

Modify ruoyi-ui/vue.config.js to proxy requests to the server’s IP and gateway port.

Optional Nginx proxy

If you prefer not to run the front‑end with VSCode, build the front‑end project and serve it behind Nginx. Refer to the linked blog for a full Windows‑Nginx deployment tutorial.

https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/108120070

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.

JavamicroservicesMavenNginxWindows serverRuoYiJAR deployment
The Dominant Programmer
Written by

The Dominant Programmer

Resources and tutorials for programmers' advanced learning journey. Advanced tracks in Java, Python, and C#. Blog: https://blog.csdn.net/badao_liumang_qizhi

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.