Use FRP to Map a Local Minecraft Port to a Public VPS for Multiplayer

Preparation

  1. Client
  2. Server (a VPS with a public IP)

Example setup

  1. Client (macOS)
  2. Server (Debian)

1) Log in to the server

ssh root@your-public-server-ip

2) Download and install frp

cd /root
wget 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.

vim /opt/frp/frps.toml

If vim is missing, install it first, then run step 1 again:

apt install vim
  1. 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 server
After=network.target syslog.target
Wants=network.target

[Service]
Type=simple
ExecStart=/opt/frp/frps -c /opt/frp/frps.toml
Restart=always
RestartSec=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

  • 7000/tcp: for local frpc to connect to the server.

  • 25565/tcp: for friends to connect to Minecraft from the public internet.


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:

brew install frpc

Windows:

winget install Vim.Vim

3) Create the client configuration file

mkdir -p ~/frp
vim ~/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

frpc -c ~/frp/frpc.toml

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:

public-ip:25565