Egg Repository

Pterodactyl Community Egg Repository

Spigot

Spigot is the most widely-used modded Minecraft server software in the world. It powers many of the top Minecraft server networks around to ensure they can cope with their huge player base and ensure the satisfaction of their players. Spigot works by reducing and eliminating many causes of lag, as well as adding in handy features and settings that help make your job of server administration easier.

Read Me

Spigot

A high performance Minecraft server implementation

Spigot Website

Server Ports

The minecraft server requires a single port for access (default 25565) but plugins may require extra ports to enabled for the server.

Port default
Game 25565

Server Specific

Spigot was hit with a DMCA and now requires that it be built by the user.

This egg will build spigot for you

You can also supply a download link to a server jar if you want.

Yolks
NameTag
Java 8ghcr.io/ptero-eggs/yolks:java_8
Java 11ghcr.io/ptero-eggs/yolks:java_11
Java 16ghcr.io/ptero-eggs/yolks:java_16
Java 17ghcr.io/ptero-eggs/yolks:java_17
java 21ghcr.io/ptero-eggs/yolks:java_21
java 22ghcr.io/ptero-eggs/yolks:java_22
Variables
NameDescriptionEnvironment VariableDefault ValueUser ViewableUser Editable
Server Jar FileThe name of the server jarfile to run the server with.SERVER_JARFILEserver.jarYesYes
Download PathA URL to use to download Spigot rather than building it on the server. This is not user viewable. Use <code>{{DL_VERSION}}</code> in the URL to automatically insert the assigned version into the URL. If you do not enter a URL Spigot will build directly in the container (this will fail on low memory containers).DL_PATHNoNo
Spigot VersionThe version of Spigot to download (using the --rev tag from https://hub.spigotmc.org/versions). Use "latest" for latest.DL_VERSIONlatestYesYes
Install Script
#!/bin/bash
# Spigot Installation Script
#
# Server Files: /mnt/server

mkdir -p /usr/share/man/man1

ARCH=$([[ "$(uname -m)" == "x86_64" ]] && echo "x64" || echo "aarch64")
    
function install_java() {
  echo "ARCH: ${ARCH}"
  echo "Download URl: $1"
  curl -L "$1" -o java.tar.gz
  tar xzf java.tar.gz
  export PATH=$PWD/$2/bin:$PATH
  java -version
}

function build_spigot()
{
  java -Xms$1M -jar BuildTools.jar --rev "${DL_VERSION}" || { echo -e "\n install failed! Attempted to install ${DL_VERSION} with memory of ${SERVER_MEMORY} and Java version of:"; java -version; exit 1; }
}


## Only download if a path is provided, otherwise continue.
if [ -n "${DL_PATH}" ]; then
    cd /mnt/server || { echo "Failed to change directory"; exit 1;}
    MODIFIED_DOWNLOAD=$(eval echo "$(echo "${DL_PATH}" | sed -e 's/{{/${/g' -e 's/}}/}/g')")
    echo -e "Using custom provided download link ${MODIFIED_DOWNLOAD}"
    curl -L "${MODIFIED_DOWNLOAD}" -o "${SERVER_JARFILE}"
else
    # Fetch the java version info from the spigotmc API
    if [ -z "$DL_VERSION" ] || [ "$DL_VERSION" == "latest" ]; then
        DL_VERSION="latest"
        SPIGOT_VERSION_JSON=$(curl --fail -s https://hub.spigotmc.org/versions/latest.json)
    else
        # Get requested version    
        if ! SPIGOT_VERSION_JSON=$(curl --fail -s https://hub.spigotmc.org/versions/${DL_VERSION}.json) ; then
            # Default to latest
            echo "Invalid version requested... defaulting to latest."
            DL_VERSION="latest"
            SPIGOT_VERSION_JSON=$(curl --fail -s https://hub.spigotmc.org/versions/${DL_VERSION}.json)
        fi
    fi
    JAVA_VERSION_INDEX_MIN=$(echo "$SPIGOT_VERSION_JSON" | jq -r '.javaVersions[0]')
    JAVA_VERSION_INDEX_MAX=$(echo "$SPIGOT_VERSION_JSON" | jq -r '.javaVersions[1]')


    # Spigot version table - https://hub.spigotmc.org/stash/projects/SPIGOT/repos/buildtools/browse/src/main/java/org/spigotmc/builder/JavaVersion.java
    # Install the minimum supported java version
    if  [ 52 -ge "$JAVA_VERSION_INDEX_MIN" ] && [ 52 -le "$JAVA_VERSION_INDEX_MAX" ]; then
        install_java "https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u312-b07/OpenJDK8U-jdk_${ARCH}_linux_hotspot_8u312b07.tar.gz" jdk8u312-b07
    elif [ 60 -ge "$JAVA_VERSION_INDEX_MIN" ] && [ 60 -le "$JAVA_VERSION_INDEX_MAX" ]; then
        install_java "https://github.com/adoptium/temurin16-binaries/releases/download/jdk-16.0.2%2B7/OpenJDK16U-jdk_${ARCH}_linux_hotspot_16.0.2_7.tar.gz" jdk-16.0.2+7
    elif [ 61 -ge "$JAVA_VERSION_INDEX_MIN" ] && [ 61 -le "$JAVA_VERSION_INDEX_MAX" ]; then
        install_java "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.1%2B12/OpenJDK17U-jdk_${ARCH}_linux_hotspot_17.0.1_12.tar.gz" jdk-17.0.1+12
    elif [ 65 -ge "$JAVA_VERSION_INDEX_MIN" ] && [ 65 -le "$JAVA_VERSION_INDEX_MAX" ]; then
        install_java "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.3%2B9/OpenJDK21U-jdk_${ARCH}_linux_hotspot_21.0.3_9.tar.gz" jdk-21.0.3+9
    elif [ 67 -ge "$JAVA_VERSION_INDEX_MIN" ] && [ 67 -le "$JAVA_VERSION_INDEX_MAX" ]; then
        install_java "https://github.com/adoptium/temurin23-binaries/releases/download/jdk-23.0.1%2B11/OpenJDK23U-jdk_${ARCH}_linux_hotspot_23.0.1_11.tar.gz" jdk-23.0.1+11
    else
        echo "Unsupported Java version required"
        exit 1
    fi

    mkdir -p /srv/
    cd /srv/ || { echo "Failed to change directory"; exit 1;}
    curl -L https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar -o BuildTools.jar

    # Force the minimum Wings install container memory should someone provide less or 0 as it will break the Java build process
    if [ "$SERVER_MEMORY" -lt 1024 ]; then
        echo -e "Do not use 0 for memory with Java applications. Defaulting to 1024MB.\n WARNING! 1024MB might not be enough to build 1.17+ releases."
        SERVER_MEMORY=1024            
    fi
    build_spigot "${SERVER_MEMORY}"
    mv spigot-*.jar "/mnt/server/${SERVER_JARFILE}"
fi


## install end
echo "-----------------------------------------"
echo "Installation completed..."
echo "-----------------------------------------"