Setting Up Minecraft Server Java

How To Make A Minecraft Server On A Mac

How to Set Up A Minecraft Server on Your Home Network Java Edition

This article was co-authored by wikiHow Staff. Our trained team of editors and researchers validate articles for accuracy and comprehensiveness. wikiHow’s Content Management Team carefully monitors the work from our editorial staff to ensure that each article is backed by trusted research and meets our high quality standards. This article has been viewed 268,976 times.Learn more…

Operating Systems And Other Software

To be able to create your own Minecraft server, youll need the Minecraft server software. The developer Mojang provides you with a free setup for this, which is only compatible with Minecraft: Java Edition. A current version of the Java Runtime Environment is also required.

Secondly, you will need an operating system to manage your server resources and install the Minecraft server software. In connection with the local home server, it has already been hinted that you can certainly get your own Minecraft world running on the standard user operating systems from Microsoft, such as Windows 10 or Windows 8. Installation on macOS is also possible, according to developer information. For an optimal setup, however, the classic server operating systems are recommended:

  • Windows Server 2019
  • Ubuntu
  • openSUSE

It is required that you are able to use Java via the command line. On macOS and Linux, this should be set up by default. In Windows, you often need to enable the option first via enable PATH environment variable.

How To Fix Connection Refused: Connect Error

The Connection Refused: Connect error message is triggered when a server drops or cancels a connection request. Some of the most common causes include a bad network connection, an incorrect Minecraft launcher version, and firewall issues.

