Operations 8 min read

How to Set Up a Java Minecraft Server on Windows and Enable Public Access with cpolar

This step‑by‑step guide explains how to install Java, configure a Minecraft Java Edition server on Windows, create a startup batch file, adjust server properties, test LAN connectivity, and use cpolar to expose the server to the internet with both temporary and fixed TCP tunnel addresses.

Java Captain
Java Captain
Java Captain
How to Set Up a Java Minecraft Server on Windows and Enable Public Access with cpolar

Introduction

This tutorial shows how to set up a Java edition Minecraft server on a Windows machine and use cpolar to expose the server to the public without a public IP or router configuration.

1. Build the Minecraft Server

1.1 Install Java

Download and install Java 17 (JDK) from Oracle. After installation, note the JDK path, e.g., C:\Program Files\Java\jdk-17.0.5 .

Open “Advanced System Settings”, go to “Environment Variables”, create a new system variable JAVA_HOME with the JDK path, and add %JAVA_HOME%\bin to the Path variable. Verify the installation by running javac in a command prompt.

1.2 Configure the Server

Download the latest Minecraft server JAR from the official site. In the folder containing the JAR, create a text file named run.bat with the following content:

java -Xms1G -Xmx2G -jar server.jar nogui
pause

Run the batch file to generate the required files, then edit eula.txt and change eula=false to eula=true . Edit server.properties to set online-mode=false (disable authentication) and adjust other settings as desired. Run the batch file again to start the server.

2. Test LAN Connectivity

Open the Minecraft launcher, add a new multiplayer server with the local IP address and port 127.0.0.1:25565 , and verify that you can join the server on the same LAN.

3. Public Remote Connectivity

3.1 Install cpolar

Download the Windows zip package from the cpolar website, extract it, and install.

3.2 Create a Tunnel

Open the cpolar web UI at http://127.0.0.1:9200 , log in, and create a new TCP tunnel that maps local port 25565 to a random public TCP port. After creation, note the generated address, e.g., 3.tcp.vip.cpolar.cn:10786 .

3.3 Test Public Connection

In the Minecraft launcher, add a server using the cpolar address 3.tcp.vip.cpolar.cn:10786 . You should be able to join the world from a remote location.

4. Configure a Fixed TCP Port

Upgrade to a professional cpolar plan, reserve a fixed TCP address (e.g., 5.tcp.vip.cpolar.cn:12637 ), and edit the existing tunnel to use this reserved address instead of a random one. After updating, the public address remains constant, allowing stable remote access.

JavawindowsServer Setupnetwork tunnelingcpolarMinecraft
Java Captain
Written by

Java Captain

Focused on Java technologies: SSM, the Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading; occasionally covers DevOps tools like Jenkins, Nexus, Docker, ELK; shares practical tech insights and is dedicated to full‑stack Java development.

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.