Trang này chưa có bản Tiếng Việt. Đang hiển thị bằng tiếng Anh.
Host a Minecraft server through Localtonet
Trong trang này 8 mục
- Which tunnel for which edition
- Why Bedrock needs TCP and UDP
- Before you start
- Create the tunnel
- Open the TCP - UDP page
- Fill in the form
- Start the tunnel and share the address
- Bedrock only: set server.properties
- Join the server
- Java Edition
- Bedrock Edition
- Keep the same address for your players
- Use the game's default port
- Secure it
- Common problems
- Related pages
Let friends join the Minecraft server on your computer without port forwarding: a tunnel gives the server a public address. Java Edition needs a TCP tunnel, Bedrock Edition a UDP - TCP tunnel.
Which tunnel for which edition #
| Edition | Protocol | Default port | Where the port is set |
|---|---|---|---|
| Java Edition | TCP | 25565 | server-port in server.properties |
| Bedrock Edition (Bedrock Dedicated Server) | UDP - TCP | 19132 | server-port and server-udp-ports in server.properties |
The two editions are separate servers. If you run both, create one tunnel for each. The tunnel types are described on the TCP and UDP / TCP Mixed pages.
Why Bedrock needs TCP and UDP #
Since Bedrock 26.60, players join Bedrock Dedicated Server over the NetherNet transport. The game first asks the server over TCP, on server-port, how to connect. The server answers with a UDP address, and the game then plays over UDP. The older UDP-only transport (RakNet) is no longer accepted by current game versions, so a UDP-only tunnel isn't enough any more.
The server takes the UDP address it gives to players from server-udp-ports. Without the tunnel's address there, players see your server in their list but can't join it. The steps below set it.
Before you start #
- A Localtonet account and the Localtonet client connected with your AuthToken on the computer that runs the server. See Quick start.
- A Minecraft server that is running and that you can join from your own network. Bedrock: use a current Bedrock Dedicated Server (26.60 or later).
- Bedrock only: the LAN IP address of the computer that runs the server, for example
192.168.1.50. On Windows, runipconfigand use the IPv4 Address of your network adapter. On Linux, runip -4 addr.
Create the tunnel #
-
Open the TCP - UDP page #
Open My Tunnels › TCP - UDP and expand Create TCP - UDP Tunnel.
-
Fill in the form #
Field What to enter Protocol TCP for Java Edition, UDP - TCP for Bedrock Edition. Device token The token the Localtonet client on the server computer uses. Server region Choose a region close to your device for lower latency. Local IP address Java Edition: 127.0.0.1when the server runs on the same computer as the client. Bedrock Edition: the computer's LAN IP, for example192.168.1.50. Bedrock Dedicated Server doesn't accept game traffic on127.0.0.1, so a Bedrock tunnel to127.0.0.1shows the server in the list but players can't join.Local port 25565for Java Edition,19132for Bedrock Edition, or theserver-portyou set.URL type Random subdomain. Custom subdomain lets you choose the name and needs Balance. Select Create tunnel.
-
Start the tunnel and share the address #
The tunnel appears under Your tunnels. Select Start. The URL column shows the public address as
host:port. Select it to copy it, and send it to your players. -
Bedrock only: set server.properties #
Open the tunnel's Settings and select Tunnel IP to see the IPv4 address of the Localtonet server. Then add or change these lines in
server.properties:server.propertiestransport=nethernet server-port=19132 server-udp-ports=<TUNNEL_IP>:<TUNNEL_PORT>:19132Value What it is <TUNNEL_IP>The IPv4 address from Tunnel IP. It must be an IP address, not the host name. <TUNNEL_PORT>The port after the colon in the URL column. 19132The tunnel's Local port. Use the same number as server-port: the tunnel sends TCP and UDP to one local port.Save the file and restart Bedrock Dedicated Server. If you create the tunnel from the dashboard by picking Minecraft Bedrock, the dashboard shows these lines with your values filled in once the tunnel starts.
Join the server #
Java Edition #
- In Minecraft, select Multiplayer, then Add Server.
- In Server Address, enter the host and the port with a colon:
<TUNNEL_HOST>:<TUNNEL_PORT>. - Select Done and join the server from the list.
Bedrock Edition #
- In Minecraft, select Play, open the Servers tab and select Add Server.
- Enter
<TUNNEL_HOST>in Server Address and<TUNNEL_PORT>in Port. Bedrock has a separate field for the port. - Save and join the server from the list.
Add Server is available in Bedrock on Windows, Android and iOS.
Keep the same address for your players #
The host name stays with the tunnel. The port is assigned by the server when the tunnel starts. With Is Reserved? on in the tunnel's Settings, the port stays the same when the tunnel or the Localtonet client restarts, so the entry in your players' server lists keeps working. With it off, the port changes on a restart and you have to send the new address. Tunnels that you create while your account has Balance start with Is Reserved? on. Turning it on needs Balance and a started tunnel.
Bedrock: update server.properties when the port changes. server-udp-ports contains the tunnel port. If the port changes after a restart, change <TUNNEL_PORT> there as well and restart Bedrock Dedicated Server, or players can't join. A reserved port avoids this. If you move the tunnel to another server, Tunnel IP changes too.
Use the game's default port #
With Balance you can choose the public port yourself. In the tunnel's Settings, select Server Port › Change and pick Same as local port, or enter 25565 (Java) or 19132 (Bedrock). Saving restarts the tunnel and reserves the port. If another tunnel on that server already uses the port, you are asked to pick another one.
When the public port is the game's default, Java players can enter just <TUNNEL_HOST> without a port, and Bedrock players can leave the Port field at its default. For Bedrock, the line becomes server-udp-ports=<TUNNEL_IP>:19132:19132. See Ports.
Free plan. TCP, UDP and UDP - TCP tunnels stop after 30 minutes on the Free plan, which disconnects everyone. You can start the tunnel again, and the port can be different after each start. The Free plan also allows one tunnel in total. For longer sessions or both editions at once, add Balance. See Plans and Balance.
Secure it #
Anyone who has the address can try to join. Decide who may play on the Minecraft server itself:
- Java Edition: keep
online-mode=trueinserver.properties, setwhite-list=true, and add players in the server console withwhitelist add <PLAYER>. - Bedrock Edition: set
allow-list=trueinserver.propertiesand add players withallowlist add <PLAYER>.
On the tunnel you can add:
- IP Restriction. IP Restriction › Manage in the tunnel's Settings lets only listed addresses connect (Allow only these) or keeps listed addresses out (Block these). It needs Balance. Home internet addresses change, so an allow list works best for a small, fixed group. See Access control.
- Limits. Bandwidth Limit, Speed Limits and Expiration Date are described on Limits and expiration.
Every player has the same IP address on your server. Connections arrive from the Localtonet client on your computer, so the Minecraft server logs the client's address for all players: 127.0.0.1 on Java Edition, your computer's LAN IP on Bedrock Edition. Ban players by name, not with ban-ip: an IP ban would block everyone. To see the real addresses, open Request Log › Show in the tunnel's Settings, and block an address with IP Restriction.
A TCP tunnel also has a Proxy Protocol? switch, which passes the original client address to your service in a PROXY protocol header. Turn it on only if your Java server software supports the PROXY protocol and you enabled it there as well. A server that doesn't expect the header rejects every connection. Leave it off for Bedrock.
Common problems #
Java: "Can't connect to server" or "Connection timed out"
Check that the tunnel is started and its Connection column shows ON, that the player typed the current port after the colon, and that the tunnel's Protocol is TCP. Then check that you can join with localhost on the server computer.
Bedrock: the server shows in the list, but joining fails (for example the "Door" error)
The TCP side works, the UDP side doesn't reach the server. Check, in this order: the tunnel's Protocol is UDP - TCP; its Local IP address is the computer's LAN IP, not 127.0.0.1 or localhost; server-udp-ports contains the current Tunnel IP and tunnel port, and its last number is the tunnel's Local port; you restarted Bedrock Dedicated Server after editing server.properties. On Linux, ss -ulpn | grep 19132 shows the address the server listens on for UDP; the tunnel's Local IP address must be that address.
Bedrock: "Unable to connect to world"
Check that the tunnel is started, that it is a UDP - TCP tunnel to port 19132, and that the player entered the port in the Port field and not after the host name. A UDP-only tunnel no longer works with current Bedrock versions.
Everyone was disconnected after 30 minutes
On the Free plan TCP, UDP and UDP - TCP tunnels stop after 30 minutes. Select Start to begin another session and share the address again if the port changed. On Bedrock, also update server-udp-ports. Or add Balance to remove the session limit.
The address in my friends' server list stopped working
The port is not reserved, so it changed when the tunnel or the client restarted. Send the new address, or turn on Is Reserved?. On Bedrock, update server-udp-ports as well.
"Port 25565 is not available on this server."
Another tunnel on the same Localtonet server already uses that port. Keep the port you were assigned, pick another number, or create the tunnel in a different Server region.
"You need to purchase balance to use this feature."
Is Reserved?, Server Port, IP Restriction and Custom subdomain need Balance. Add it under Balance.
The game lags
Traffic travels from the player to the Localtonet server and from there to your computer. When you create the tunnel, choose a Server region close to your device, as the dashboard advises.