📜 ⬆️ ⬇️

Creating and setting up a Minecraft server

Minecraft selectel

Minecraft today is one of the most popular online games. In less than three years (the first official release took place in the fall of 2011), he had millions of fans around the world.

Game developers are consciously guided by the best samples of twenty years ago, when many games were primitive in terms of graphics by today's standards and imperfect in terms of usability, but at the same time they were really exciting.

Like all sandbox games, Minecraft provides the user with tremendous opportunities for creativity - this, in fact, is the main secret of its popularity.
')
The organization of servers for the game in multiplayer mode is done by the players themselves and their communities. Today, tens of thousands of game servers are operating on the Internet (see, for example, the list here).

There are many fans of this game among our customers, and they rent equipment for game projects in our data centers. In this article we will talk about what technical points you need to pay attention to when choosing a server for
Minecraft.

Choosing a platform


The structure of the game Minecraft includes the following architectural elements:
  1. server - a program through which players interact with each other over the network;
  2. Client - a program for connecting to a server installed on a player’s computer;
  3. plugins - add-ons to the server that add new features or extend old ones;
  4. fashion - additions to the game world (new blocks, items, features).


There are many server platforms for Minecraft. The most common and popular are Vanilla and Bukkit.

Vanilla is the official platform for game developers. It is distributed both in graphic and console versions. The new version of Vanilla is always released simultaneously with the new version of Minecraft.

The disadvantage of Vanilla is excessive memory consumption (approximately 50 MB per player). Another major drawback is the lack of plug-ins.

Bukkit was created by a group of enthusiasts who attempted to improve the official Minecraft server. The attempt turned out to be quite successful: in terms of functionality, Bukkit is much wider than Vanilla, primarily due to the support of various mods and plug-ins. At the same time, it consumes less memory per player — about 5–10 MB.

The disadvantages of Bukkit are that when it starts up, it takes too much RAM. In addition, the longer the server runs, the more memory it needs (even if there are few players). When choosing Bukkit as a server, you should take into account that its new versions, as a rule, contain errors; stable version usually appears about 2-3 weeks after the official version of Minecraft.

In addition, other platforms have recently gained popularity (for example, Spout, MCPC and MCPC +), but they have limited compatibility with Vanilla and Bukkit and extremely limited support for mods (for example, for Spout, you can only write mods from scratch). If they are used, then only for experiments.

For the organization of the game server, we recommend using the Bukkit platform, as it is the most flexible; In addition, under it there are many different mods and plug-ins. Stable operation of the Minecraft server depends largely on the correct choice of hardware platform. Consider this question in more detail.

Hardware requirements


Both the server and the Minecraft client are very demanding of system resources.
When choosing a hardware platform, you should take into account that a multi-core processor will not give big advantages: the core of Minecraft server can use only one calculation thread. The second core, however, will be useful: some plugins are executed in separate threads, and Java also consumes a lot of resources ...

Therefore, for a Minecraft server, it is better to choose a processor that has a higher performance of one core. A more powerful dual-core processor would be more preferable than a multi-core processor, but less powerful. On specialized forums, it is recommended to use processors with a clock speed of at least 3GHz.

For the normal functioning of the Minecraft server requires a large amount of RAM. Bukkit takes up approximately 1GB of RAM; in addition, under each player, as already mentioned above, 5 to 10 MB is allocated. Plugins and mods also consume quite a lot of memory. For a server with 30 to 50 players, thus, at least 4 GB of RAM will be required.

In Minecraft, a lot (for example, downloading the same plugins) depends on the speed of the file system. Therefore, it is preferable to choose a server with an SSD disk. Spindle drives are unlikely to work because of the low random read speed.

Internet connection speed is also of great importance. For the game 40-50 people, a channel of 10 Mb / s will be enough. However, those who are planning a larger minecraft project, including a website, a forum and a dynamic map, it is highly desirable to have a channel with more bandwidth.

What specific configuration is best to choose? From the configurations offered by us, we recommend to pay attention to the following:


These configurations are quite suitable for creating a Minecraft server for 30-40 players. Some disadvantage is the lack of SSD-drives, but we give another important advantage: a guaranteed channel of 100 MB / s without any restrictions and ratios. When ordering all the above configurations, the installation fee is not charged.

We also have more productive, but naturally more expensive servers (if you order these configurations, the installation fee is also not charged):

We also recommend to pay attention to the new budget model with an SSD-drive based on Intel Atom C2758 processor: Intel Atom C2758 2.4 GHz, 16 GB RAM, 2 × 240 GB SSD, 4000 rub / month, installation fee - 3000 rub.

Installing and running a Bukkit server in Ubuntu OS


Before installing the server, create a new user and add it to the sudo group:
 $ sudo useradd -m -s / bin / bash <username>
 $ sudo adduser <username> sudo

Next, set the password under which the created user will connect to the server:
 $ sudo passwd <username>

Reconnect to the server under the new account and proceed to the installation.
Minecraft is written in Java, so the Java Runtime Environment must be installed on the server.

Update the list of available packages:
 $ sudo apt-get update

