Skip to content

Instantly share code, notes, and snippets.

@SaidTorres3
Last active March 11, 2024 19:53
Show Gist options
  • Save SaidTorres3/e5ff4fac06b35ce2b456dc3ab872d02e to your computer and use it in GitHub Desktop.
Save SaidTorres3/e5ff4fac06b35ce2b456dc3ab872d02e to your computer and use it in GitHub Desktop.
MC
# Update and upgrade
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install software-properties-common ca-certificates apt-transport-https gnupg curl tmux
# Install java
curl https://apt.corretto.aws/corretto.key | sudo apt-key add -
sudo add-apt-repository 'deb https://apt.corretto.aws stable main'
mkdir mc-server
cd mc-server
sudo apt-get update
sudo apt-get install -y java-21-amazon-corretto-jdk libxi6 libxtst6 libxrender1
# Upload the jar file to https://www.keep.sh/ and download with the following example:
# ``` curl -L {GENERATED_URL} > server.jar ```
echo "java -Xmx4024M -Xms4024M -jar server.jar nogui" > start.sh
sudo chmod +x ./start.sh
# Run the server
tmux new-session -s mc-server -d './start.sh'
# See the server
tmux attach -t mc-server
# Deatach from the server
(Ctrl + B) + (D)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment