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.

目录
相关文章
|
5月前
|
Ubuntu Linux 索引
Centos 7、Debian及Ubuntu系统中安装和验证tree命令的指南。
通过上述步骤,我们可以在CentOS 7、Debian和Ubuntu系统中安装并验证 `tree`命令。在命令行界面中执行安装命令,然后通过版本检查确认安装成功。这保证了在多个平台上 `tree`命令的一致性和可用性,使得用户无论在哪种Linux发行版上都能使用此工具浏览目录结构。
488 78
|
6月前
|
Ubuntu 安全 Docker
Ubuntu Server上安装配置Docker的详细步骤
如果一切设置正确,这将下载一个测试镜像,并在容器中运行它,打印一条问候消息。
878 76
|
6月前
|
Ubuntu 网络协议 虚拟化
在VMware环境安装Ubuntu Server中遇到的无法安装问题
安装Ubuntu Server中遇到的无法安装问题解决思路
|
7月前
|
Ubuntu Linux Shell
Linux环境下VSCode快速安装终极指南:debian/ubuntu/linux平台通用
以上就是在Linux环境下安装VSCode的终极指南,抛开繁复的专业词汇,以平易近人的文字、形象生动的比喻让你轻松学会这一过程。别忘了,你的小伙伴VSCode已经在应用菜单里等你了!
2277 23
|
10月前
|
Ubuntu 安全 Linux
ubuntu2404 Server扩展PV
通过以上步骤,你可以成功扩展Ubuntu 24.04 Server上的物理卷。该过程包括创建新分区、将其添加到现有PV、扩展逻辑卷和相应的文件系统。扩展完成后,服务器将能够使用新增的存储空间,确保系统运行更加高效和稳定。
376 77
|
8月前
|
监控 Ubuntu 应用服务中间件
MyEMS开源系统安装之Debian/Ubuntu(下)
本文详细讲解了在Debian或Ubuntu服务器上部署MyEMS的安装步骤,分为上下篇。内容涵盖myems-cleaning、myems-normalization、myems-aggregation和myems-web服务的安装与配置,包括环境准备、依赖安装、服务启用及监控、Nginx配置等关键环节。同时提供默认端口、账号密码信息及故障排除指南,助您顺利完成部署并登录MyEMS管理界面。
252 4
|
8月前
|
Ubuntu 应用服务中间件 网络安全
MyEMS开源系统安装之Debian/Ubuntu(上)
本文详细讲解在Debian或Ubuntu服务器上部署MyEMS的步骤,分为上下篇。本篇(上)涵盖以下内容: 1. **前提准备**:介绍支持的操作系统版本及硬件需求,克隆MyEMS源代码。 2. **数据库安装**:参考外部链接完成数据库配置。 3. **myems-api服务**:包括环境配置、依赖安装、防火墙设置及systemd服务配置。 4. **myems-admin模块**:安装和配置Nginx服务器,设置反向代理,部署myems-admin前端。 5. **myems-modbus-tcp服务**:安装依赖、配置环境变量并启动服务。
256 2
|
9月前
|
Ubuntu 编译器 开发工具
基于Ubuntu Server的YTM32 SDK工程编译
希望这个“烹饪”比喻能帮助你理解SDK工程编译的过程。记住,编程就像烹饪一样,需要耐心,实践,和不断的学习。祝你烹饪愉快!
167 21
|
8月前
|
Ubuntu 虚拟化 Windows
无影云电脑选择哪个操作系统Windows server 2019还是Ubuntu?
在选择阿里云无影云电脑的操作系统时,Windows Server 2019 和 Ubuntu 各有优势。Windows适合依赖微软生态的企业级应用,提供图形化界面和高安全性;Ubuntu则轻量、经济,适合开源工具链和容器化部署。根据应用场景、资源占用、安全性、开发效率及成本考量,选择最适合的系统。条件允许下,可采用混合方案满足多样化需求。
|
监控 Ubuntu 安全
debian或Ubuntu中开启ssh允许root远程ssh登录的方法
在Debian或Ubuntu系统中启用root用户的SSH远程登录需要编辑SSH配置文件、设置root密码并重启SSH服务。虽然这可以在某些情况下提供便利,但必须注意安全性,通过使用强密码、限制IP访问、使用SSH密钥认证等方法来保护服务器的安全。
5626 5