Language

UPnP

UPnP

Modrinth

This simple plugin allows your server to automatically open network ports on supported routers using UPnP.

2.4k downloads 13 followers updated 5mo ago
latest v2.0-SNAPSHOT Modrinth
Bukkit Paper Purpur Spigot 1.14 – 1.21 ManagementUtility

UPnP

bStats

A lightweight Minecraft plugin that automatically opens server ports through UPnP (Universal Plug and Play), eliminating the need for manual port forwarding configuration on compatible routers.

Features

  • Automatic Port Mapping: Opens your Minecraft server port automatically on plugin startup
  • Custom Port Support: Configure additional ports for plugins like Dynmap, Geyser, or voice chat
  • Protocol Flexibility: Supports both TCP and UDP port mappings
  • Automatic Cleanup: Optionally closes ports when the server shuts down
  • Zero Configuration: Works out of the box with sensible defaults
  • Lightweight: Minimal performance impact on your server

How It Works

This plugin uses the UPnP Protocol to communicate with your router and automatically create port forwarding rules. This means players can connect to your server without you manually configuring your router.

Installation

  1. Download the latest release from Releases
  2. Place the JAR file in your server's plugins folder
  3. Restart your server
  4. The plugin will automatically open your server port

Configuration

After the first run, edit plugins/UPnP/config.yml:

# Whether to close ports when the server stops (recommended: true)
close-ports-on-stop: true

# Enable anonymous usage statistics via bStats
bstats: true

# TCP ports to open (includes server port by default)
tcp:
  - 25565      # Minecraft server
  - 8123       # Dynmap (example)

# UDP ports to open
udp:
  - 19132      # Geyser/Bedrock (example)

Common Port Examples

  • Minecraft Java: 25565 (TCP)
  • Dynmap: 8123 (TCP)
  • Geyser/Bedrock: 19132 (UDP)
  • BlueMap: 8100 (TCP)
  • Simple Voice Chat: 24454 (UDP)

Requirements

  • Minecraft 1.20 or higher (may work on older versions)
  • A router that supports UPnP
  • UPnP enabled on your router (usually enabled by default)

Troubleshooting

Ports aren't opening

  1. Check that UPnP is enabled on your router (consult your router's manual)
  2. Verify the ports aren't already in use by another application
  3. Check server logs for error messages
  4. Some ISPs or routers block UPnP for security reasons

Security Considerations

While UPnP is convenient, it does open ports on your network. Only open ports you actually need, and consider disabling UPnP on your router if you're not actively using this plugin.

Statistics

This plugin uses bStats to collect anonymous usage statistics. You can disable this in the config file or globally in plugins/bStats/config.yml. View statistics at bStats.

License

This mod is licensed under the GNU Lesser General Public License v3.0 only (LGPL-3.0-only).

What this means for users and developers

  • You may use this mod in modpacks (including commercial modpacks).
  • You may run this mod on servers, including paid or hosted servers.
  • Other mods may depend on or integrate with this mod under any license.
  • Closed-source mods and launchers may link against this mod.

What you must do

  • If you modify this mod’s source code, you must release those modifications
    under the same LGPL-3.0-only license.
  • You must allow users to replace or update this mod independently (e.g., by
    distributing it as a normal JAR).

What you do not have to do

  • You do NOT have to open-source your entire mod, server, or modpack.
  • You do NOT have to publish server source code just because players connect.
  • You do NOT have to license your project under LGPL if you merely depend on this mod.

License history

Versions released prior to January 3rd 2026 were licensed under AGPL-3.0-only. You can read more about the change here.

Versions released on or after January 3rd 2026 are licensed under LGPL-3.0-only.

For the full license text, see the LICENSE file.

Credits

Built using the weupnp library.


Note: This plugin is provided as-is. Always ensure you understand the security implications of opening ports on your network.

Versions

Release
2.0-SNAPSHOT
paper, purpur, spigot · 1.20, 1.21 · 5mo ago
Licensing Notice and Transition Statement ========================================= This project was previously licensed under the GNU Affero General Public…
314
Release
1.9.1
paper, purpur, spigot · 1.20, 1.20.1, 1.20.2 · 17mo ago
The openport command has been temporarily removed. This fixes the nullpointer error and allows me to rewrite the admittedly poor implementation.
348
Release
1.9
paper, purpur, spigot · 1.20, 1.21 · 18mo ago
This version bumps some internal dependencies and features nothing new for end users.
416
Release
1.8
bukkit, paper, purpur · 1.20, 1.20.1, 1.20.2 · 27mo ago
This version brings the removal of uneeded logging frameworks, and switches to the built in plugin logger. The plugin also now uses Spigot Plugin Annotations…
633
Release
1.7.1-SNAPSHOT
paper, purpur · 1.20, 1.20.1, 1.20.3 · 27mo ago
Plugin no longer incorrectly requires legacy material support.
60
Release
1.7-SNAPSHOT
bukkit, paper, purpur · 1.20.4 · 27mo ago
This version fixes an issue where user defined ports were only opened to TCP, not UDP.
50
Release
1.6-SNAPSHOT
bukkit, paper, purpur · 1.14, 1.15, 1.16 · 30mo ago
Finished removal of old code.
253
Release
1.5-SNAPSHOT
bukkit, paper, purpur · 1.14, 1.15, 1.16 · 30mo ago
Removed broken code There were originally plans to use the api from [mcsrvstat.us](https://mcsrvstat.us/) to check if port mapping was successful but I have…
82
Release
1.4-SNAPSHOT
bukkit, paper, purpur · 1.14, 1.15, 1.16 · 30mo ago
The plugin will now load and should work on older server versions. As a result you may now see the following in your logs: ``` [12:02:55 WARN]:…
60
Release
1.3-SNAPSHOT
bukkit, paper, purpur · 1.20, 1.20.1, 1.20.2 · 30mo ago
Fixed a bug that prevented new ports from being mapped.
59
Release
1.2-SNAPSHOT
bukkit, paper, purpur · 1.20, 1.20.1, 1.20.2 · 30mo ago
The plugin will now forward both TCP and UDP for the Minecraft server's port. Also improved code readability.
61
Release
1.0-SNAPSHOT
bukkit, paper, purpur · 1.20, 1.20.1, 1.20.2 · 30mo ago
# Initial release!
81

Comments 0

No comments yet. Be the first to share your thoughts.