How to Set Up an ARK: Survival Evolved Server on Ubuntu OS
Playing on Cloud 9. If you're familiar with this action-adventure game, check out how to play it with others on this Ubuntu server in the cloud.
Join the DZone community and get the full member experience.
Join For FreeARK: Survival Evolved is an adventure-action genre video game. It is my personal favorite and one of the most played games worldwide. You can play as a single-player or play with your friends on a server in multiplayer mode. There are a few ways to host a multiplayer server: buying a dedicated gaming server, using a third-party service, or creating your own on Alibaba Cloud!
As a gamer and developer, I prefer to have more flexibility when it comes to creating dedicated gaming servers. One major benefit of using a cloud provider, such as Alibaba Cloud, is that I do not have to worry about maintaining or upgrading the hardware in my server. It is also elastic, which means that I can easily scale my resources based on demands.
In this tutorial, I will be using an Ubuntu 16.04 server on Alibaba Cloud Elastic Compute Service (ECS). You could also use other operating systems (OS); however, the steps may differ slightly from this tutorial. To setup your own ARK: Survival Evolved server, follow the tutorial below.
Prerequisites:
- You must have an Alibaba Cloud ECS instance activated. If you are a new user, you can get free $300 credit in your Alibaba Cloud account. If you don't know how to setup your instance, you can refer to this tutorial or the quick-start guide.
- You must have a copy of the game client from https://www.playark.com to use your ARK: Survival Evolved server.
- You should set up your server's hostname.
Minimum Requirements for ARK: Survival Evolved Server:
- Ubuntu 16.04 (64 bit) installed on your Alibaba Cloud ECS
- 6 GB RAM required (8 GB Recommended)
- Fast Internet (you can purchase bandwidth on ECS for internet access)
Setting Up Ubuntu for SteamCMD
After completing the prerequisites, you will need to set up Ubuntu correctly on your ECS instance.
Login as root user with your root username & password via SSH client (e.g. Putty – You can get Putty from https://www.putty.org ). You can also connect directly using the Alibaba Cloud console.
You will have to update & upgrade your Ubuntu to latest packages using the following commands:
# sudo apt-get update && sudo apt-get upgrade
When you see the following message, type 'Y' and press Enter key.
Select “install the package maintainer's version” option and then select OK.
Installing SteamCMD
To install SteamCMD in Ubuntu, follow the steps below:
You will have to open the sources.list in nano editor using the following command:
# sudo nano /etc/apt/sources.list
2. Write the following lines in opened sources.list file as shown below:
deb http://archive.ubuntu.com/ubuntu xenial main universe multiverse |
deb http://archive.ubuntu.com/ubuntu xenial-updates main universe multiverse |
deb http://archive.ubuntu.com/ubuntu xenial-security main universe multiverse |
After you have done writing, press Ctrl + X, type 'Y' and press Enter key. Now, type the following command in your terminal:
# sudo dpkg --add-architecture i386
Now you will need to update your package again using the following command:
# sudo apt-get update
Now type the following command to proceed towards the installation of SteamCMD:
# sudo apt-get install steamcmd
If the above command gives any error, then you may use the following command:
# sudo apt-get -f install steamcmd
After the execution of above command, you will see the following screen. Type 'Y' and press Enter key.
During the installation of SteamCMD, a screen will appear to ask regarding terms and agreements. Select the OK option and then select I AGREE to accept these terms and agreements and select OK.
Adding a New User in Ubuntu
To avoid any security issues, you will have to add another user to your server.
To add user, use the following command:
# adduser ark
Note: ark
can be any username of your choice.
- Select the password of your choice:
- Enter your information like Full Name, Phone Number, etc.
- Confirm your information is correct by typing 'Y' and press Enter.
- To assign admin rights to user, use the following command:
# adduser ark sudo
Configure Open Files Limit:
Use the following command to open /etc/sysctl.conf file:
# sudo nano /etc/sysctl.conf
Add the following line:
fs.file-max=100000
Press Ctrl + X, write "Y" and press Enter. Then run:
# sysctl -p /etc/sysctl.conf
Use the following command to open /etc/security/limits.conf file:
# sudo nano /etc/security/limits.conf
Update the following lines to the lines below in the opened file and use Ctrl + X, then type 'Y' and press Enter to save the settings:
* softnofile1000000
* hardnofile1000000
Use the following command to open /etc/pam.d/common-session file:
# sudo nano /etc/pam.d/common-session
Add the following line in the opened file as shown in the screenshot below and use Ctrl + X, then type 'Y' and press Enter to save the settings:
# session required pam_limits.so
The above changes are necessary for tuning. Otherwise, the consumption of system resources would be higher.
Installing ARK Server
Now, let's proceed towards the installation of the ARK server. Firstly, you will have to create a server directory that contains the files of your ARK server. To create a directory, execute the following commands in your terminal:
# mkdir server
The argument server is the name of directory.
Now, let's create a symlink
from the location /usr/games/steamcmd to steamcmd
in your user's directory. In my case, the username is ark
, so mine would be ark user's directory. To do this, use the following command:
# ln -s /usr/games/steamcmd steamcmd
Use the following command to run streamcmd
for the installation of the ARK server.
# steamcmd +login anonymous +force_install_dir /home/ark/server +app_update 376030 +quit
Now, you can see that your app has been successfully installed.
Creating a systemd Unit for ARK Server
When the system is restarted or rebooted, we will create a systemd unit file to automatically start the ARK server. For this purpose, we will log in again from our root account or we can simply switch user to root by using the following command:
Command to switch user to root:
# su -
Now to create a new systemd file, execute the following command:
# nano /lib/systemd/system/ark.service
Type the following lines in opened file in nano editor. Use Ctrl + X, type 'Y' and press Enter key to save the file.
[Unit]
Description=ARK Survival Evolved
[Service]
Type=simple
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3
User=ark
Group=ark
ExecStartPre=/home/ark/steamcmd +login anonymous +force_install_dir /home/ark/server +app_update 376030 +quit
ExecStart=/home/ark/server/ShooterGame/Binaries/Linux/ShooterGameServer TheIsland?listen?SessionName=example -server -log
ExecStop=killall -TERM srcds_linux
[Install]
WantedBy=multi-user.target
Execute the following command to apply your updated changes.
# systemctl daemon-reload
Execute the following commands to enable systemd unit and run/start your ARK server.
# systemctl enable ark.service
# systemctl start ark
Configuring ARK Server
Now, after the successful execution of the commands above, you will need to configure your server by editing settings in GameUserSettings.ini file. You can set up the password for the users and admin in this file. You can also leave the user's password blank when you want your users to connect with your server without any password. The admin password is required while issuing game commands. To do this, you can follow the commands below:
Open the GameUserSettings.ini file.
# nano /home/ark/server/ShooterGame/Saved/Config/LinuxServer/GameUserSettings.ini
2. Now, add the following lines given below in opened nano editor and use Ctrl + X, type 'Y' and press Enter to save the settings.
Setting Up Firewalls for ARK Server
You can protect your ARK server from unauthorized access by setting up firewalls. To do this, follow the following instructions.
If you have activated firewalls, you will have to define a rule in Alibaba Cloud security group for your cloud server to add an exception for port 27015, 7777, 7778, and 27020. By default, these ports are blocked by the firewalls.
Connecting to Your ARK Survival Server
After successfully completing all the previous steps, you should be able to connect to your ARK server. To do this, you just need to perform three steps.
- Open your ARK Survival client and click Join ARK.
- Use the Server Name Filter and select your server.
- Enter the password and click Accept.
Conclusion
If you follow all the steps correctly, you should have a fully functional and dedicated ARK gaming server. If you are interested to know how to host a Minecraft server on Alibaba Cloud, you should definitely check out my Minecraft tutorial!
I will be writing more tutorials on gaming in the near future. If you are interested in writing, feel free to check out the Tech Share program. Be sure to stay up to date with the official Alibaba Cloud Blog!
Published at DZone with permission of Arslan ud Din Shafiq, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments