Forge сервер на линукс

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

ItsVeno/1.18.1-Minecraft-Forge-Server-on-Linux

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

This is my first time creating a Minecraft Forge Server on Linux, so in my research of how to do it, I have found much confusion on how to run the server. This is due to the fact that Forge used to be ran using a .jar file, but this is not the case anymore. All of the tutorials I see are pre 1.18.1 and do not show how to run the server with the new file for linux, which is a .sh file. I am going to go through step by step to show you how to install a brand new 1.18.1 Minecraft Forge Server on Linux. Note: I am using a 64-bit Debian distribution of Linux, but I believe this works for every version of linux.

Читайте также:  Check system settings linux

Источник

Build a Modded Minecraft Server on Linux

b) Install screen (This will be needed to run your minecraft server console while logged out of your Linux server).

Step 4 — Download The Forge Installer

cd /opt mkdir minecraft cd minecraft

Now download the version 1.12.2 Forge Installer. Pick the Latest Installer file (not the Universal file) and copy it to your /opt/minecraft folder.

You should now have only one jar file in your /opt/minecraft folder.

Step 5 — Configure your new Modded Minecraft Server

java -jar forge-1.12.2-14.23.5.2860-installer.jar --installServer
assuming a server with 2048MB (2GB RAM) cd /opt/minecraft && java -Xms1024M -Xmx2000M -jar /opt/minecraft/forge-1.12.2-14.23.5.2860.jar nogui

b) accept the EULA. The first time you try to run your minecraft server you will be required to accept the EULA.

e) Run the server again to generate your world. World generation will take a little longer the first time. Subsequent server starts will be much quicker.
Before doing this, you can download the following server.properties file and replace the one that was created automatically. (or copy/paste directly to your existing server.properties file from the console).
This server.properties file will give you a standard survival world on normal difficulty.

Edit the file with your preferred seed if you have one and it will generate the world that you specify.

nano server.properties change the following line with your preferred seed directly after the = sign level-seed= If you leave it blank Minecraft will generate a random world on first launch

f) make things a little easier on yourself by using a script to start minecraft

cd /opt && mkdir scripts cd scripts nano minecraft.sh
#!/bin/bash cd /opt/minecraft/ && java -Xms1024M -Xmx2000M -jar /opt/minecraft/forge-1.12.2-14.23.5.2860.jar nogui

Step 6 — Optional— Configure Minecraft to start on bootup.

Right before the last line ‘exit 0’ add the following command, save and exit the file. This will allow the minecraft server to start in a detached screen session when the server boots up.

screen -dm -S minecraft /opt/scripts/minecraft.sh

Note: rc.local still works on some Debian derivitaves such as Ubuntu 16.04LTS. On Debian proper and Ubuntu 18.04 LTS, rc.local has been deprecated. To re-enable rc.local you can simply re-create /etc/rc.local file as follows;

#!/bin/sh screen -dm -S minecraft /opt/scripts/minecraft.sh exit 0

If that doesn’t work you may have to re-enable the rc.local service. Use the following set of instructions. However this should not be necessary.

Читайте также:  Nvidia gtx 1650 driver linux

Also note that I have not tested this on Ubuntu 20.04LTS but you should be able to re-enable rc.local there as well.

b) To access your console after bootup use the following command;

screen -r minecraft To exit the screen session use the following command CTRL AD

Step 7 — Connect to Your Server

Add Server Image

d) Enter your world for the first time and have fun.

New Server Image

Step 8 — Hardening Your Minecraft Server if Visible on the Internet

b) Activate whitelisting. It is extremely important to activate whitelisting if your server is visible on the internet.
In your server.properties set the following value to true;

white-list=true Restart your minecraft server and run the following command at the console for each user you would like to allow. whitelist add minecraft_user1 whitelist add minecraft_user2 To remove a user whitelist remove minecraft_user2

Step 9 — Backup Your Server Frequently

login to your server cd /opt tar -zcvf minecraft_backup.tar.gz minecraft

Step 10 — Recovering a Corrupted World

Delete your existing minecraft folder cd /opt rm -r -f minecraft copy your previously saved minecraft.tar.gz file to your /opt folder. restore your world tar -zxvf minecraft.tar.gz

That’s it, restart your server and you have successfully restored from your last good backup. Any changes you made since that backup are gone, so it is important to do your backups regularly.

Step 11 — Creating Automatic Backups

This will create a 7 day rotation of backups with the oldest being overwritten with a new one.

cd /opt/scripts nano mcbackup.sh

b) copy and paste this script into your mcbackup.sh file you have open in the nano editor. Change the dest= line to point to the folder you want your backups to reside in.

#!/bin/sh #################################### # # Backup minecraft world to a # specified folder. # #################################### # What to backup. Name of minecraft folder in /opt backup_files="minecraft" # Specify which directory to backup to. # Make sure you have enough space to hold 7 days of backups. This # can be on the server itself, to an external hard drive or mounted network share. # Warning: minecraft worlds can get fairly large so choose your backup destination accordingly. dest="/home/username/minecraftbackups" # Create backup archive filename. day=$(date +%A) archive_file="$day-$backup_files-.tar.gz" # Backup the files using tar. cd /opt && tar zcvf $dest/$archive_file $backup_files

c) Save the file by pressing CTRL-X and entering Y

Читайте также:  Переход в файл linux

d) Make the file executable

f) Create a scheduled task with the cron scheduler
Make sure you are logged in as root so that it writes to your root user crontab.

02 2 * * * /opt/scripts/mcbackup.sh &> /dev/null
Monday-mcbackup-.tar.gz Tuesday-mcbackup-.tar.gz Wednesday-mcbackup-.tar.gz Thursday-mcbackup-.tar.gz Friday-mcbackup-.tar.gz Saturday-mcbackup-.tar.gz Sunday-mcbackup-.tar.gz

Every day your oldest file will be replaced with the new backup giving you a seven day rotation of backups.

If you found these instructions helpful a small donation is appreciated. I will be keeping these instructions up to date with the latest versions of Minecraft and Oracle Java.

Источник

Оцените статью
Adblock
detector