Configuring Minecraft server

The game server Minecraft is used as an example of a service, access to which you will provide not only for yourself, but also for other users.


Since you have a static dedicated IP address, it will be convenient to bind some your domain to this IP and give your users a domain, not an address. It is much more convenient to remember something like mycoolminecraft.com than a set of 4 digits.


To bind a domain to IP, you first need the domain itself. Domains are usually purchased from registrars. Note the price. Using various promo actions you can find domains less than a $1 per year, but the extension of the lease of such a name can suddenly cost all $30.


Registrars have the opportunity to use their DNS servers for the domain. By default, the domain is configured for them. In the registrar panel go to DNS records administration and create an A-record for the domain like "your_domain". your_ip", like this: mycoolminecraft.com. A 185.49.70.81
In a short period of time (up to 24 hours), your domain will be resolved to your IP address.


ATTENTION! Access can be granted not only for you, but for any person. It's a bad idea to use standard user names and passwords. For example, Admin\admin. Also we remind you that ideally the software is downloaded from official websites only. Downloading "superpackage software by Jack-somebody", or clicking any links in Google, you can install absolutely undesirable software along with the necessary one. Not sure which of the sites is official? Look for the program description on wikipedia.org. For example, according to the article https://en.wikipedia.org/wiki/Minecraft you can find out that the official site is minecraft.net


We assume that you already have a minecraft client, installed it and know how to access other servers. You should also have Java package (from java.com) installed, which allows running of minecraft client.
Now you need to download the server end of the game from the page: https://minecraft.net/en-us/download/server


After the first start, a lot of files will "grow" around your server part. Therefore, it is best to have a separate directory for it. Suppose this is C:\minecraft. Accordingly, the file will be located at C:\minecraft\minecraft_server.1.12.1.jar


Now, to avoid the necessity to enter a command to start the server each time, create a directory named "start.bat" in the directory, and enter the line:
java -Xmx1024M -Xms1024M -jar C:\minecraft\minecraft_server.1.12.1.jar
You created a batch file. It will need to be launched. You can create a shortcut to it on the desktop for convenience.


Run it!
A black window appears for a few seconds and then turns off. What's going on?
An error occurs that we do not see, because the window closes immediately after the last command is completed. To be able to read the error, please edit your start.bat. Add a second line with a single command:
pause
and start the server again to see the error:


Everything immediately becomes clear for those who know English. For the rest, the server refuses to start until you accept the license agreement. To find out how to accept it, go to your C:\minecraft directory. And here is already a whole set of files, including eula.txt.
Open the file eula.txt in notepad and read that if we agree with the agreement by reference, then we must change the line
eula=false
to line
eula=true
Change, save, start again. That’s it!


What do we see and what should we do?
The upper black window is called the console where the server writes messages. If you enter the parameter nogui in start.bat (there is no graphical interface), as the official site recommends, then you will see only this console.
The bottom window is the graphical interface of the server, divided into 3 areas:
Stats - server's use of memory, etc.;
Players - list of players connected to your server;
Log and Chat duplicates all messages from the console, as well as allows to enter commands, such as "/ban chitak". To find out the list of all commands, use the command /help N, where N is from 1 to 10. The detailed description of the commands is beyond the scope of this manual, look for profile resources.


Now close the graphical interface to assure server operation. The console will display a notification that the world and users have been successfully saved, and the server is turned off:


Now go to your C:\minecraft\ directory and open the server.properties file for editing:
This file is used to set various parameters for the server. Study the documentation to know why they are needed.
Now we are interested in 3 parameters:
server-port=25565
server-ip=
online-mode=true


server-port=25565 - leave as is. It is minecraft standard port. If you change it to another, then you have to notify your users not only IP\domain, but also the port number, which will create additional inconveniences.


server-ip= - server-ip= - internal IP address (as in billing). It will look like this:
server-ip=10.8.0.5


online-mode=true - replace this line with:
online-mode=false
to allow connection of "pirate" clients, i.e. those who did not buy the game, to your server.


The next step is to allow incoming connections to port 25565 in your firewall, as well as make changes to the billing panel, where you have to specify in the form of port forwarding: 25565/tcp
For more information see RDP setup instructions.


Now it's time to check the availability of the game from the network. Start OpenVPN and the game server on your computer and ask friend to go to your server. Specify as the login address your domain or your EXTERNAL IP address (in our example, 185.49.70.81)


To connect to the server, select the "network game" in the minecraft client, then click "To address" or "Add" button.
The server was successfully added and is online:



Our user successfully logged in and wrote "Hello" to the chat. In server window we see this message:



This example examines the implementation of the client-server application architecture. In general, the configuration principle is valid for almost any client-server application.