Egg Repository

Pterodactyl Community Egg Repository

Code-Server

Run VS Code on any machine anywhere and access it in the browser.

Read Me

Code-Server

From the Code-Server GitHub

Run VS Code on any machine anywhere and access it in the browser.

Server Ports

Ports required to run the server in a table format.

Port default
Game 8080
Yolks
NameTag
ghcr.io/ptero-eggs/yolks:nodejs_12ghcr.io/ptero-eggs/yolks:nodejs_12
ghcr.io/ptero-eggs/yolks:nodejs_14ghcr.io/ptero-eggs/yolks:nodejs_14
ghcr.io/ptero-eggs/yolks:nodejs_16ghcr.io/ptero-eggs/yolks:nodejs_16
ghcr.io/ptero-eggs/yolks:nodejs_17ghcr.io/ptero-eggs/yolks:nodejs_17
ghcr.io/ptero-eggs/yolks:nodejs_18ghcr.io/ptero-eggs/yolks:nodejs_18
Variables
NameDescriptionEnvironment VariableDefault ValueUser ViewableUser Editable
PasswordPassword to login to your Code-Server instancePASSWORDchangemeYesYes
VersionVersion for (re)installation such as 3.9.3. Defaults to latest version if no valid version is providedVERSIONlatestYesYes
Install Script
apt update
apt install -y curl jq


ARCH=$([[ "$(uname -m)" == "x86_64" ]] && echo "amd64" || echo "arm64")
MATCH=linux-${ARCH}
# Create initial directories
mkdir -p /mnt/server
cd /mnt/server

echo ${ARCH}
echo ${MATCH}
# Create needed directories
mkdir -p /mnt/server/.local/lib /mnt/server/.local/bin /mnt/server/.config/code-server /mnt/server/projects

# Change permission of projects directory so it can be accessed by code-server
chmod 777 /mnt/server/projects
touch "/mnt/server/projects/PLACE YOUR PROJECTS HERE"

# Check for available versions. Defaults to latest if no valid version is found.
LATEST_JSON=$(curl --silent "https://api.github.com/repos/coder/code-server/releases/latest")
RELEASES=$(curl --silent "https://api.github.com/repos/coder/code-server/releases")

if [ -z "${VERSION}" ] || [ "${VERSION}" == "latest" ]; then
    DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url | grep -i ${MATCH})
else
    VERSION_CHECK=$(echo ${RELEASES} | jq -r --arg VERSION "v${VERSION}" '.[] | select(.tag_name==$VERSION) | .tag_name')
    if [ "v${VERSION}" == "${VERSION_CHECK}" ]; then
        DOWNLOAD_URL=$(echo ${RELEASES} | jq -r --arg VERSION "v${VERSION}" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i ${MATCH})
    else
        echo -e "defaulting to latest release"
        DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)
    fi
fi

# Download the given Version and extract it
echo "Downloading $DOWNLOAD_URL"
curl -fL $DOWNLOAD_URL | tar -C /mnt/server/.local/lib -xz
mv /mnt/server/.local/lib/code-server-*linux-${ARCH} /mnt/server/.local/lib/code-server-${VERSION}


PATH="/mnt/server/.local/bin:$PATH"
echo "password: changeme
bind-addr: 0.0.0.0
auth: password
cert: false" > /mnt/server/.config/code-server/config.yaml

echo "Install complete"