Use FRP to Map a Local Minecraft Port to a Public VPS for Multiplayer Preparation
Client
Server (a VPS with a public IP)
Example setup
Client (macOS)
Server (Debian)
1) Log in to the server ssh root@your-public-server-ip
2) Download and install frp cd /rootwget https://github.com/fatedier/frp/releases/download/v0.68.0/frp_0.68.0_linux_amd64.tar.gz tar -xzf frp_0.68.0_linux_amd64.tar.gz mv frp_0.68.0_linux_amd64 /opt/frp
The main files after installation are:
/opt/frp/frps /opt/frp/frpc
3) Create the server configuration file Edit with vim: 1.
If vim is missing, install it first, then run step 1 again:
Add this content:
bindPort = 7000 auth.method = "token" auth.token = "mc-frp-super-secret-token-please-change" transport.tls.force = true
What these fields mean
bindPort = 7000 The server listens on 7000 (you can change it) and waits for client connections.
auth.method = "token" Use token-based authentication.
auth.token = "..." The client and server values must match.
transport.tls.force = true Force the client to use TLS.
4) (Optional) Create a systemd service so it auto-starts after VPS reboot Edit:
vim /etc/systemd/system/frps.service
Add:
[Unit] Description =frp serverAfter =network.target syslog.targetWants =network.target[Service] Type =simpleExecStart =/opt/frp/frps -c /opt/frp/frps.tomlRestart =alwaysRestartSec =3 [Install] WantedBy =multi-user.target
5) Start the service systemctl daemon-reload systemctl enable frps systemctl start frps systemctl status frps --no-pager
If you see active (running), the server is up.
6) Open firewall ports ufw allow 7000/tcp ufw allow 25565/tcp ufw reload ufw status
What these two ports are for
2) Client-side steps 1) Confirm Minecraft is listening on local port 25565 After entering your Minecraft world, open LAN in the menu and set the port to 25565 (or any other port you plan to use later).
Run in terminal:
lsof -iTCP:25565 -sTCP:LISTEN -n -P
You should see:
java ... TCP *:25565 (LISTEN)
This means your local Minecraft server is running.
2) Install frpc Note that installation commands differ by system. macOS:
Windows:
3) Create the client configuration file mkdir -p ~/frpvim ~/frp/frpc.toml
Add:
serverAddr = "enter-your-server-ip-here" serverPort = 7000 auth.method = "token" auth.token = "mc-frp-super-secret-token-please-change" transport.tls.enable = true [[proxies]] name = "minecraft-25565" type = "tcp" localIP = "127.0.0.1" localPort = 25565 remotePort = 25565
4) Start the client
When successful, key logs are:
login to server success proxy added: [minecraft-25565] start proxy success
5) Friends connect using the public address On the Minecraft home screen -> Multiplayer -> Direct Connect or Add Server, enter IP and port: