Basic Server Startup
While there is a Windows-format .exe file to run the server, all platforms can use the .jar file identically, therefor this guide will cover the .jar method. You will of course need a working Java installation on the machine which will be running Minecraft. For best performance and stability, Linux users are encouraged to use the official Java runtime instead of an open alternative.If Java is installed and the .jar file is downloaded to an appropriate location, open up your command prompt/terminal to the location where you saved the .jar file. You’ll want to make sure the file is in its own directory, as it will generate several other files and directories the first time it is run.
To launch the server, enter the following command (all OSes):
#The -X options are recommended memory settings for improved performance java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui #The "nogui" option can be omitted if you'd like a GUI,
Configuring the Server
You may be tempted to load up the client and play right away, but at this point, nothing is configured. Shut down the server and take a look at the .jar file’s directory again, and you’ll see several new files.Most are pretty self-descriptive. But for the sake of being thorough, here’s a summary:
- world – Directory containing map data
- banned-ips.txt – List of IP addresses specifically banned from connection
- ops.txt – List of Operator (admin) names
- server.properties – Main server configuration file
- banned-players.txt – List of banned players by name
- server.log – Server’s log file
- white-list.txt – List of players specifically allowed via whitelisting
#Changing this will generate a new world folder with this name level-name=world #Toggles whether or not The Nether is active on this server hellworld=false #Enable or disable mob spawning at night spawn-monsters=true #Whether or not to verify logins. Better security if left to 'true' online-mode=true #Enable or disable cows, pigs, etc spawn-animals=true #Maximum number of concurrent players max-players=20 #Bind to particular IP. It is STRONGLY recommended this be left blank in most circumstances server-ip= #Whether or not to allow players to harm eachother pvp=true #If you want to be able to reproduce your level, you can specify a seed number level-seed= #Which port to bind the server. Take note of this, you'll likely need it later. server-port=25565 #Whether or not to enable whitelisting. See link in section above for details on whitelisting. white-list=false
External Access
If you’re attempting to run this on a home broadband connection, you likely have a few extra steps you’ll need to take before anyone but you can access your server. First, you’ll need to know if you need port forwarding. In short, anything running as a server on your computer binds itself to a certain port number. That way, any data coming into that computer labeled with that port number will be routed to the correct program. If you’re behind a home router, the router must be made aware that you’re running a server so that all incoming data on that port goes to the right computer.
Still with me? Port forwarding can be tricky but here’s a summary of how to get the job done. If it’s not enough, here’s a great site devoted entirely to helping with this task.For starters, we’ll need to know the IP address of the Minecraft server. There are a dozen ways to do that graphically depending on your OS, so here are two ways that’ll work on any major OS from the command line:
#Windows ipconfig #Linux/OSX/Any UNIX-type ifconfig
Now that we’ve got the server IP and a good guess at the router’s IP, open a new tab in your web browser and enter the router’s IP into the address bar (once again, likely 192.168.1.1 or 192.168.0.1). Chances are you’ll face a login screen. If you don’t know the password, try using the factory login.
Once you’ve got logged into your router, look around for NAT, Virtual Server, or Port Forward settings and enter the IP and port of your server as required.
Once again I highly recommend PortForward.com if you run into any trouble.
Dynamic DNS
Most home broadband users have a dynamic IP address, meaning it changes every so often. For people to be able to easily access your server, you’ll need to have a good name they can always access instead of an ever-changing IP. That’s where dynamic DNS comes in. When you sign up with a (often free) dynamic DNS provider, they give you a name like myserver.dyndnsprovider.com. You run a small client program on your server that connects to the provider every so often and informs them of any changes to your IP. Whenever someone accesses the name, they forward the request to your current IP.There are several such providers out there, but this author has always had good luck with No-IP.com. Signup is quick and free and they provide client software for every major OS.
Additionally, some routers and modems have built-in support for many popular dynamic DNS providers. It may be worthwhile to check your device before trying to install local client software, as it could save you a lot of headache.