Egg Repository

Pterodactyl Community Egg Repository

Subnautica

Subnautica is an open world survival action-adventure video game developed and published by Unknown Worlds Entertainment. In it, players are free to explore the ocean on an alien planet, known as planet 4546B, after their spaceship, the Aurora, crashes on the planet's surface. Note: NitroxMod version >=1.7.0.0 is required

Read Me

Subnautica: Nitrox Mod

Subnautica is an open world survival action-adventure video game developed and published by Unknown Worlds Entertainment. In it, players are free to explore the ocean on an alien planet, known as planet 4546B, after their spaceship, the Aurora, crashes on the planet's surface. The multiplayer function is provided by the mod "Nitrox". This mod is still in alpha version and therefore not yet fully stable.

NOTE

To download the base game, you will need to authenticate against Steam. Because of the normally active Steamgaurd protection, it is important to enter the Steamgaurd code. Once the initial installation is complete, you will need to enter the Steamguard code that will be emailed to you and then reinstall the server.

This will only work if you receive Steamguard codes via mail. The Authenticator app is not supported.

NOTE 2

NitroxMod version >=1.5.0.0 is required for this egg

Server Ports

The nitrox server requires only the default Server port.

Port default
Server any
Yolks
NameTag
ghcr.io/ptero-eggs/yolks:mono_latestghcr.io/ptero-eggs/yolks:mono_latest
Variables
NameDescriptionEnvironment VariableDefault ValueUser ViewableUser Editable
APP IDThe ID corresponding to the game to download.APPID264710NoNo
Steam-UsernameYour Steam-Account SUernameSTEAM_USERNAMEYesYes
Steam-PasswordYour Steam Account PasswordSTEAM_PASSWORDYesYes
Steam-GuardCodeYout Steam Guard CodeSTEAM_GUARDCODEYesYes
Nitrox VersionWhich version of Nitrox to install and use. Use the version e.g. 1.5.0.1 or latest for the newest releaseNITROX_VERSIONlatestYesYes
Auto Save IntervalTime between auto saves specified in millisecondsSAVE_INTERVAL120000YesYes
Disable Auto SaveDisables Auto Save: False / TrueSAVE_DISABLEFalseYesYes
Save NameThe save name for the server.SAVE_NAMEworldYesYes
Server PasswordPassword neccessary for connecting to the ServerSUBNAUTICA_PASSWORDYesYes
Admin PasswordIf specified, players must provide this password to gain access to administrator commands on the server.SUBNAUTICA_ADMIN_PASSWORDPleaseChangeMeYesYes
Game ModeGame Mode setting: SURVIVAL, FREEDOM, HARDCORE, CREATIVESERVER_MODESURVIVALYesYes
Auto Portforward via UPnPIf set to true, the server will try to open port on your router via UPnPPORTFORWARD_ENABLEFalseNoNo
Serializer ModeSwitch between savegame formats. Possible values: PROTOBUF, JSONSERIALIZER_MODEJSONNoNo
Extra FlagsExtra flags for steamcmd download. Do not editEXTRA_FLAGS-beta legacyNoNo
Install Script
#!/bin/bash
# Installation Script
#
# Install dependencies
dpkg --add-architecture i386
apt update
apt -y --no-install-recommends install curl jq unzip libstdc++6 ca-certificates libsdl2-2.0-0:i386

## Get latest Nitrox-Mod build
#latest_NitroxMod=$(curl --silent "https://api.github.com/repos/SubnauticaNitrox/Nitrox/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')

#if [ -z "${NITROX_VERSION}" ] || [ "${NITROX_VERSION}" == "latest" ]; then
#  DL_VERSION=$latest_NitroxMod
#else
#  DL_VERSION=${NITROX_VERSION}
#fi

## get release info and download links
GITHUB_PACKAGE="SubnauticaNitrox/Nitrox"
VERSION=${NITROX_VERSION}
MATCH="Nitrox"

