How to Create a Minecraft Server

Why use someone else's server when you can build your own?

Setting up your own server to play Minecraft takes a little time, but it's worth the effort to play with your friends in a secure setting. Read on to learn how to make a Minecraft server for Mac, Windows, and Linux.

What You'll Need

How to Host a Minecraft Server

Depending on your computer's capabilities, you may or may not be able to host a server and play Minecraft on the same device. It's recommended to use a remote hosting service for your server. The official Minecraft Forum has a list of free and premium hosting services. Some, like, allow you to make a Minecraft server for free, but most web hosting companies charge a monthly fee.

Hosting your own server can open your computer to outside attacks. Using a premium hosting provider helps you avoid such risks.

Setting Up Port Forwarding

If you just plan to play with friends on a local network, you can disregard this section; however, for the rest of the world to access your server, you must enable port forwarding on your router. Since every router is different, consult your router's manual for more specific guidance on setting up port forwarding. Nonetheless, you can follow the same steps regardless of which OS you are using.

Setting up port forwarding opens your network to outside security risks.

  1. Visit your router's homepage by entering your default gateway IP address into a web browser's search bar. See How to Find Your Default Gateway IP Address.

  2. You'll be prompted to enter a username and a password. Consult your router's manual or look up your router on to find the default username and password. This information might also be found on the router itself.

  3. After your router reboots, locate the Port Forwarding section on your router's homepage. It may be under advanced settings. Check the router's manual for help if necessary.

  4. From here, you can set up rules for port forward. Depending on your router, you might have to select a button that says Add or something similar to proceed. Name the rule "Minecraft."

  5. In the two port fields, enter the default Minecraft server port: 25565.

  6. Enter your computer's static IP address in the IP or Address field.

  7. Select both the TCP and UDP protocols. You may see a drop-down menu or boxes you can check.

    TCP/UDP on router screenshot
  8. Click Save or Apply.

  9. After your router reboots, your server should be accessible to players around the world.

How to Create a Minecraft Server for Windows

The screenshots and instructions below refer to Windows 10. Other versions of Windows have different interfaces, but the steps for setting up the server are the same:

  1. Download and install the newest version of Java.

  2. Download the Minecraft server software. The file has the extension .jar.

  3. Create a new folder on your desktop or wherever else you desire and name it "minecraft_server." Drag the .jar file into it.

  4. Double-click the .jar file. The server should start up, but you'll receive an error message. Close the server window if it doesn't close automatically.

  5. Some configuration files will have appeared in your folder. Open the file named eula.txt. If asked which program to open it with, choose your text editor, such as Notepad.

  6. In the editor, find the line eula=false and replace it with eula=true, then save the file and close it.

    The eula.txt document for the Minecraft server software

    This step prevents the server from closing automatically. If you receive an error message, you can still run your server as an administrator. Just right-click the .jar file and select Run as administrator.

  7. Double-click the server file again. This time, your server should start up successfully, and more files will appear within the folder. When you see a "Done" message in the server window, type "stop" in the text box and press Enter. The server should close.

    The Minecraft server software running Windows
    Look for a "done" message to make sure your server is up and running.
  8. You can technically run your server now, but you'll want to adjust the default memory settings and create a launch file if you plan to play with others. To do so, create a new .txt file in Notepad by selecting File > New. Type the following:

    java -Xmx3G -Xms1G -jar server.jar

  9. Go to File Save As and name the file "run.bat."

  10. Select Save as type, then select All Files.

  11. Choose your minecraft_server folder for the location and select Save. Whenever you want to launch your server, just double-click the run.bat file you created.

  12. You can now invite other Minecraft players to join your server. They just need to know your public IP address, or your local IP address if you're playing on the same network.

  13. To check if your server is accessible, enter your public IP address into the Minecraft Server Status Checker. Your server will only be publicly available if you previously set up port forwarding. To look up your public IP address, simply enter "my IP address" into Google.

How to Set Up a Minecraft Server for Mac