Heres what you can do to fix this error:

  • Try joining the server via a different internet connection. There might be a connectivity issue on your end. If that doesnt help, theres a problem with the server itself.
  • Add Minecraft and the game launcher to the list of firewall exceptions. If the error persists, allow the Java binary to as well.
  • Reinstall your client and restart the server. Do this if you have no issues connecting to other servers.
  • You May Like: Minecraft Free 24/7 Server Hosting

    Hard Disk Space And Broadband Requirements

    Of course, you also need to store the Minecraft server installation as well as user and game world data on your server. The following approximate values can be used here:

    • 1 to 2 players: at least 2 gigabytes of free disk space
    • 3 to 5 players: at least 18 gigabytes of free disk space
    • 6 players or more: at least 35 gigabytes of free space

    However, size is not the only factor you should pay attention to when it comes to storage units. Relying on SSD storage for your server can speed up the startup process. However, for a smooth gaming experience on a Minecraft server, classic HDD storage is perfectly suitable, too.

    For more on the differences between the two major types of memory, see our article SSD vs. HDD: What are the differences?.

    The required broadband capacities also result from the number of active players on the Minecraft server. In terms of memory, Minecraft isnt too demanding: Majongs recommendations from 5 Mbps for 1 to 2 players to 45 Mbps for 6 or more players – are not a problem if you rent the hardware and hosting for your Minecraft server. In case you have your own server at home, you will of course have to keep an eye on the key figures and order a larger broadband package if necessary.

    Create A Folder And Download Minecraft Files

    How to Join a Minecraft Server (PC / Java Edition ...

    You will need a folder to store the Minecraft server files. I recommend using a sub-folder of your Desktop .

    Download the Minecraft files to your server. We’re going to use the default Minecraft server, which can be downloaded from the Minecraft website. You will find the latest server version at the bottom of the page.

    If you have connected to your Windows Server from a Windows client with the default RDP program, you will be able to simply copy + paste files. If you are on a Mac and are using the official Microsoft Remote Desktop application, you will need to enable folder redirection which will create a share, allowing you to share files between the client and the server.

    Put the .jar file you have just downloaded for your server in the folder.

    Also Check: Minecraft In Vr Oculus Quest 2

    Setting Your Server Port And Other Values

    After accepting the EULA by editing the eula.txt, start your server again with the .bat file. This will create a number of files and folders that are required to use your server, among others the server.properties file. Find the following line:

    server-port=25565

    This is the server-port value. If you change this to something different, you will have to type the port after your IP when you join the server in the Minecraft client. For example, you’d have to type :25569 if you changed the port to 25569. If you leave it the default value of 25565, Minecraft will recognize that automatically. Another option would be to use a DNS SRV record and have a registered domain name.

    If there’s no obvious reason to change the port, I recommend leaving it on 25565. The most common reason for changing the server port is to run multiple Minecraft servers on one VPS.

    Connecting To The Server

  • 1Leave your server dashboard open. This will allow you to adjust your server quickly by minimizing the Minecraft window and maximizing your browser window.
  • 2Open Minecraft. Minecraft: Java Edition has an icon that resembles a grass block. Click the icon to open the Minecraft launcher.
  • 3Click Play. It’s the green button on the Minecraft Launcher. This launches Minecraft.
  • 4Click Multiplayer. It’s near the middle of the Minecraft title page.
  • 5Click Direct Connect. It’s at the bottom of the multiplayer menu in the middle.
  • 6Enter your server’s address. Type the address for the server, which was listed next to the “Connect” heading, into the text box in the middle of the page.
  • 7Click Join Server. It’s at the bottom of the page. Doing so will connect you to the server and place you in the server’s world.Advertisement
  • Read Also: Best Minecraft Seeds Xbox One 2017

    Installing Papermc’s Minecraft Server Jar

    Paper is a jar that extends and improves the Bukkit and Spigot APIs meaning if you want to install plugins you can. PaperMC also offers more control options for your server.

    sudo wget -O /mchost/v-1-17/live/minecraft_server.jar WEBSITE-URL sudo bash -c "echo eula=true >  /mchost/v-1-17/live/eula.txt"sudo chown -R mchost /mchost/

    NOTE: the server Jar will change over time and you will want to go to Paper’s Website to grab the newest Jar.

    Getting Started: Download The Latest Version Of Java

    How to Setup Minecraft Server on Windows 10 (java)

    Still here? Great! Lets begin making our own Minecraft server.

    We can start by creating a new folder that will hold all of our downloads. You can put this anywhere youd like, but I find it easiest to create a new folder on your desktop.

    In our examples, we will be placing everything inside a folder called My Awesome Server directly on the desktop. To create a folder on your desktop right-click on any open space on your desktop and click New Folder. Then you can rename the folder to something of your choosing.

    After creating your folder, youll need to start downloading the necessary files needed to host your own server. Lets start by ensuring you have the latest version of Java on your machine. You can do that by clicking here or going to . That link should take you to the proper download regardless of if you are using a Mac or PC.

    Add the installer to the folder we created in the previous step. Once you download the installer, double-click it and follow along with the prompts.

    Recommended Reading: Budget Minecraft Pc

    Writing A Script To Launch The Server

    It’s definitely boring to have to remember the command-line options for your server every time you launch it. Luckily, we can write it down in a file and just run that instead.

    On Windows

    The windows version of a script is called a batch file. Create a text file in the folder where you put the jar as “start.bat”, and then right click it to edit using notepad. Paste the following in:

    Double click the file to start your server. You may get a “Class_Not_Found” and ServerGuiConcole error, just ignore these errorsand you should see your “Server Thread/INFO” dialog start the server.

    The “pause” command is there to keep the window open so you can read what happened after the server stops.

    On macOS, Linux, and FreeBSD

    All these systems use a common scripting language called the “POSIX shell script” on the command line. Create a text file in the folder where you put the jar as “start.sh” and write the following in:

    #!/bin/shcd"$"exec java -Xms1G -Xmx1G -jar server.jar --nogui

    Now save the file. Run chmod a+x start.sh to make it executable. You can now run the file by double-clicking or by running ./start.sh in the folder .

    If you want to add a pausing part like the Windows example, remove the exec word, and add a line of read -n 1 -p “Waiting…” to the end. This is useful if you are running the script by double-clicking on the GUI.

    On Plan 9

    Command Prompt & Ip Configuration

    In the text box, type cmd to open Command Prompt and press ENTER.

    Once you’re in the Command Prompt, type ipconfig to open up your IP settings.

    If this does not work for you, open your Windows taskbar and type cmd again. From there, right click on Command Prompt and select Run As Administrator.

    This should open a new CMD window for you to type the code ipconfig as we did above.

    Once the information shows up in Command Prompt, we’re going to be looking for two specific numbers the IPV4 and the DefaultGateway.

    Go ahead and make a note of your Default Gateway, as we’ll be working with that first. In my case, the number was 192.168.1.1.

    Next up, go ahead and open your browser and place this number into your address bar. This is going to prompt you to log into your Wi-Fi system or router backend.

    If you’ve never setup your router backend through the default gateway like this, it’s likely that a password and username was never changed. To work around this, you can use the default login information provided by your router’s manufacturer. This WILL ONLY work if the router information has never been changed.

    Recommended Reading: Minecraft Java Edition Code

    Things To Consider Before Hosting A Minecraft Server

    Benefits of Using Hosting Your Own Minecraft Server

    • You are able to have complete control over the entire server at all times. If you want something done, you can make it happen as quickly as you can do it yourself. There is no need to rely on someone else doing things for you.
    • You have the ability to upgrade your computer however you desire to increase performance. Many server hosting companies offer higher premiums for higher specs, but if you happen to have the newest generation processor, the maximum amount of ram, and the biggest and most powerful graphics card, then your server can be one of the most powerful servers out there.
    • It can be fun to setup and learn how to configure networking. Youll get to learn about various network features that you probably wouldnt need to know otherwise.
    • It wont cost you anything other than what it takes to run your computer. Using a hosting company costs money, but by hosting your own server you will only pay what it costs to keep your computer running.

    Hosting your own Minecraft server can be very rewarding, but it does have a few drawbacks you should understand before attempting it yourself.

    Running A Lan Party Type Server

    How to set up a Minecraft Java Edition server with ...
    Note that these requirements are for the server only. You need to allocate more resources to the OS!
    Also note that these suggestion presume default settings in server.conf – i.e., a Draw Distance no higher than 10, and is also based on a new world the bigger the world gets, especially if there’s advanced redstone circuitry at work, the requirements – especially the RAM, or in the case of lots of redstone or mobs , the CPU – increase significantly .

    Be sure to have at least a low-ping internet connection, such as DSL or cable.

    Requirements

    Don’t Miss: How Do You Get Skins On Minecraft Pe

    Benefits Of Having A Dedicated Server For Minecraft On Linux

    With a dedicated server, you have exclusive use and control of the server’s resources. Processing power, memory, and storage are available specifically for your game without noisy neighbors or running virtualization . Improved performance is achieved by having this type of control.

    Also, all your mods , plugins and security settings are under your full control. You can set up your Minecraft server on Linux the way you want without other users making any changes to your settings.

    What Is A Minecraft Server

    A Minecraft server allows multiple people to play together in the same Minecraft world. This can be handled in different ways so its important to understand your options.

    You can rent a server through a third-party, such as Apex Hosting or Hostinger. It does nearly everything for you, but you need to pay a monthly service fee for it. This can be as low as $5, depending on the service you use.

    You can run a server yourself. This saves you paying a monthly fee as well as giving you complete control over how your server is handled. This article focuses on making your own Minecraft server without using a third-party.

    Minecraft also runs personal multiplayer servers, called Realms, just for you and your friends. With a Realm, your Minecraft world is online and always accessible, even when you log off.

    Recommended Reading: Best Minecraft Screen Recorder Free

    Start Your Minecraft Server

    java -Xmx512M -Xms512M -jar minecraft_server.jar nogui

    To make sure everything is running correctly, stop your server with:

    stop

    Then edit the server.properties file and set:

    enable-query=true

    Save the server.properties file and restart your server. From there, enter your server IP address into the Minecraft Server Status Checker to see if its publicly accessible.

    Download The Required Configuration Files

    Host Minecraft Java Edition Server At Home! Minecraft 1.18.1!

    1. Navigate to the , right-click on the minecraft-server release and copy the link location.

    2. Next, download the Minecraft server files using the wget command. Paste the link location copied in the previous step:

    wget https://launcher.mojang.com/v1/objects/35139deedbd5182953cf1caa23835da59ca3d7cd/server.jar

    The output informs you it has downloaded the Minecraft server files and saved them under the name server.jar.

    3. Rename the server.jar file so it matches the name of the Minecraft edition downloaded. At the time of writing, the latest Minecraft server release is 1.16.4. Therefore, we used the following command to rename the server.jar file into minecraft_server.1.16.4.jar:

    mv server.jar minecraft_server.1.16.4.jar

    4. Next, execute the following command:

    java -Xmx1024M -Xms1024M -jar minecraft_server.1.16.4.jar nogui

    The output responds with an error informing you that you need to agree with the EULA to run the service. Move on to the next step to do so.

    Don’t Miss: How To Add Mods To A Minecraft Server 1.12.2

    Connect To Your Server

    Connect to your server console or connect remotely via secure shell . If you are connecting remotely via SSH, use the following command to log in as the root user.

    ssh 

    Note: Replace serveripaddress with the IP address of your server.

    If this is your first time connecting to this server, you will be prompted to confirm that you want to connect to a new, previously unknown host. Writes yes,and you will be prompted for the root password. Once you enter it, you log in as root.

    It is recommended to create a separate user account so that if your Minecraft server is compromised, the exploiter does not have access to the root user account. Use the following command to create a user named muser.

    adduser mcuser

    The following command is to set the password for our new user.

    passwd mcuser

    You will be prompted to enter and confirm the password.

    Firewalling Nats And External Ip Addresses

    • You must open a TCP/UDP port on the firewall.
    • If the server in question is not reachable via a globally routable IP address, you will need to add appropriate address and/or port number translation rules to the gateway usually your router has the global IP address.
  • For help with address translation, opening the firewall and routing , portforward.com is a good source. Select your router from that list, skip the ad that comes after selecting the device, and you will see instructions for setting up port forwarding. Alternatively, you can read the documentation supplied with your router, modem, or other ISP related hardware.
  • Verify the port is open, and note your external IP by using a port checker tool, such as You Get Signal. The default port you should test is 25565, unless you specified something else. Have the Minecraft server running when you test the port.
  • You can obtain your external IP address from YouGetSignal.
  • Local network dedicated servers

    This only applies to Classic servers.

    To correct this, you must add a function to the end of your URL, bookmarks, or whatever else you connect by. The function is: ?override=trueExample:

    Note: This situation does not effect Beta servers, and you should be able to connect via an internal or external IP.

    The SRV record

    To manually verify the SRV record, use :

    Also Check: 24 Hour Minecraft Server

    Updating And Installing Software Needed

    To install the Minecraft server, we will need to install Java , wget, screen, and nmap.

    • default-jdk is the language in which Minecraft runs – we are also marking the Java version as “held” so no future updates are applied .

    • wget will allow us to download the Minecraft Server from Mojang. Downloading the Minecraft Server Jar, we put the file in the directory directly, instead of using a web browser.

    • screen will allow us to run commands on the server in an isolated environment – think of it as a virtual terminal instance you can connect to and disconnect from.

    • nmap is a network scanner that we will use for testing and network configuration.

    Open a Terminal with T run the following commands:

    sudo apt clean  sudo apt update -m  sudo dpkg --configure -a  sudo apt install -f  sudo apt full-upgrade -ysudo apt install wget screen default-jdk nmap -ysudo apt-mark hold default-jdk

    NOTE: not all these commands will produce output.

    Popular Articles

    Related Stories

    Stay on op - Ge the daily news in your inbox