50 lines
1.2 KiB
Markdown
50 lines
1.2 KiB
Markdown
# Best to run on sudo su - because of permisions
|
|
|
|
# Just to be shure
|
|
sudo apt update
|
|
sudo apt upgrade -y
|
|
|
|
# SSH keys
|
|
ssh-copy-id -f -i mc-perfect.pub godot@localhost
|
|
|
|
# Dependencies
|
|
sudo apt install qemu-guest-agent neofetch btop vim tmux -y # I like these
|
|
sudo apt install openjdk-17-jre-headless screen p7zip-full -y # Realy needed
|
|
|
|
#User and groupe managment
|
|
groupadd minecraft
|
|
useradd --system --shell /usr/sbin/nologin --home /opt/minecraft -g minecraft minecraf
|
|
|
|
# File strukture and basic install
|
|
mkdir /opt/minecraft # it may exist
|
|
cp Mods.zip Forge-1.20.1.jar eula.txt server.properties run.sh mc-forge.service /opt/
|
|
mv Forge-1.20.1.jar minecraft/
|
|
cd /opt/minecraft/
|
|
java -Xms512M -Xmx2048M -jar Forge-1.20.1.jar --installServer
|
|
./run.sh # wait antil proces is stoped
|
|
rm eula.txt
|
|
mv ../eula.txt .
|
|
^C
|
|
rm -rf world/
|
|
rm server.properties
|
|
mv ../server.properties .
|
|
rm run.sh
|
|
mv ../run.sh .
|
|
7z x ../Mods.zip -omods
|
|
|
|
# SystemD service
|
|
cp mc-forge.service /etc/systemd/system/
|
|
systemctl enable mc-forge
|
|
|
|
# Permision handeling
|
|
chown -R minecraft:minecraft /opt/minecraft
|
|
|
|
# ipTable script integration
|
|
# **Integration of script**
|
|
|
|
# CloudFlare integration
|
|
# **TODO!**
|
|
|
|
# Start server thruw systemD
|
|
systemctl start mc-forge.service
|