How to Host a Minecraft Server at Home Without Port Forwarding
Port forwarding a Minecraft server sounds simple until you try it: your ISP might be using CGNAT so you do not even have a public IP to forward, your router might not support it cleanly, or you simply do not want to open holes in your home network firewall. This guide shows how to run a Minecraft Java or Bedrock server on your own hardware and make it joinable from anywhere on the internet, without touching your router settings, without a static IP address, and without paying for a dedicated server. The approach works even if your ISP uses CGNAT or you are on a mobile connection.
Why Port Forwarding Does Not Always Work
The traditional way to host a Minecraft server from home is to open port 25565 on your router and point it at your machine's local IP address. When it works, it works well. When it does not work, the reason is almost always one of these:
| Problem | Why it happens | How common |
|---|---|---|
| CGNAT (Carrier-Grade NAT) | Your ISP assigns you a private IP address (in the 100.64.x.x range) shared by many customers. Port forwarding requires a public IP, which you do not have. | Very common on mobile networks, fiber connections in many countries, and budget ISPs |
| ISP blocks inbound connections | Some residential ISPs block inbound traffic on game server ports as a terms-of-service measure or to push customers toward business plans. | Common in the UK, some US providers, and most mobile ISPs |
| Dynamic IP address | Your public IP changes every time your router reconnects. Friends cannot save a permanent server address. | Standard on most residential connections |
| Router does not support port forwarding properly | ISP-provided routers sometimes have locked-down firmware that does not expose port forwarding settings, or they reset rules after reboots. | Common with ISP-provided hardware |
A tunnel bypasses all of these problems. Your machine establishes an outbound connection to Localtonet's servers. Minecraft players connect to your Localtonet address. Localtonet forwards their traffic through the tunnel to your machine. Your router never needs to be configured. Your IP address does not matter. CGNAT is irrelevant.
Minecraft Bedrock Edition (mobile, console, Windows 10/11 app) uses UDP on port 19132. This rules out many tunneling services: ngrok does not support UDP at all, and Tailscale Funnel only handles TLS-terminated TCP. Localtonet supports raw UDP tunneling, which makes it one of the few tools that can expose a Bedrock server without port forwarding.
What You Need Before Starting
Java Edition: Vanilla vs PaperMC
For Java Edition you have two main choices for server software: Vanilla (Mojang's official server) and PaperMC. For a private server with a few friends, either works. For anything larger, PaperMC is almost always the better choice.
| Feature | Vanilla (official) | PaperMC |
|---|---|---|
| Performance | Default Mojang performance, noticeable lag with 10+ players or complex redstone | Significantly faster: async chunk loading, optimized entity processing, reduced tick lag |
| Plugin support | None | Full Bukkit/Spigot/Paper plugin API — thousands of plugins available on Hangar and SpigotMC |
| Configuration | server.properties only | server.properties + paper-global.yml + paper-world-defaults.yml |
| Anti-cheat and moderation tools | Limited built-in | Full plugin ecosystem: EssentialsX, CoreProtect, LuckPerms, etc. |
| Download | minecraft.net/download/server | papermc.io/downloads/paper (current: 1.21.11) |
Step 1: Install Java 21
Windows
Download the Java 21 installer from adoptium.net. Choose Temurin 21 LTS, Windows x64. Run the installer and accept the defaults. After installation, verify it works:
java -version
openjdk version "21.0.5" 2024-10-15
OpenJDK Runtime Environment Temurin-21.0.5+11 (build 21.0.5+11)
OpenJDK 64-Bit Server VM Temurin-21.0.5+11 (build 21.0.5+11, mixed mode, sharing)
Ubuntu / Debian
sudo apt update
sudo apt install -y openjdk-21-jre-headless
java -version
Step 2: Set Up the PaperMC Server
PaperMC is the recommended server software for most use cases. It is a direct hard-fork from Spigot with over 1,600 additional patches and significantly better performance.
Create a dedicated folder and download PaperMC
mkdir ~/minecraft-server
cd ~/minecraft-server
# Download the latest PaperMC build for 1.21.11
# Always get the latest from papermc.io/downloads/paper
wget https://api.papermc.io/v2/projects/paper/versions/1.21.11/builds/latest/downloads/paper-1.21.11-latest.jar -O paper.jar
On Windows: create a folder like C:\minecraft-server, download the jar from papermc.io/downloads/paper, and save it as paper.jar in that folder.
Accept the EULA
Run the server once to generate the eula.txt file, then edit it:
# First run — generates eula.txt and exits
java -jar paper.jar --nogui
[Server] You need to agree to the EULA in order to run the server.
[Server] It's located in 'eula.txt'
# Edit eula.txt: change eula=false to eula=true
# Linux/macOS:
sed -i 's/eula=false/eula=true/' eula.txt
# Windows: open eula.txt in Notepad and change the line manually
Create a start script with Aikar's optimized JVM flags
These flags tune Java's garbage collector for Minecraft's memory usage pattern, reducing lag spikes from GC pauses. They are the standard recommendation from the PaperMC team.
#!/bin/bash
# Adjust -Xms and -Xmx to match your available RAM
# Examples: 2G for small private server, 4G for 10 players with plugins, 8G for heavy modded
java -Xms2G -Xmx4G \
-XX:+UseG1GC \
-XX:+ParallelRefProcEnabled \
-XX:MaxGCPauseMillis=200 \
-XX:+UnlockExperimentalVMOptions \
-XX:+DisableExplicitGC \
-XX:+AlwaysPreTouch \
-XX:G1NewSizePercent=30 \
-XX:G1MaxNewSizePercent=40 \
-XX:G1HeapRegionSize=8M \
-XX:G1ReservePercent=20 \
-XX:G1HeapWastePercent=5 \
-XX:G1MixedGCCountTarget=4 \
-XX:InitiatingHeapOccupancyPercent=15 \
-XX:G1MixedGCLiveThresholdPercent=90 \
-XX:G1RSetUpdatingPauseTimePercent=5 \
-XX:SurvivorRatio=32 \
-XX:+PerfDisableSharedMem \
-XX:MaxTenuringThreshold=1 \
-jar paper.jar --nogui
java -Xms2G -Xmx4G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -jar paper.jar --nogui
pause
chmod +x start.sh
./start.sh
[Paper] Loading libraries... please wait
[Server thread/INFO]: Starting minecraft server version 1.21.11
[Server thread/INFO]: Loading properties
[Server thread/INFO]: Done (8.3s)! For help, type "help"
Step 3: Configure server.properties
The server generates a server.properties file on the first successful startup. The key settings to review before opening the server to the internet:
| Setting | Recommended value | What it does |
|---|---|---|
server-port |
25565 |
The TCP port the server listens on. This is the port you will forward in Localtonet. Keep the default unless you have a conflict. |
online-mode |
true |
Requires players to have a genuine Minecraft account (Mojang authentication). Keep this as true. Setting it to false allows anyone to join with any username, including accounts they do not own. |
white-list |
true (recommended) |
Only players on your whitelist can join. For a private friend server, always enable this. Add players with /whitelist add PlayerName in the server console. |
max-players |
10 (adjust to your RAM) |
Maximum concurrent players. Each player needs roughly 100-200 MB of RAM overhead beyond the base server allocation. |
view-distance |
8 (reduce from default 10 for limited RAM) |
How many chunks around each player are loaded. Lower values significantly reduce RAM and CPU usage. 8 is comfortable; 6 is the minimum that still feels normal. |
simulation-distance |
6 |
How far from players that game logic (mob AI, redstone, crops) is simulated. Lower than view-distance to reduce CPU load. |
motd |
Your server name | The description shown in the server list. Supports color codes with §. |
server-ip |
leave empty | Leave this blank. Do not paste your local or public IP here. An empty value tells the server to bind to all available network interfaces, which is correct. |
Step 4: Create the Localtonet Tunnel (Java Edition)
Java Edition uses TCP on port 25565. Create a TCP tunnel in the Localtonet dashboard:
Log in to Localtonet dashboard and create a new tunnel
Protocol: TCP. Local IP: 127.0.0.1. Local Port: 25565. Give it a name you will remember.
Note your public address
After creating the TCP tunnel, Localtonet shows you a public address in the format subdomain.localto.net:PORT. This is the address your friends will use to connect. Example: mc.localto.net:12345.
Download and authenticate the Localtonet client
# Download the binary from localtonet.com/download
chmod +x localtonet
# Authenticate with your token from the dashboard
./localtonet authtoken YOUR_AUTH_TOKEN
# Start the client
./localtonet
Share the address with your friends
In Minecraft Java Edition: Multiplayer → Add Server → paste the full address including the port, e.g. mc.localto.net:12345. The port is required because the TCP tunnel uses a non-default port.
Localtonet's TCP tunnels assign a public port that forwards to your local port 25565. The public port is different from 25565 — this is normal. Players must enter the full address:port when adding the server. The address and port stay stable across restarts as long as you use the same tunnel configuration.
Bedrock Edition: Exposing a UDP Server
Minecraft Bedrock Edition (the version on mobile, Xbox, PlayStation, Nintendo Switch, and Windows 10/11) uses UDP on port 19132. This is fundamentally different from Java Edition's TCP connection.
Setting up the Bedrock Dedicated Server
Download the Bedrock Dedicated Server
Download from minecraft.net/download/server/bedrock. Available for Windows and Linux (Ubuntu). Extract the archive to a folder like ~/bedrock-server.
Configure server.properties
Open server.properties in the Bedrock server folder. Key settings:
server-port=19132
server-portv6=19133
online-mode=true
white-list=false # set to true for private servers, then use allowlist.json
max-players=10
view-distance=32
tick-distance=4 # reduce to 2-3 on lower-end hardware
Start the server
cd ~/bedrock-server
chmod +x bedrock_server
./bedrock_server
NO LOG FILE! - setting up server logging...
[INFO] Starting Server
[INFO] Level Name: Bedrock level
[INFO] Game mode: 0 Survival
[INFO] Difficulty: 1 EASY
[INFO] IPv4 supported, port: 19132: Used for gameplay and is the default port for IPv4.
[INFO] Server started.
Create a UDP tunnel in Localtonet
In the Localtonet dashboard: Protocol: UDP. Local IP: 127.0.0.1. Local Port: 19132. After creating the tunnel, note the public address and UDP port assigned.
Share the address with Bedrock players
In Minecraft Bedrock: Play → Servers → Add Server. Enter the Localtonet address (without https://) and the UDP port number. Mobile players (iOS/Android) and console players can all connect to a Bedrock server this way.
Step 5: Run the Server Automatically on Boot (Linux)
For a server that stays online without you needing to manually start it after every reboot, create systemd services for both the Minecraft server and Localtonet.
Minecraft server service
sudo nano /etc/systemd/system/minecraft.service
[Unit]
Description=Minecraft PaperMC Server
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=YOUR_USERNAME
WorkingDirectory=/home/YOUR_USERNAME/minecraft-server
ExecStart=/bin/bash /home/YOUR_USERNAME/minecraft-server/start.sh
Restart=on-failure
RestartSec=10
# Allow time for the server to shut down cleanly (it saves the world)
TimeoutStopSec=60
[Install]
WantedBy=multi-user.target
Localtonet service (built-in)
Localtonet has built-in service management — no manual unit file needed:
# Register as a systemd service (run once)
sudo localtonet --install-service --authtoken YOUR_TOKEN
# Start and enable auto-start on every boot
sudo localtonet --start-service --authtoken YOUR_TOKEN
sudo systemctl daemon-reload
sudo systemctl enable minecraft
sudo systemctl start minecraft
# Check status
sudo systemctl status minecraft
sudo localtonet --status-service --authtoken YOUR_TOKEN
Recommended Plugins for a PaperMC Friend Server
All plugins below are available on the PaperMC Hangar repository (hangar.papermc.io) or SpigotMC. Download the .jar file and place it in the plugins/ folder inside your server directory. Plugins load automatically on the next server restart.
| Plugin | What it does | Why install it |
|---|---|---|
| EssentialsX | Core admin commands: /home, /spawn, /tp, /ban, /kick, /give, /gamemode, /tpa, economy basics | The essential administrative toolkit for any multiplayer server. Saves you writing custom commands. |
| LuckPerms | Permission management: assign ranks and control what each rank can do | Fine-grained control over who can run which commands. Necessary once you have trusted helpers or moderators. |
| CoreProtect | Logs all block place/break events. Rollback griefing to any point in time. | Essential if you invite anyone you do not 100% trust. Rollback takes seconds even for large grief incidents. |
| Chunky | Pre-generates world chunks in the background | Eliminates lag spikes when players explore new areas. Run once after world creation. Use /chunky start. |
| spark | Performance profiler: shows what is causing lag, which plugin or process is consuming TPS | Diagnose lag. /spark profiler start, play for a few minutes, /spark profiler stop. Opens a report in your browser. |
Troubleshooting Common Problems
| Problem | Likely cause | Fix |
|---|---|---|
| "Connection refused" when joining | Server is not running, or Localtonet is not running | Check sudo systemctl status minecraft and sudo systemctl status localtonet. Both must show "active (running)". |
| "Failed to verify username" | online-mode=true but Mojang's auth servers are temporarily unreachable, or the player's session is expired | Player should restart their Minecraft launcher and try again. If persistent, check Mojang's server status at status.mojang.com. |
| "Not whitelisted" error | white-list=true and the player is not on the list | In the server console: /whitelist add PlayerName. The player's username is case-sensitive and must match their Mojang account name exactly. |
| Server starts but crashes immediately with OutOfMemoryError | Not enough RAM allocated (-Xmx too low), or not enough physical RAM available on the machine | Reduce -Xmx if you are on a machine with limited RAM. Close other applications. As a minimum, -Xmx1G works for 1-2 players with no plugins. |
| Java not found: "java: command not found" | Java is not installed or not in PATH | Run java -version to check. Install Java 21: sudo apt install openjdk-21-jre-headless on Ubuntu/Debian. |
| Server is lagging / TPS drops below 20 | Too many entities, high view-distance, insufficient CPU single-core speed, or a heavy plugin | Install spark and profile the server. Common fixes: reduce view-distance to 8, reduce simulation-distance to 4, use Chunky to pre-generate chunks so exploration lag is eliminated. |
| Bedrock players can connect but get disconnected immediately | Bedrock server authentication issue or version mismatch between client and server | Ensure your Bedrock Dedicated Server version matches the clients connecting. Download the latest BDS from minecraft.net. Check online-mode in server.properties. |
| Players cannot find the server in Bedrock's Friends tab | Bedrock's Friends tab uses Xbox Live presence, not direct IP. Tunnel-hosted servers will not appear there automatically. | Players must add the server manually: Play → Servers → Add Server → enter the Localtonet address and port. This is a one-time setup per player. |
How Much RAM to Allocate
| Setup | Recommended -Xmx | Notes |
|---|---|---|
| Vanilla, 1-5 players, no plugins | 2G | Comfortable for a small private world. Leave 1-2 GB for the OS. |
| PaperMC, 5-10 players, 10-20 plugins | 4G | The standard setup for a friend group server. Stable at 20 TPS. |
| PaperMC, 10-20 players, heavy plugins | 6-8G | Add 200 MB per additional player beyond 10 as a rough rule of thumb. |
| Modded (Forge/Fabric), light pack | 6-8G | Mods add significant memory overhead even before players join. |
| Modded, heavy pack (100+ mods) | 10-16G | Some large packs require 12 GB just to start. Check the pack's official recommendation. |
The operating system, Localtonet, and other background processes also need memory. On a machine with 8 GB total RAM, set -Xmx to 6G and leave 2 GB for everything else. Allocating 100% of RAM to Java causes the OS to start swapping to disk, which is far worse for server performance than having slightly less Java heap.
Frequently Asked Questions
Will my friends need to do anything special to connect?
No software installation is required on their end. For Java Edition: Multiplayer → Add Server → enter the address and port you share with them. For Bedrock Edition: Play → Servers → Add Server → enter the address and port. The address is stable and does not change when you restart the server or Localtonet, so they only need to add it once.
Can I run both a Java Edition and a Bedrock Edition server on the same machine?
Yes. Java Edition listens on TCP 25565 and Bedrock listens on UDP 19132, so there is no port conflict. Create two tunnels in Localtonet: one TCP tunnel pointing to 25565, one UDP tunnel pointing to 19132. Run both server processes simultaneously. Alternatively, if you want Java and Bedrock players on the same world together, look into the Geyser plugin for PaperMC, which acts as a translation layer allowing Bedrock clients to join a Java Edition server.
Do I need to keep my computer on 24/7?
Only while players want to be online. When the server process and Localtonet are both running, the server is joinable. When you stop them or shut down your computer, the server is offline. For a server that friends can join at any time without coordinating with you, the machine needs to stay on. A Raspberry Pi 4 or 5 works well as a low-power always-on server for small groups — it consumes around 3-8 watts at idle, far less than a desktop PC left on continuously.
Is it safe to host a public Minecraft server from home?
For a private server shared only with people you know, the risk is low. Enable the whitelist (white-list=true in server.properties) and only add players you trust. Keep online-mode set to true so Mojang authenticates every player. For a public server open to strangers, the risks increase: griefing, spam, and the occasional exploit attempt. Use CoreProtect for rollback protection, install a plugin like GrimAC or Spartan for basic anti-cheat, and monitor your server logs regularly. The tunnel itself does not expose your home IP address to players — they connect to Localtonet's address, not yours directly.
What is the difference between Vanilla, Spigot, and PaperMC?
Vanilla is Mojang's unmodified official server. It is the reference implementation but has no plugin support and minimal performance optimizations. Spigot is the original community fork that added the Bukkit plugin API and some performance improvements. PaperMC started as a fork of Spigot and recently hard-forked completely, applying over 1,600 additional patches focused on performance, bug fixes, and extended API. PaperMC runs the same world format and is compatible with the same plugins as Spigot but runs significantly faster. For most home servers, PaperMC is the right choice. Fabric and Forge are mod loaders, not server software forks — they add a completely different modding ecosystem and are used for installing mods (new items, biomes, mechanics) rather than plugins (server administration tools).
Host Your Minecraft Server Without Touching Your Router
Get a stable TCP or UDP tunnel for your Java or Bedrock Edition server in under two minutes. No port forwarding, no static IP, no CGNAT problems. Your friends connect with a permanent address that never changes.
Create Your Free Tunnel →