Skip to content
All posts
5 min read

Host a Minecraft Server Without Port Forwarding

Set up a Minecraft server on your PC and let friends join without touching your router. Step-by-step guide using a TCP tunnel.

gamingtutorial

You want to play Minecraft with friends. You're running a server on your PC. The problem: your friends can't connect because your computer is behind a router and firewall.

The usual advice is "set up port forwarding." That means logging into your router, finding the NAT settings and creating forwarding rules. It also needs a public IP address from your provider, and many home connections do not have one.

There's a much easier way.

What you need#

  • A Minecraft server running on your PC (Java Edition, default port 25565)
  • Localport CLI installed (30-second install)
  • A Localport account (sign up here)

Step 1: Start your Minecraft server#

If you haven't already, download and run the Minecraft server:

java -Xmx2G -Xms1G -jar server.jar nogui

Make sure it's running and you can connect locally at localhost:25565.

Step 2: Start the tunnel#

Open a new terminal window (keep the Minecraft server running) and run:

localport tcp 25565 --token YOUR_TOKEN --region eu

The agent prints the public address:

minecraft-world.eu.localport.dev:47266

Step 3: Share with friends#

Send your friends the address: minecraft-world.eu.localport.dev:47266

They add it as a server in Minecraft:

1. Multiplayer → Add Server

2. Server Address: minecraft-world.eu.localport.dev:47266

3. Done → Join

That's it. No port forwarding, no router changes, no static IP.

Keep both windows open

The tunnel only works while the CLI is running. Keep both the Minecraft server terminal and the Localport terminal open during your gaming session.

Tips for a smooth experience#

  • Reserve the port in the tunnel's settings and the address stays the same for every session, so friends save the server once.
  • Pick the region closest to your players when you create the tunnel. EU, US and Asia Pacific are available.
  • It works behind CGNAT and on networks where you cannot change the router, because the agent connects outward.

Other games#

A tunnel carries TCP. Terraria works the same way on port 7777. Games whose servers use UDP, such as Minecraft Bedrock Edition, Valheim and Factorio, do not work through a tunnel. The game server guide has the list.

Get started →