LATEST_JSON=$(curl --silent "https://api.github.com/repos/${GITHUB_PACKAGE}/releases/latest")
RELEASES=$(curl --silent "https://api.github.com/repos/${GITHUB_PACKAGE}/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 "${VERSION}" '.[] | select(.tag_name==$VERSION) | .tag_name')
    if [ "${VERSION}" == "${VERSION_CHECK}" ]; then
        DOWNLOAD_URL=$(echo ${RELEASES} | jq -r --arg VERSION "${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 and install steamcmd
cd /tmp
mkdir -p /mnt/server/steamcmd
curl -sSL -o steamcmd.tar.gz https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xzvf steamcmd.tar.gz -C /mnt/server/steamcmd
cd /mnt/server/steamcmd

chown -R root:root /mnt
export HOME=/mnt/server


## Install game using steamcmd
GUARDCODE="${STEAM_GUARDCODE}"
if [ -z $GUARDCODE ]
then
    echo ""
    echo "### You did not specify a Steam Guardcode"
    echo "### A new one should be send to you shortly"
    echo "### Enter it in the startup-config after this installation is finished and reinstall the Server"
    sleep 10
    timeout 60 ./steamcmd.sh +login ${STEAM_USERNAME} ${STEAM_PASSWORD} +quit
    exit 1
fi

[ ! -d "$HOME/subnautica" ] && mkdir $HOME/subnautica
./steamcmd.sh +set_steam_guard_code ${STEAM_GUARDCODE} +login ${STEAM_USERNAME} ${STEAM_PASSWORD} +@sSteamCmdForcePlatformType windows +force_install_dir $HOME/subnautica +app_update ${APPID} ${EXTRA_FLAGS} validate +quit
status=$?

if [ $status -ne 0 ]
then
    echo ""
    echo "### The Download was not successful"
    echo "### Probably the entered Guardcode was wrong"
    echo "### A new one should be send to you shortly"
    echo "### Enter it in the startup-config after this installation is finished and reinstall the Server"
    sleep 10
    sleep 10
    timeout 30 ./steamcmd.sh +login ${STEAM_USERNAME} ${STEAM_PASSWORD} +quit
    exit 1
fi


## set up 32 bit libraries
mkdir -p $HOME/.steam/sdk32
cp -v linux32/steamclient.so ../.steam/sdk32/steamclient.so

## set up 64 bit libraries
mkdir -p $HOME/.steam/sdk64
cp -v linux64/steamclient.so ../.steam/sdk64/steamclient.so

## Download and extract Nitrox
[ -d "$HOME/nitrox" ] && rm -r $HOME/nitrox
mkdir $HOME/nitrox
cd $HOME/nitrox
curl -sL $DOWNLOAD_URL -o Nitrox.zip
unzip $HOME/nitrox/Nitrox.zip


## Create path files to Subnautica Install-Dir. Needed for versions pre 1.6.0
echo "/home/container/subnautica" > $HOME/path.txt

## Create mono registry entry for Subnautica Install-Dir. Needed for versions since 1.6.0
mkdir -p $HOME/.mono/registry/CurrentUser
    cat <<EOT > $HOME/.mono/registry/CurrentUser/values.xml
    <values>
    <value name="SOFTWARE\Nitrox\PreferredGamePath"
    type="string">/home/container/subnautica</value>
    </values>
EOT


## Create config
if [ -e $HOME/server.cfg ]; then
    echo "server settings exists"
else
    echo "writing server default settings"
    cat <<EOT > $HOME/server.cfg
    # Server settings can be changed here
    # Set to true to Cache entities for the whole map on next run. 
    # WARNING! Will make server load take longer on the cache run but players will gain a performance boost when entering new areas.
    CreateFullEntityCache=False
    # Leave blank for a random spawn position
    Seed=
    ServerPort=11000
    # Measured in milliseconds
    SaveInterval=120000
    # Command to run following a successful world save (e.g. .exe, .bat, or PowerShell script). 
    PostSaveCommandPath=
    MaxConnections=100
    InitialSyncTimeout=300000
    DisableConsole=False
    DisableAutoSave=False
    SaveName=world
    ServerPassword=
    AdminPassword=PleaseChangeMe
    # Possible values: SURVIVAL, FREEDOM, HARDCORE, CREATIVE
    GameMode=SURVIVAL
    # Possible values: PROTOBUF, JSON
    SerializerMode=JSON
    # Possible values: NONE, PLAYER, MODERATOR, ADMIN, CONSOLE
    DefaultPlayerPerm=PLAYER
    #
    # Default player stats below here
    DefaultOxygenValue=45
    DefaultMaxOxygenValue=45
    DefaultHealthValue=80
    DefaultHungerValue=50.5
    DefaultThirstValue=90.5
    # Recommended to keep at 0.1f which is the default starting value. If set to 0 then new players are cured by default.
    DefaultInfectionValue=0.1
    # If set to true, the server will try to open port on your router via UPnP
    AutoPortForward=False
EOT
fi