Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

To host a Minecraft: Java Edition server, download Mojang’s current Java server file, run it on a computer, accept the EULA, then configure your network if friends will connect over the internet. The official server software is for Java Edition only; Bedrock players can’t join it directly. For friends on the same home network, opening a single-player world to LAN is simpler and needs no dedicated server or port forwarding.

Choose how you want to play

  • Same local network: Open a single-player world to LAN. There’s no separate server process or router configuration. See Mojang’s LAN instructions.
  • Online with your own server: Run the dedicated Java server on a computer and configure its firewall and router so players outside your network can reach it. Mojang notes that changing home-network settings carries risk; share your address only with people you trust. Follow its server setup guidance.
  • Online without managing a computer or router: Consider Realms. A Realms subscription is not required to use an ordinary online Java server.

This guide covers Mojang’s official vanilla Java server. It does not support Bedrock clients directly. Make sure all players and the server use compatible Minecraft versions; for a straightforward setup, choose the same current release in the Launcher and download the server file for that release. The official download page changes as releases change, so use its current file rather than relying on a version number in an older guide.

Download and prepare the server

  1. Download the current Minecraft: Java Edition server .jar from Mojang.
  2. Create a folder for the server, such as Minecraft Server, and put the downloaded file in it. Keep the server files together.
  3. Install a compatible Java runtime. Open Command Prompt, Terminal, or another command-line shell and run:
    java -version

    If the command isn’t found, Java may not be installed or may not be available on your system’s PATH. On Windows, configure PATH if needed, then open a fresh command window and check again.

Run the server and accept the EULA

Open a command line in the server folder. On Windows, you can navigate there with cd; replace the example path with your own:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
cd "C:UsersYourNameDesktopMinecraft Server"

Start the server using the exact downloaded filename. Replace the placeholder below with that filename, including its .jar extension:

#1 Best Overall
Minecraft | Java & Bedrock Deluxe Collection | Windows Digital Code
  • DELUXE COLLECTION — Includes the base game, three add-ons (Celebration Food, Rescue Dogs, and Plenty O’ Blocks), three exclusive Character Creator items, and 700 Minecoins.
  • CREATE — Build whatever you can imagine in your own infinite world that’s unique in every playthrough.
  • EXPLORE — Discover biomes, resources, and mobs, and craft your way through a world filled with surprises in the ultimate sandbox game.
  • SURVIVE — Experience unforgettable adventures as you face mysterious foes, traverse exciting landscapes, and travel to perilous dimensions.
  • PLAY TOGETHER — Have a blast with friends, whether you’re sitting on the same couch in split screen or miles apart in cross-platform play for console, mobile, and PC.
java -Xmx4G -Xms4G -jar minecraft_server.<version>.jar nogui

The memory flags set Java’s initial and maximum heap. They’re an example, not a universal allocation recommendation: leave memory for your operating system and other applications. You can use a simpler launch command instead:

java -jar "actual-server-file-name.jar"

Mojang’s documented command-line setup is more useful than simply double-clicking the file because the terminal displays startup errors and lets you control launch options. You can omit nogui if you want the graphical server interface.

Rank #2
Minecraft | Java & Bedrock Ultimate Collection | Windows Digital Code
  • ULTIMATE COLLECTION — Includes the base game, five add-ons (Celebration Food, Rescue Dogs, Plenty O’ Blocks, Decocraft, and Weapons + Tools), five exclusive Character Creator items, and 1000 Minecoins.
  • CREATE — Build whatever you can imagine in your own infinite world that’s unique in every playthrough.
  • EXPLORE — Discover biomes, resources, and mobs, and craft your way through a world filled with surprises in the ultimate sandbox game.
  • SURVIVE — Experience unforgettable adventures as you face mysterious foes, traverse exciting landscapes, and travel to perilous dimensions.
  • PLAY TOGETHER — Have a blast with friends, whether you’re sitting on the same couch in split screen or miles apart in cross-platform play for console, mobile, and PC.

On the first run, the server creates files including eula.txt and server.properties, then stops because the EULA hasn’t been accepted. That’s expected. Open eula.txt in a text editor, change eula=false to eula=true, and save it. This records acceptance of the Minecraft EULA; it isn’t an optional setting or a way to bypass the terms. Run the same launch command again.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set server options

The first run creates server.properties in the server folder. Stop the server before editing it, use a plain-text editor, and restart the server for changes to take effect. These are common settings and their usual defaults:

Rank #3
Minecraft | Standard Edition | XBOX Digital
  • Create and shape an infinite world, explore varied biomes filled with creatures and surprises, and go on thrilling adventures to perilous places and face mysterious foes.
  • Play with friends across devices or in local multiplayer.
  • Connect with millions of players on community servers, or subscribe to Realms Plus to play with up to 10 friends on your own private server.
  • Get creator-made add-ons, thrilling worlds, and stylish cosmetics on Minecraft Marketplace; subscribe to Marketplace Pass (or Realms Plus) to access 150+ worlds, skin & textures packs, and more—refreshed monthly.
motd=A Minecraft Server
gamemode=survival
difficulty=normal
max-players=20
pvp=true
allow-nether=true
spawn-protection=16
server-port=25565
server-ip=
  • motd is the message shown in the multiplayer list; max-players sets the simultaneous player limit.
  • gamemode can be survival, creative, adventure, or spectator. difficulty can be peaceful, easy, normal, or hard.
  • server-port is the normal player-connection port. The default is 25565. If you change it, players and any router rule must use the new port.
  • Usually leave server-ip blank. Setting it to an incorrect local address can stop the server from binding to the network.

Don’t confuse server-port with query.port, which is for the optional server-query protocol. Ordinary players connect through the game port, not the query port.

