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
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.
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.
NitroxMod version >=1.5.0.0 is required for this egg
The nitrox server requires only the default Server port.
Port | default |
---|---|
Server | any |
Name | Tag |
---|---|
ghcr.io/ptero-eggs/yolks:mono_latest | ghcr.io/ptero-eggs/yolks:mono_latest |
Name | Description | Environment Variable | Default Value | User Viewable | User Editable |
---|---|---|---|---|---|
APP ID | The ID corresponding to the game to download. | APPID | 264710 | No | No |
Steam-Username | Your Steam-Account SUername | STEAM_USERNAME | Yes | Yes | |
Steam-Password | Your Steam Account Password | STEAM_PASSWORD | Yes | Yes | |
Steam-GuardCode | Yout Steam Guard Code | STEAM_GUARDCODE | Yes | Yes | |
Nitrox Version | Which version of Nitrox to install and use. Use the version e.g. 1.5.0.1 or latest for the newest release | NITROX_VERSION | latest | Yes | Yes |
Auto Save Interval | Time between auto saves specified in milliseconds | SAVE_INTERVAL | 120000 | Yes | Yes |
Disable Auto Save | Disables Auto Save: False / True | SAVE_DISABLE | False | Yes | Yes |
Save Name | The save name for the server. | SAVE_NAME | world | Yes | Yes |
Server Password | Password neccessary for connecting to the Server | SUBNAUTICA_PASSWORD | Yes | Yes | |
Admin Password | If specified, players must provide this password to gain access to administrator commands on the server. | SUBNAUTICA_ADMIN_PASSWORD | PleaseChangeMe | Yes | Yes |
Game Mode | Game Mode setting: SURVIVAL, FREEDOM, HARDCORE, CREATIVE | SERVER_MODE | SURVIVAL | Yes | Yes |
Auto Portforward via UPnP | If set to true, the server will try to open port on your router via UPnP | PORTFORWARD_ENABLE | False | No | No |
Serializer Mode | Switch between savegame formats. Possible values: PROTOBUF, JSON | SERIALIZER_MODE | JSON | No | No |
Extra Flags | Extra flags for steamcmd download. Do not edit | EXTRA_FLAGS | -beta legacy | No | No |
#!/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