How to Setup a Minecraft Server on Debian or Ubuntu OS

简介: Minecraft is one of the most played games worldwide, with more than 100 million users from all over the world.

TE_002

By Arslan Ud Din Shafiq Alibaba Cloud Tech Share Author

Minecraft is one of the most played games worldwide, with more than 100 million users from all over the world. In a 3D generated place, players explore & build anything that they want. You can play as single player or you can invite your friends to join your server in multiplayer mode.

To setup your own Minecraft server on Debian or Ubuntu, follow the tutorial below. This tutorial is compatible with The World of Color release 1.12.

Note: This guide is tested for Ubuntu 16.04 LTS & Debian 8.

Prerequisites:

1.You must have Alibaba Cloud Elastic Compute Service (ECS). To get free $300 credits in your Alibaba Cloud account "Click Here".
2.You must have a version of game client from https://www.minecraft.net to use your Minecraft server.
3.You should setup your server's hostname.
4.Follow the general instructions to secure your server e.g. activating firewalls.

Minimum Requirements for these settings:

1.Ubuntu 16.04 installed or Debian 8 installed on server
2.2GB RAM required (4GB Recommended)
3.Fast Internet (Provided with every ECS on Alibaba Cloud)

Before you begin:

Before you begin installation of Minecraft on your server, you will have to follow steps below:

1.Login as root user with your root username & password via SSH client (e.g. Putty) or VNC console available in your AliBaba Cloud account dashboard.

2.You will have to update & upgrade your Debian or Ubuntu to latest packages using the following commands:

# sudo apt update && sudo apt upgrade

1

Select "install the package maintainer's version" option and then select OK.

2

3.Now you have to setup Java JDK environment & GNU Screen. For this, install OpenJDK & GNU Screen Package. OpenJDK is an open source available implementation of Java.

Install GNU Screen Packages:

To install GNU Screen Packages in Debian or Ubuntu, use the following commands:

1.Update the packages using the following commands:

# sudo apt-get update

3

# sudo apt-get upgrade

4

2.Now install screen using the following commands:

# sudo apt-get install screen

5

Install OpenJDK:

In Debian 8:

Use the following command for installing OpenJDK with GNU Screen Package in Debian 8.

# sudo apt install openjdk-8-jre-headless screen

6

In Ubuntu 16.04:

Use the following command for installing OpenJDK with GNU Screen Package in Ubuntu 16.04.

# sudo apt install openjdk-8-jre-headless screen

7

4.Now you have to create a user with root privileges:

In Debian:

In Debian, sudo is not enabled by default. You have to install sudo first. Use the following command:

# apt install sudo

8

Now add user using the following command:

# adduser minecraft

9

Now give root privileges to added user:

# adduser minecraft sudo

10

In Ubuntu:

In Ubuntu, you don't need to install sudo manually. Just add the user using the following command:

# adduser Minecraft

11

Now give root privileges to added user:

# adduser minecraft sudo

12

5.If you have activated firewalls, you will have to define a rule in AliBaba Cloud security group for your cloud server to add exception for port 25565. By default, this port is blocked by the firewalls.

To do this follow the given instructions in snapshots:

Go to your Elastic Compute Service section:

13

Click on more button for ECS you are making ready for Minecraft Server:

14

Click on Configure Rules:

15

Click on Quickly Create Rules:

16

Add the configurations as shown in screenshot below & click OK.

17

Installation of Minecraft:

1.To install Minecraft, first of all logout from your "root" account by ending SSH session in your SSH client that you are using (In my case, I used putty SSH client.).
2.Login back to via SSH client or VNC console available in your Alibaba Cloud account dashboard as user "minecraft" that we created with root privileges.
3.Now you have to download latest version of the Minecraft Multiplayer Server from https://www.minecraft.net using the following command:

# wget https://s3.amazonaws.com/Minecraft.Download/versions/1.12/minecraft_server.1.12.jar

18

Note: You can replace the above URL with latest release URL. You can check latest release from https://minecraft.net/en/download/server

4.Now you have to create a script to run your Minecraft Server. You can do this as below:

• Open file using the command below:

# sudo nano /home/minecraft/run.sh

19

• Add the following lines in opened file.

1. 1. #!/bin/sh
2. 2. BINDER=$(dirname "$(readlink -fn "$0")")
3. 3. cd "$BINDIR"
4. 4. java -Xms1024M -Xmx1536M -jar minecraft_server.1.12.jar -o true