Connect from the same network

Start the server and leave it running while people play. Players on the host computer can connect to localhost. Other people on the same home network should use the host computer’s local IP address, often in ranges such as 192.168.x.x, 10.x.x.x, or 172.16.x.x through 172.31.x.x. If needed, find the host’s local IP in its network settings.

Rank #4
Minecraft
  • Skins! We have biome settlers, city folk, town folk, and more!
  • The Nether and all its inhabitants. Fight Ghasts and make friends with Pigmen
  • Cross platform play for up to five players between Pocket Edition and Windows 10
  • Revamped touch controls, controller support, and a controller mapping screen
  • Enhanced Weather effects! Accumulating snow and more

On each player’s computer, launch Minecraft: Java Edition, select Multiplayer, then choose Direct Connection and enter the address, or select Add Server, enter the address, and click Done. Select the server and choose Join Server. The server address can be an IP or hostname.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Let friends join over the internet

Remote access usually requires each of these pieces to be correct:

Best Value
Minecraft - Bedrock Edition PS4
  • Play and share with friends on console, mobile and Windows 10
  • discover community creations in the new in-game store
  • access new mini games and game modes through servers
  1. Keep the server running. The host computer must stay on, connected to the network, and running the server process.
  2. Reserve a local IP for the host. A router’s DHCP reservation (or equivalent) helps keep the server computer’s local address stable. Otherwise, a forwarding rule can point at the wrong device after an address changes.
  3. Forward the game port. In your router’s port-forwarding settings, create a rule for TCP 25565 to the server computer’s local IP. Router labels and menus vary by manufacturer. If you changed server-port, forward that port instead. The game port is server-port, not query.port.
  4. Allow Java through the host firewall. Approve the server’s inbound connection in the operating system firewall, or add an appropriate rule for the selected port.
  5. Give remote players your public address. They connect using your public IP or hostname. Include the port if it isn’t the default, for example your-address:25565.

Players inside your home network should generally use the local IP; players outside it should use the public address. Don’t assume every router supports the same options, and don’t share your public IP widely. Mojang’s server download page also cautions that making a server reachable from outside your network involves firewall and router configuration.

For a private server, enable the whitelist from the server console and add only approved players. Keep online authentication enabled; disabling it is not a routine connection fix and can let people connect using unauthenticated usernames. The EULA permits hosting online play with the Java server software, subject to its restrictions on redistribution and commercial misuse of Minecraft software and content.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

LAN play without a dedicated server

If everyone is on the same local network, opening a single-player world is usually the quickest option:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Connect everyone to the same local network. Avoid guest Wi-Fi or other networks that isolate devices from one another.
  2. Launch Java Edition, select Singleplayer, then open a world or create a new one.
  3. Press Esc, select Open to LAN, adjust the options, and select Start LAN World.
  4. Other players open Multiplayer and select the LAN world when it appears.

The host sees a message with the temporary LAN port. This method doesn’t call for router port forwarding, and the world is hosted by the player who opened it rather than by a separate, always-on server. See Mojang’s LAN help page for its instructions.

Troubleshoot common problems

Symptom What to check
java is not recognized Install a compatible Java runtime or make sure it is on PATH. Reopen the command line and retry java -version.
Unable to access jarfile Make sure the terminal is in the server folder and the filename matches the downloaded file exactly. Quote filenames that contain spaces: java -jar "minecraft_server.actual-name.jar". Windows may hide file extensions, so check the actual name.
The server stops and mentions the EULA Edit the eula.txt beside the server .jar, set eula=true, save it, and restart. Check that you didn’t edit a copy in another folder.
Same-network players can’t connect Confirm the server is running, all devices are on the same non-isolated network, the host firewall allows Java, and players are using the host’s local IP rather than its public address. On Windows, Mojang recommends setting a trusted home network’s profile to Private for LAN troubleshooting. Don’t mark a café, hotel, or other untrusted network Private. See Mojang’s Windows LAN guidance.
Host can join, but remote players can’t Check that port forwarding targets the host’s current local IP and the game port, the firewall permits inbound Java traffic, and remote players have the current public address. Double NAT (two routers), carrier-grade NAT from an ISP, VPNs, or school/work network restrictions can prevent ordinary inbound connections. See Mojang’s network troubleshooting page.
Connection refused or timeout A refusal often means the address is reachable but nothing is listening on that port, or traffic is actively rejected. A timeout often means traffic is being dropped before it reaches the server. Confirm the server is running and server-port matches the port players use and the router forwards.
Incompatible version or protocol error Use the same compatible Minecraft release on the server and every client. For modded play, server and client mod-loader and mod versions must also match.
Failed to bind to port Another process may already use the port, or server-ip may name an address not assigned to the host. Stop the conflicting process or choose another server-port and forward it; normally leave server-ip= blank.
Lag or crashes Performance depends on the host’s CPU and memory, player count, world-generation workload, view and simulation distances, and mods. Increasing Java’s heap won’t fix network latency, a slow CPU, or an overloaded world; don’t allocate all system RAM to Minecraft.

For further version requirements, consult Mojang’s multiplayer requirements.

Quick Recap

Bestseller No. 3
Minecraft | Standard Edition | XBOX Digital
Minecraft | Standard Edition | XBOX Digital
Play with friends across devices or in local multiplayer.
$19.99
Bestseller No. 4
Minecraft
Minecraft
Skins! We have biome settlers, city folk, town folk, and more!; The Nether and all its inhabitants. Fight Ghasts and make friends with Pigmen
$6.99
Bestseller No. 5
Minecraft - Bedrock Edition PS4
Minecraft - Bedrock Edition PS4
Play and share with friends on console, mobile and Windows 10; discover community creations in the new in-game store
$42.49

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.