The Basics of setting up a Forge modded minecraft server.
Before we begin: It is notable that if you are playing a popular, publicly distributed pack, such as an FTB pack, RLcraft, or Skyfactory 4, often the authors of such packs have pre-assembled a server pack for their work, allowing you to sometimes skip ahead as far as step 7 in this process. Definitely check the site you got the pack from for such a thing, as it can save you a lot of bother.
However, if you really do have to start from the beginning, it's a couple step process:
- Download the forge installer
jarfile for the minecraft version you want to run a server for. As of this writing, the official forge site is: http://files.minecraftforge.net/.
Create an empty folder someplace convenient where you will be running the server from, and install forge's server into that empty folder. You will need java installed to do this, which can be acquired from here: https://java.com/en/download/manual.jsp. You might get an error message saying that forge failed to download the necessary libraries, if this occurs, do not start over, just run the installer again, targetting the same folder.
configfolder from the client over to the server folder.
scriptsif you used crafttweaker to do recipes,
localif that's where you configured FTBU, so on, so forth, any folder that has files you edited to make the pack go, copy over.
Launch the forge server with a .bat file with JVM arguments to allocate ram.
A .bat file is just a notepad .txt file that had its file extension changed to .bat from .txt
It has commands in it that, when you click on the bat file, will be executed.
java -Xmx4096M -jar forge-1.12.2-184.108.40.20654-universal.jar nogui pause
This is the .bat file I use to run my modpacks on 1.12 with forge version 220.127.116.1154. Obviously, if you're using a different forge version, you'll have to edit the filename referred to in the .bat file to reflect the filename of the forge server jar in your server folder.
Your server will immediately shut down because you haven't accepted the minecraft EULA! Go to eula.txt, and if you never have, you should have a look at the EULA, the text file links to. Once you have done so, change the false to true, basically promising you won't sell items for real money, or sell minecraft in a back alley.
Run the .bat file again, this time, it should work. If it crashes, check the crash-reports folder and either read the crash report there, or bring it someplace like our discord's #player-help or #server-admin channels to get help reading it.
If it succeeded at launching, you should be able to type
say hi serverand see that text echoed back at you in the window, and, be able to connect to it by typing localhost in as the IP in minecraft.
- For other players to be able to connect to your server, you will need to know, and tell them your public IP address, The website http://ip4.me/ can tell you your IPv4 or IPv6 address, and is ad free, and doesn't ask you to type anything in or sign up.
- Further, if you are behind a router, (And most of us are), then you probably need to "Forward" the port number you are running your minecraft server on. The specifics of how to do this vary from router to router, but you will need:
- The IPv4 address of your computer on your local network. This can be found by opening the command prompt and typing "ipconfig".
- The port number you are running the server on. This is the "server-port" number from the server.properties file of your server.