Minecraft Server using ngrok port forwarding stopped working

Abstract: Fix Minecraft server connectivity issues caused by ngrok port forwarding failures on Ubuntu.

Created: 2026-09-14 by

Minecraft server connectivity issues with ngrok typically stem from firewall misconfigurations, incorrect tunnel binding, or network changes rather than the ngrok service itself. Verifying that your local Minecraft instance is listening on the correct port and ensuring ngrok is explicitly forwarding to localhost resolves most sudden disconnections.

Verifying Local Server Connectivity

Before troubleshooting the external tunnel, you must confirm that the Minecraft server is running correctly on your Ubuntu machine. If the internal connection fails, no amount of ngrok configuration will allow external players to join. Start by checking the status of your Java process to ensure the server is active and not crashing silently. Run the following command in your terminal to list running Java processes:
ps aux | grep java
You should see a long line containing your server jar file and memory allocation flags. If this command returns nothing, your server has stopped running. Restart it using your preferred method, such as a systemd service or a screen session. Once confirmed running, test the connection locally. On the same machine hosting the server, use the loopback address to connect:
./minecraft_server.jar nogui
Then, in the Minecraft client, attempt to join via localhost:25565. If you cannot connect locally, the issue lies with your Minecraft configuration, permissions, or Java installation, not ngrok. Ensure your server.properties file has online-mode=false if you are testing without official authentication, and verify that server-ip is empty to bind to all interfaces.

Configuring ngrok for Correct Binding

A common reason for ngrok tunnels stopping work is a change in how the tunnel binds to local services. By default, ngrok attempts to find a service automatically, but this heuristic can fail if multiple services are running or if ports shift. You should explicitly tell ngrok to forward traffic to localhost:25565, which is the default port for Minecraft servers. Use the CLI command to create a static or dynamic TCP tunnel:
ngrok tcp 25565
If you are using an older version of ngrok that relies on a YAML configuration file, ensure your ngrok.yml contains the correct protocol and address settings. The section should look like this:
tunnels:
  minecraft:
    addr: 25565
    proto: tcp
After starting the tunnel, check the ngrok web interface or console output. It will display a public endpoint, typically in the format tcp://0.tcp.ngrok.io:12345. Share this exact string with testers. Note that if you are using a free tier, this address may change every time you restart the ngrok agent. For persistent connections, consider upgrading to a paid plan that offers reserved domains.

Addressing Firewall and Network Restrictions

Ubuntu systems often come with UFW (Uncomplicated Firewall) enabled, which can block incoming connections. However, since ngrok creates an outbound connection to its own cloud infrastructure and then relays traffic back, the firewall usually does not need to open port 25565 for incoming WAN traffic. The critical step is ensuring that the local Minecraft server accepts connections from localhost. If you have previously opened port 25565 in UFW, you might inadvertently be blocking the loopback traffic required for local testing. To check your current firewall rules, run:
sudo ufw status
If you see a rule allowing 25565/tcp, remove it to prevent conflicts during local debugging:
sudo ufw delete allow 25565
For the ngrok tunnel to function, your router must allow outgoing TCP connections on high ports. Most home routers handle this via NAT traversal without intervention. However, if you are on a corporate or university network, strict firewalls may block ngrok’s specific ports. In such cases, try changing the ngrok region in your config file to one closer to your location, or contact your network administrator.

Diagnosing Connection Drops and Latency

Even when connected, players may experience lag or disconnections. This is often due to the inherent latency added by the ngrok relay. Minecraft is sensitive to ping, and free ngrok tiers route traffic through congested servers. Monitor the connection stability by having a player stay in the world for five minutes while you watch the ngrok dashboard. Look for metrics like "Conns" (connections) and "Bytes". If the connection drops, check if your IP address has changed. Dynamic IPs do not affect ngrok directly since ngrok provides a stable endpoint, but they can affect other network services. Additionally, verify that your Minecraft server’s view-distance setting is not too high, which exacerbates latency over remote tunnels. Setting view-distance to 4 or 6 can significantly improve performance for ngrok-hosted servers. For more insights on managing system resources under load, you might find Why would a process use more memory running on one OS compared to another? helpful, as optimizing RAM allocation can stabilize the server during peak player counts.

Frequently Asked Questions

Why do players get disconnected after a few minutes?

This is usually caused by timeout settings on the ngrok free tier or aggressive garbage collection in Java. Ensure your server has sufficient RAM allocated using the -Xmx flag in your startup script. Increasing the heap size prevents the server from pausing unexpectedly.

Can I use a custom domain with ngrok for Minecraft?

Yes, but only with a paid ngrok subscription. Free accounts receive a random subdomain that changes upon every restart. A custom domain allows you to give players a consistent address like mymc.example.com, eliminating the need to share new numbers frequently.

Does UFW block ngrok traffic?

No, UFW generally does not block ngrok because ngrok initiates an outbound connection. Your firewall needs to allow outgoing traffic on ports 443 and 80 for the initial handshake, and then the ephemeral high ports for data relay. Blocking outgoing traffic will break the tunnel entirely.

How do I check if my Minecraft server is actually running?

Use the ps aux | grep java command to verify the process exists. Additionally, check the log files generated by your server jar for any error messages or stack traces that indicate why it might have crashed or failed to start properly.

Is ngrok safe for multiplayer servers?

Ngrok encrypts traffic between the client and the ngrok edge, but it is not designed for high-volume, persistent game servers. It is suitable for small groups of friends playing occasionally. For larger communities, dedicated game hosting providers offer better stability, DDoS protection, and lower latency.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More