;

How to install ARK: Survival of the Fittest Server on Ubuntu 14

Try it in our public cloud & Get $5 Credit
CLAIM NOW

Ark: Survival Of The Fittest

How to install ARK: Survival of the Fittest Server on Ubuntu 14

Ark: Survival of the Fittest is a game mode for the popular action adventure game Ark: Survival Evolved. It was released in 2016 as a free standalone game, but was later merged back into the main game. For those lucky enough to begin playing while it was free, you can continue to do so, and even install servers for multiplayer play with your friends.

Getting started

In order to install the Ark: Survival of the Fittest server software, you will need the following:
• 1 server (Cloud Server or Dedicated Server) running a fresh installation of Ubuntu 14.
• All commands must be entered as root with the exception of some performed by a user that we will create specifically for running Steam.
• 2 vCores and 6GB RAM. These are the minimum requirements for an Ark server that can handle up to 10 users.

Tutorial

The very first task is to make sure that your system is fully up to date, and also that you have the basic dependencies:
apt-get update && apt-get upgrade -y
apt-get install nano wget tar lib32gcc1 -y

For Steam-specific tasks, we will need to create an user, as it’s unsafe to use Steam with the root user.
adduser --disabled-login --disabled-password steam

The next task is to prepare your system with certain parameters to allow the game server to run correctly. We’ll need to increase the amount of simultaneous system files that can be opened, which can be effected through a quick edit of sysctl.conf..
echo "fs.file-max=100000" >> /etc/sysctl.conf
sysctl -p

Append some changes to the system limits configuration file.
echo "* soft nofile 1000000" >> /etc/security/limits.conf
echo "* hard nofile 1000000" >> /etc/security/limits.conf

And then lastly, enable the PAM limits module on the system.
echo "session required pam_limits.so" >> /etc/pam.d/common-session

Now that the system has been prepared, you can proceed with installing the server software.
cd /home/steam
su - steam
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -zxvf steamcmd_linux.tar.gz
rm steamcmd_linux.tar.gz
./steamcmd.sh

Once you’ve entered the Steam command line interface, you can install your game server by executing the following commands.
login anonymous
force_install_dir ./arkserver
app_update 445400 validate

You will have to wait for the contents to download onto your system. A successful installation will be rewarded with this message:
Update state (0x61) downloading, progress: 99.95 (3222988684 / 3224465090)
Success! App '445400' fully installed.

Now that you’re done, it’s a simple matter to type quit to get out of the steam command line interface.

Next are some commands that you will have to perform as the root user on your machine. We’ll be tackling the server configuration and the startup script.

You will need to make an init script so that the ark server will be sure to start up on boot, after a server reboot occurs. This is the name of the init script you will create:
nano /etc/init.d/arkserver

Now place this into the file, while making sure that the DAEMON_ARGS variable contains your server’s configuration.
#! /bin/sh
### BEGIN INIT INFO
# Provides: skeleton
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
### END INIT INFO
# Author: Foo Bar
#
# Please remove the "Author" lines above and replace them
# with your own name if you copy and modify this script.
# Do NOT "set -e"
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/home/steam/arkserver/ShooterGame/Binaries/Linux:/sbin:/usr/sbin:/bin:/usr/bin
DESC="ARK Dedicated Server"
NAME=ShooterGameServer
DAEMON=/home/steam/arkserver/ShooterGame/Binaries/Linux/$NAME
DAEMON_ARGS="TheIsland?listen?SessionName=MyARKServer?ServerPassword=friendspassword?ServerAdminPassword=superadminpassword -server -log"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/arkserver
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
. /lib/lsb/init-functions
#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --background --pidfile $PIDFILE --make-pidfile --chuid 1000:1000 --exec $DAEMON --test > /dev/null 2>&1 \
|| return 1
start-stop-daemon --start --quiet --background --pidfile $PIDFILE --make-pidfile --chuid 1000:1000 --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
# Add code here, if necessary, that waits for the process to be ready
# to handle requests from services started subsequently which depend
# on this one. As a last resort, sleep for some time.
#return 0
}
#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/INT/15/KILL/5 --pidfile $PIDFILE --chuid 1000:1000 --exec $DAEMON
RETVAL="$?"
kill -9 `cat $PIDFILE`
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
##start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
##[ "$?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
rm -f $PIDFILE
return "$RETVAL"
}
#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
#
# If the daemon can reload its configuration without
# restarting (for example, when it is sent a SIGHUP),
# then implement that here.
#
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME &
return 0
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
#reload|force-reload)
#
# If do_reload() is not implemented then leave this commented out
# and leave 'force-reload' as an alias for 'restart'.
#
#log_daemon_msg "Reloading $DESC" "$NAME"
#do_reload
#log_end_msg $?
#;;
restart|force-reload)
#
# If the "reload" option is implemented then remove the
# 'force-reload' alias
#
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac

Naturally, you will need to change the permissions of your init script so that it is executable.
chmod +x /etc/init.d/arkserver

Start the Ark server, and enable it on system boot.
update-rc.d arkserver defaults
service arkserver start

The below command will allow you to check that the Ark server is running. This is the expected output that will confirm that the daemon is running and in working order:
service arkserver status
* ShooterGameServer is running

The final step is to adjust your firewall rules to let Ark and user traffic through. If you are using a fresh Ubuntu installation as specified in the prerequirements, then you will need to make no further changes than what’s listed below. If you’ve already changed your firewall rules in the past, then you may need to make further adjustments.

Here’s how to open the necessary ports.
ufw allow 27015/udp
ufw allow 7777/udp
ufw allow 32330/tcp

Here’s a definition of the purpose of each port:

UDP 27015: Query port for Steam’s server browser
UDP 7777: Game client port
TCP 32330: RCON for remote console server access (optional)

Here’s a way to open the ports if you’re using the classic iptables interface:
iptables -A INPUT -p udp -m udp --sport 27015 --dport 1025:65355 -j ACCEPT
iptables -A INPUT -p udp -m udp --sport 7777 --dport 1025:65355 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --sport 32330 --dport 1025:65355 -j ACCEPT

Conclusion

You should now have a properly installed ARK: Survival of the Fittest server suitable for up to 10 players. Invite your friends and test it out!