20

Note: Xmx & Xms are the flags that are used to define maximum and minimum RAM respectively that will be used by your Minecraft server. Above settings are recommended for AliBaba Cloud's Elastic Compute Service (ECS) with 2GB RAM. If you have more available RAM, you can modify flag settings according to your desire.

5.Now Press "Ctrl+x".
6.Now Press "Y".
7.Now Press Enter Key to save the file.
8.Now make run.sh an executable file by using the following command:

# sudo chmod +x /home/minecraft/run.sh


21

Now Run Minecraft:

1.When you will run Minecraft server first time using the following command, EULA file will be created and it will exit from running state.

# ./run.sh

22

2.Open eula.txt file using the following command:

# sudo nano /home/minecraft/eula.txt

23

3.Now change the value of eula in opened file to "true".
4.Now Press "Ctrl+x".
5.Now Press "Y".
6.Now Press Enter Key to save the file.
7.Now to ensure that your Minecraft Server runs without SSH connection, use the following command to execute run.sh within your GNU Screen session:

# screen /home/minecraft/run.sh

Minecraft Server will create required configurations files & generate Minecraft World.
8.To disconnect yourself from server session without stopping the server, Press "Ctrl+a" & then press "d". You can resume the screen session using command:
# screen -r

Now Connect to your Minecraft Server:

1.Now open your Minecraft client and login. After logging in, select Multiplayer option.
2.Then select Add Server and enter your Alibaba Cloud Elastic Compute Service (ECS) instance IP address or domain name. Then select done.
3.Your server is available now for incoming connections. Select Join Server to connect to the server.

目录
相关文章
|
1月前
|
数据安全/隐私保护 虚拟化 Windows
如何在 VM 虚拟机中安装 Windows Server 2012 操作系统保姆级教程(附链接)
如何在 VM 虚拟机中安装 Windows Server 2012 操作系统保姆级教程(附链接)
55 0
|
1月前
|
存储 Ubuntu 网络安全
|
资源调度 算法 安全
腾讯开源 TencentOS Server Kernel 云场景服务器操作系统
导读:据腾讯官方消息,1月9日,腾讯云宣布开源其云服务器操作系统 TencentOS 内核(TencentOS Server Kernel,又称 Tencent Linux,简称 Tlinux),是腾讯针对云的场景研发的服务器操作系统。提供了专门的功能特性和性能优化,为云服务器实例中的应用程序提供高性能,且更加安全可靠的运行环境...
627 1
腾讯开源 TencentOS Server Kernel 云场景服务器操作系统
|
弹性计算 Windows
阿里云Windows Server 2008云服务器操作系统镜像支持
阿里云服务器ECS可以安装Windows Server 2008操作系统,有同学在找Windows 2008操作系统,微软停止对Windows Server 2008扩展支持,了解风险并同意《申请续用 Windows Server 2008 镜像服务协议》即可使用Windows2008。
750 0
阿里云Windows Server 2008云服务器操作系统镜像支持
|
弹性计算 Windows
阿里云服务器支持Windows Server 2008操作系统镜像
阿里云服务器Windows Server 2008操作系统镜像支持
411 0
阿里云服务器支持Windows Server 2008操作系统镜像
|
弹性计算 数据中心 Windows
阿里云服务器Windows Server操作系统内存系统盘限制说明
阿里云服务器Windows操作系统注意事项,建议内存2GB起步,1GiB内存的实例和Windows Server 2012的组合可能会因为内存使用率过高导致系统不稳定。推荐您在2GiB以上内存的实例规格中使用Windows Server 2012及以上版本,或者在1GiB内存的实例规格时使用Windows Server 2008。
320 0
阿里云服务器Windows Server操作系统内存系统盘限制说明
|
安全 网络安全 开发工具
Mac OS X下架设WebDAV Git Server
因为我的 mac mini server 不想开著 ssh 一直给人扫,所以想设定 https 的 git server,试了一下真的超简单的。
432 0
Mac OS X下架设WebDAV Git Server
|
弹性计算 Ubuntu 安全
How to Set Up an ARK: Survival Evolved Server on Ubuntu OS
In this tutorial, we will be hosting an ARK: Survival Evolved dedicated gaming server using an Alibaba Cloud ECS instance (Ubuntu 16.04).
3649 0
How to Set Up an ARK: Survival Evolved Server on Ubuntu OS