Linode Minecraft Spigot Server

by tory
47 deployments · 20 still active · last rev. 1 year ago

Install the Spigot server on your Linode to play Minecraft. McMyAdmin will also be installed and is used to manage launch & manage Spigot.

Once the install is complete, please navigate to your Linode's IP -> http://IP:8080. Login will be admin for username and the password is what you enter in the field below.

Compatible with: Ubuntu 18.04 LTS
#<UDF name="pass" label="McMyAdmin Password">
# Version control:

# Added logging for debug purposes
exec >  >(tee -a /root/stackscript.log)
exec 2> >(tee -a /root/stackscript.log >&2)

# Install pre-reqs
export DEBIAN_FRONTEND=noninteractive
apt -q -y install git openjdk-8-jre-headless expect unzip

# Create a user for Spigot
adduser --disabled-password --gecos "" spigot
chown -R spigot:spigot /home/spigot

# Install McMyAdmin
cd /usr/local
unzip; rm

su - spigot -c "mkdir /home/spigot/McMyAdmin"

# Setup a Bash script for the install
cat <<EOF >> /home/spigot/McMyAdmin/
cd /home/spigot/McMyAdmin
wget -O /home/spigot/McMyAdmin/
unzip /home/spigot/McMyAdmin/
rm /home/spigot/McMyAdmin/
chmod +x /home/spigot/McMyAdmin/
/home/spigot/McMyAdmin/MCMA2_Linux_x86_64 -setpass $PASS -configonly -nonotice
tmux new -s McMyAdmin -d /home/spigot/McMyAdmin/MCMA2_Linux_x86_64

chown -R spigot:spigot /home/spigot

su - spigot -c "chmod +x /home/spigot/McMyAdmin/ && /home/spigot/McMyAdmin/"

# Install and compile!
su - spigot -c "mkdir /home/spigot/BuildTools && mkdir /home/spigot/spigot"
su - spigot -c "wget -O ~/BuildTools/BuildTools.jar"
su - spigot -c "git config --global --unset core.autocrlf"
su - spigot -c "java -jar ~/BuildTools/BuildTools.jar"

# Mark EULA as true and fire up the server
su - spigot -c "java -Xms1G -Xmx1G -XX:+UseConcMarkSweepGC -jar ~/spigot*.jar"
su - spigot -c "sed -i \"s/eula=false/eula=true/\" /home/spigot/eula.txt"

# Move Spigot jar
su - spigot -c "mv /home/spigot/spigot*.jar /home/spigot/McMyAdmin/Minecraft/"