Then execute the following command:
 $ sudo apt-get install default-jdk

To install and run Bukkit, it is also advisable to install a terminal multiplexer — for example, screen (you can use other terminal multiplexers — see our review ):
 $ sudo apt-get install screen

Screen is needed if we connect to the game server via ssh. With it, you can start the Minecraft server in a separate terminal window, and even after the ssh client is closed, the server will work.

Create a directory where server files will be stored:
 $ mkdir bukkit
 $ cd bukkit

After that, go to the download page of the official site Bukkit . At the top right of the page you can see a link to the latest recommended build of the server (recommended build). We advise you to download it:
 $ wget <link to recommended version>

Now run the screen:
 $ sudo screen

and execute the following command:
 $ java -Xmx1024M -jar craftbukkit.jar -o false

Let us explain what the parameters used mean:


The server will be started.
You can stop the server by typing stop in the console.

Configuring and configuring the server


Server settings are stored in the server.properties configuration file. It contains the following parameters:


The logs of the minecraft server are recorded in the server.log file. It is stored in the same folder as the server files. The log is constantly increasing in size, taking more and more disk space. You can streamline the operation of the logging mechanism with the help of the so-called log rotation. For rotation, a special utility is used - logrotate. It limits the number of log entries to a certain limit.

You can configure the rotation of the logs so that all records will be deleted as soon as the log file reaches a certain size. You can also set a period after which all old entries will be deemed irrelevant and deleted.

The basic rotation settings are in the /etc/logrotate.conf file; In addition, for each application, you can create individual settings. Files with individual settings are stored in the /etc/logrotate.d directory.

Create a text file /etc/logrotate.d/craftbukkit and enter the following parameters in it:
 /home/craftbukkit/server.log {
   rotate 2
   weekly
   compress
   missingok
   notifempty
 }

Consider their values ​​in more detail:

More details about the log rotation settings can be found here .

Optimization Tips


Immediately make a reservation that this section will contain tips related only to the optimization of the game server. The issues of tuning and optimizing the server on which Minecraft is installed are a separate topic that goes beyond the scope of this article; interested readers can easily find the necessary information on the Internet.

One of the most common problems encountered when playing Minecraft are the so-called lags - situations where the program does not respond to user input in time. They can be caused by problems both on the client side and on the server side. Below we will give recommendations that will help reduce the likelihood of problems on the server side.

Regularly monitor the memory consumption of the server and plug-ins


Memory consumption can be monitored using specialized administrative plugins - for example, LagMeter .

Stay tuned for plugins updates.


As a rule, developers of new plug-ins with each new version tend to reduce the load.

Try not to use many plugins with similar functionality.


Large plugins (for example, Essentials, AdminCMD, CommandBook) very often include the functionality of many small plugins. For example, the same Essential contains functions of plug-ins iConomy, uHome, OpenInv, VanishNoPacket, Kit. Small plug-ins, the functionality of which is fully covered by the functionality of one large, in most cases, you can remove, so as not to overload the server.

Limit the card and download it yourself


If you do not limit the card, the server load will increase significantly. You can limit the map using the WorldBorder plugin. To do this, you need to run this plugin and execute the / wb 200 command, and then draw the map using the / wb fill command.

Drawing, of course, will take a lot of time, but it is better to do it once, closing the server for technical work. If the map is drawn by each player, the server will work slowly.

Replace heavy plugins with faster and less resource intensive ones.


Not all Minecraft plugins can be called successful: they often contain many unnecessary and unnecessary functions, and sometimes also consume a lot of memory. Unsuccessful plugins should be replaced with alternative ones (there are quite a lot of them). For example, the LWC plugin can be replaced by Wgfix + MachineGuard, and the DynMap plugin by Minecraft Overviewer.

Always clean the drop or install a plugin to automatically remove the drop


A drop in games refers to items that fall out when a mob dies or when certain blocks are destroyed. Storage and handling of drops has a lot of system resources.

For the server to work faster, it is desirable to delete the drop. It is better to do this with the help of special plug-ins - for example, NoLagg or McClean.

Do not use anti-cheat


On the game servers are often installed the so-called anti-cheat - programs that block attempts to influence the game in dishonest ways.

There are anti-cheats for Minecraft. Any anti-cheat is always an additional load on the server. It is preferable to install protections for the launcher (which, however, do not give an absolute guarantee of security and break easily - but this is a topic for a separate conversation) and for the client.

Instead of conclusion


Any instructions and recommendations are much more effective if they are supported by concrete examples. Based on the above installation instructions, we created our MineCraft server and put something interesting on the map.

Here's what we got:


We invite everyone to play on it: to connect, add a new server and specify the address mncrft.slc.tl .

We will be happy if in the comments you share your own experience of installing, configuring and optimizing MineCraft servers and tell us which mods and plugins are interesting for you and why.

Cool news: On August 1, the installation payment for dedicated servers of the fixed configuration was reduced by 50%. Now a one-time installation payment is only 3000 rubles.

Readers who can not leave comments here are invited to our blog .

Source: https://habr.com/ru/post/231935/


All Articles