To run a Minecraft server on a Mac, you must have macOS 10.8 or later. To upgrade your OS, visit Apple Support.

  1. From the Apple menu, go to System Preferences and look for the Java icon. Open it to launch the Java Control Panel.

  2. Click the Update tab, then select Update Now.

  3. When the installer window appears, select Install Update Install and Relaunch.

  4. Download the Minecraft server software.

  5. Create a new folder named "minecraft_server" and drag the server software file into it.

  6. Open a new .txt document by going into your Applications folder and double-click the TextEdit icon.

  7. Once in TextEdit, select Format Make Plain Text > OK.

  8. Type the following into the document:


    cd "$(dirname "$0")"

    exec java -Xms1G -Xmx1G -jar {server file name} nogui

    Just replace {server file name} with the name of the server file.

  9. Save the file in the folder containing your server’s .jar file and name it "start.command."

  10. Open the Mac terminal by going to Applications > Utilities, then double-click the Terminal application.

  11. In the terminal window, type "chmod a+x" (without the quotation marks) followed by a single space, and then press Enter.

  12. Drag and drop the start.command file you created into the terminal window, then press Enter again.

  13. Now you can open the start.command file to run the server. When you double-click the file, a new window will open, and you might see some error messages. Don't worry about them; the server should now be ready to play Minecraft.

  14. Invite others to join your server by sharing your public or local IP address. Enter your public IP address into the Minecraft Server Status Checker to confirm it's accessible to the outside world. Find your public IP address by entering "my IP address" into Google.

How to Set Up a Minecraft Server on Linux

It's possible to make a Minecraft server with any Linux distribution. The steps below are for building a Minecraft server for Ubuntu 16.04. Set up is done entirely through the command terminal.

Since you want as much free RAM as possible, you should use an outside hosting service to run your server. Set up an account with one of the services listed on the Minecraft Forum before you begin building your server.

  1. Connect to your hosting service via SSH by entering the following into your command terminal:

    ssh username@ipaddress

    Replace "ipaddress" with your host's IP address and username with your username. You may be asked to enter your password for your hosting service. Follow the prompts to complete the process.

  2. Install Java by entering the following into the command terminal:

    sudo apt-get update

    sudo apt-get install default-jdk

    If prompted, enter Y when asked to authorize installation.

  3. Install Screen to keep your server running when you’re not connected. Enter:

    sudo apt-get install screen

  4. Create a directory for your server files and open it by entering the following:

    mkdir minecraft

    cd minecraft

  5. Install wget. Enter:

    sudo apt-get install wget

  6. Download the Minecraft server files using the wget command. Enter:

    wget -O minecraft_server.jar

    Consult the Minecraft download page to make sure the above URL is up-to-date.

  7. Accept the end-user license agreement with this command:

    echo "eula=true" > eula.txt

  8. Run Screen by entering:

    screen -S "Minecraft server 1"

  9. Start your server with the following command:

    java -Xmx512M -Xms512M -jar minecraft_server.jar nogui

    Feel free to adjust the -Xmx and -Xms settings to allocate more memory for the server if your host will allow it.

  10. You can confirm that your server is accessible by entering the IP address into the Minecraft Server Status Checker.

How to Connect to Your Minecraft Server

If you're hosting your own Minecraft server, the server window must remain open for others to access it.

  1. Open Minecraft and log in to your Minecraft account.

  2. Select Multiplayer from the Minecraft menu.

  3. Select Add Server in the lower-right of the screen.

  4. Give your server a name. 

    Remember the whole world can see it, so don't use any vulgar or offensive language.

  5. Enter your host's IP address into the Server Address box. If you're hosting the server, enter your private IP address, which is different than your public IP address.

  6. Select Done at the bottom of the window.

  7. Select your server's name when it appears at the top of the screen, then select Join Server.

  8. Assuming you properly prepared you router, players from around the world can now connect to your server.

    You might need to disable your computer's firewall before others can connect to your server locally; however, doing so can leave your computer vulnerable to outside attacks, so only share your private IP address with individuals who you trust.

  • How do I make a modded Minecraft server?

    Setting up a modded Minecraft server involves most of the same steps as above, with one exception. You'll also install Minecraft Forge, which gives you access to mods. Once you've set up Forge and your server, you can download Minecraft mods to change how the game works.

  • How do I join a Minecraft server?

    Others can join your server (or you can join someone else's) by opening Minecraft, navigating to Multiplayer Direct Connect, and entering the public IP address associated with the server. Alternatively, players on your Wi-Fi network can just enter your private IP address.

  • How do I make a saddle in Minecraft?

    The saddle, which lets you ride your tamed animals and skeletons, is only available by looking in chests around your world; you can't craft a saddle in Minecraft. In a Creative world, however, you can use the command block in Minecraft to get a saddle by opening the Chat box and typing either /give @[username] saddle 1 or /give @[username] saddle 1 0.

Was this page helpful?