FANDOM


A Dedicated Server is a method of hosting an Unturned server that does not require the host to be an active player in the game. The host can choose to play on the server, or just leave it running in the background while others play on it. Unlike a Local Server, port forwarding is required.

A Dedicated Server also allows for vastly increased versatility in configuration of the server. Many server options become available through the Commands.dat, Config.json, server console, and other configuration files.

Windows Setup:

Unturned 3 Command Line Setup

How to Host a Dedicated server on Unturned Version 3

How to Host a Dedicated server on Unturned Version 3.0 Above

  1. Right-click the "Unturned.exe", hover the mouse over "Send To", and click on "Desktop (create shortcut)".
  2. Right-click on the shortcut and select "Properties". The "Target:" field should contain the path to Unturned.exe and should look something like this:
    "C:\Program Files (x86)\Steam\steamapps\common\Unturned\Unturned.exe"
  3. Now, at the end of the string of text, insert this string of text:
     -nographics -batchmode +secureserver/... 
... is whatever you want to name your server.

An example of a finished "Target" field:

"C:\Program Files (x86)\Steam\steamapps\common\Unturned\Unturned.exe" -nographics -batchmode +secureserver/My server 
4. Finally, run the server. A black console screen should appear, with no text.
5. Optional: You can easily update an existing Unturned server by using the following method:

The following text string will create a shortcut that will automatically update your server. This example assumes that you installed your server through SteamCMD, which does not update Unturned automatically.

"C:\SteamCMD\steamcmd.exe" +login Username Password +app_update 304930 +exit

Unturned 3 Setup (Unturned Server Organiser):

Unturned Server Organiser (USO) is a third-party software for the Windows operating system that helps to automate the creating and managing an Unturned server. Unique features include a graphical user interface, the ability to automatically install RocketMod, and UPnP support.

If your router does not support UPnP, then you will have to port forward manually. Additionally, while you are not limited in how you can configure your server, multiple options are locked behind a premium membership.

Classic Setup:

Unturned - how to create a dedicated server! (and how to join it)

Unturned - how to create a dedicated server! (and how to join it)

  1. From the Steam window, right-click the Unturned game in your Library and select "Properties".
  2. Click in the "Local Files" tab.
  3. Click "Browse Local Files...".
  4. In the explorer window, right-click the "Unturned.exe", hover the mouse over "Send To", and click on "Desktop (create shortcut)".
  5. Right-click on the newly created shortcut and select "Properties". The "Target:" field should contain the path to Unturned.exe and should look something like this:
    "C:\Program Files (x86)\Steam\steamapps\common\Unturned\Unturned.exe"
  6. In order for the server to run, you need to add add options to the end of the field. For example, if you wanted the server to be PvE, you would add the -pve option to the end of the field. A complete list of options is found at the bottom of the page.
  7. An example of a finished "Target" field:
    "C:\Program Files (x86)\Steam\steamapps\common\Unturned\Unturned.exe" -port:25444 -players:20 -nographics -pei -gold -nosync -pve -sv

To finish, simply apply changes to the shortcut and double-click it to run it. The game should run and then immediately go to a gray screen. This screen means the server is running fine. If your screen doesn't go gray and the server does not work, make sure you put the -sv option at the end of your options, otherwise the server may not work.

Mac OS X Setup:

  1. From the Steam window, right-click the Unturned game in your Library and select "Properties".
  2. Click in the "Local Files" tab.
  3. Click "Browse Local Files...".
  4. Optional: Go back to Common, duplicate the Unturned folder, paste it in Common and name it Unturned Server)
  5. In the Finder window right click on Unturned
  6. Select Show Package Contents
  7. Select Contents
  8. Select MacOS
  9. Open up terminal
  10. Then drag the Unturned executable into the terminal window (this will paste the path of the application)
  11. Press space, then add in your parameters (this is the same as step 3 of Windows 3.0.0 setup, except that the program will be referred to as Unturned.app instead of Unturned.exe)
  12. Then press enter to execute the command.

With Unturned 3.0, the procedure is exactly the same, but after the parameters, you need to add: +secureserver/servername

Replace "secureserver" with "lanserver" if you want a LAN server instead. Replace "servername" with what you want to name your server.

Now, if you want to double-click to start the server, in TextEdit (Located in Applications), paste the same command you just ran (hopefully testing it first), then save it as "StartServer.command". Make sure it doesn't add .txt or .rtf to it.

Linux Setup:

New Guide

Install Unturned.

Go to the install folder and right click and press open in terminal.

press the following

./Unturned.XX -nographics -pei -normal -nosync -pve -players:16 -sv

Replace XX with the name of the architecture (x86 if you have a 32 bit computer, x86_64 if 64 bit)

example:

./Unturned.x86_64 -nographics -pei -normal -nosync -pve -players:16 -sv

Headless Guide

Note: This is mainly for computers without a GUI (graphical user interface), or if you only have access to the terminal/command line. If you use a VPS with only SSH/PuTTY access, go right ahead! If you are using a GUI, the above option might be better for you, however you might have some slight memory benefits using this method.

Install your OS of choice, whether it be Ubuntu Server/Debian or Fedora Server/RedHat. After that, update your OS and your repositories. You know you are in the shell when you see a $ or an # at the end of the line.

To update in Fedora, use

sudo dnf update

while on Ubuntu, use

sudo apt-get update && sudo apt-get upgrade && sudo dpkg --add-architecture i386

The "Add Architecture" is only needed once; to update your system, only the other two is required afterwards.

If on Fedora, you do not have access to dnf, try using yum instead.

Now for installing the libraries. On Fedora, run

sudo dnf install glibc-devel.i686 mono-devel gcc libgcc libstdc++.i686 libgcc.i686 ncurses-libs.i686 zlib-devel.i686 libXcursor.i686 libXrandr.i686 screen

Hint: Adding -y to the command (sudo dnf -y ...) will automatically say yes to every prompt. Use it here to avoid having to type yes to every statement.

If you have an Nvidia GPU, also use

sudo dnf install xorg-x11-drv-nvidia-libs.i686

If you only have an Intel Graphic Chipset, or you don't know what graphics you have, use

sudo dnf install mesa-libGL.i686 mesa-dri-drivers.i686

For Ubuntu, type each individual line, then hit return. You should have typed in four statements.

sudo apt-get install screen htop unzip wget
sudo apt-get install build-essential gcc-multilib libstdc++6:i386 libgcc1:i386 libncurses5:i386 rpm zlib1g:i386
sudo apt-get install libmono2.0-cil mono-runtime
sudo apt-get install libc6:i386 libgl1-mesa-glx:i386 libXrandr2:i386 libXcursor1:i386

Well, you got through most of the hard part. At this time, you will need a steam account. To avoid conflict, create a new dummy Steam account with Unturned added to its library.

There are a lot of things to say here, but I recommend creating a new user similar to the instructions in the old guide. Look at the "Running the Server" part, and ONLY do the first step (two commands).

Most of these steps are going to be the same for Ubuntu/Fedora/Debian/RedHat, unless said.

First, let's create some folders and download SteamCMD.

mkdir ~/unturnedserver && cd ~/unturnedserver
mkdir steamcmd && mkdir unturned && cd steamcmd
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar xvf steamcmd_linux.tar.gz && rm -rf steamcmd_linux.tar.gz

We need the RocketLauncher to start the server, so we will download it.

chmod +x steamcmd.sh && cd ..
wget https://ci.rocketmod.net/job/Rocket.Unturned/lastSuccessfulBuild/artifact/Rocket.Unturned/bin/Release/Rocket.zip
unzip Rocket.zip && rm -rf Rocket.zip
mv Scripts/Linux/RocketLauncher.exe unturned/
mv Scripts/Linux/*.sh .

If you want RocketMod on your server as well:

mv Modules/Rocket.Unturned/ unturned/Modules/ # DO NOT USE FOR VANILLA

You may now remove any excess files, other than start.sh, update.sh, unturned/, steamcmd/, or Steam/.

Now, using an editor of choice (Vi or Nano), open update.sh.

nano update.sh

Here is where your Steam account that you created earlier is used. Put the username and password in there. If you want to keep your password private, keep the password string blank.

Now you're done!

./update.sh # For updating server and downloading files
./start.sh # For running the server

Old Guide(Outdated)

Note: Unfortunately, Patch 2.2.2 broke the dedicated server for Linux. Output before crash is:

fixme:d3d:resource_check_usage Unhandled usage flags 0x8.
fixme:ver:GetCurrentPackageId (0x32f1b8 (nil)): stub
fixme:win:UnregisterDeviceNotification (handle=0xcafeaffe), STUB!

The WINE compatibility layer can be used to run an Unturned dedicated server on Linux-based operating systems such as Ubuntu. The following is the procedure for Ubuntu 14.04 and can be adapted to any similar OS. You will need to startx in its own shell, using tmux or screen or equivalent, so that you can also run Unturned.exe.

File installation

A short-term testing method is to use WinSCP or a similar SFTP software to transfer the entire Unturned folder over to the Linux server. The folder is likely located in C:\Program Files (x86)\Steam\SteamApps\common\. The problem with this option is that you must update the server files with WinSCP every time an update is released.

A better option is to use SteamCMD, which is a light-weight Linux Steam client that downloads and updates the required Unturned files.

  1. Download steamcmd to the server
    wget http://media.steampowered.com/installer/steamcmd.zip
  2. Unzip it:
    unzip steamcmd.zip
  3. Start SteamCMD:
    wine steamcmd.exe
  4. Login to a Steam account:
    login username password
  5. Define an installation directory:
    force_install_dir Z:/home/your/unix/folder
  6. Download the game to the dedicated server. "app_update 304930" also updates the files of the force_install_dir you pointed at.
    app_update 304930

Running the server

  1. Starting from root, add a user:
    adduser unt
    adduser unt sudo
  2. Log in using the new user:
    su unt
  3. Install wine and xinit:
    sudo apt-get install wine xinit
  4. Configure X to allow Anybody to start it:
    sudo dpkg-reconfigure x11-common
  5. Start X (headless style):
    tmux
    startx
  6. Move to a different shell in tmux:
    [CTRL]+[B], [C]
  7. Tell WINE to use the headless X session:
    export DISPLAY=:0.0
  8. Start the Unturned server:
    wine Unturned.exe -nographics -pei -normal -nosync -pve -players:16 -sv

Configuring your Server:

Setup Commands

Note: You may have to open the .dat files in a text editor.

Type shutdown in the console. Go back to the Steam 'Unturned folder'. Now click on Servers, then you should see a folder, with the name of your server. Click on that folder. Click on the sub-folder Server. There should be 5 .dat documents, labeled Adminlist, Blacklist, Commands, and Whitelist.

Use the Commands file if you want to run list of commands that will run each time the server starts. Use a separate line for each command.

The Setup Commands are as follows:

  • Bind - Binds your internal IP to the socket. (Internal IP is the network adapter IP of the adapter you use)
  • Chatrate - Assigns the minimum amount of time between chat messages in order to prevent spam.
  • Cycle - Assigns the day/night cycle in seconds.
  • Decay - Assigns the amount of time a player, or their group members, can be offline before their structures can be removed by anyone. Default is 604800. (7 days)
  • Filter - Enables the old name filter.
  • Loadout - Assigns what all players spawn with. The first number value in the loadout is the Skillset ID. (Example: Loadout 255/15/15/81/81/18/20/20/121 - Gives all skillsets 2 Medkits, 2 MREs, a Timberwolf, 2 Timberwolf Magazines, and a Military Knife.)
  • Log - Enables/Disables [chat]/[join&leave]/[death]/[anticheat] messages. (Y = Yes, N = No) (i.e. Log Y/Y/Y/Y)
  • Map - Sets the map that will be used for the server. If you want to use a workshop map, the workshop map folder must be placed in the Workshop folder of the server, otherwise it will fail to load the map.
  • MaxPlayers - Sets the max amount of players the server will allow.
  • Mode - Sets the difficulty mode. (Easy, Normal, Hard)
  • Name - Sets the server's name. (i.e. Nelson's Server)
  • Owner - Sets the server's owner, which gives them administrator commands and fully sets up the server. (Requires your Steam 64 ID.)
  • Password - Sets a password to the server to keep out unwanted guests, making the server more private.
  • Perspective - Assigns the perspective views. (First, Third, Vehicle, Both.) First allows only first-person, third allows only third-person, Vehicle allows third-person only when the player is in a vehicle, and both allows changing between first and third-person views freely.
  • Port - Sets the server's port. The default server port is 27015. (Whatever you set the server port to must be port forwarded on your router or nobody will be able to connect.)
  • PvE - Sets the server to only allow Players VS Environment combat.
  • Sync - Syncs player data between servers using the same key.
  • Timeout - Sets the max Ping for players before they time out. (400~600 is recommended)
  • Welcome - Sets the welcome message. (i.e. Welcome Welcome to Nelson's Server!)

Command Line Options

These parameters are used in launching the server from a command line interface. The order of inputted commands do not matter.

  • Map:
    • -arena
    • -pei
  • Gamemode:
    • -bambi
    • -normal
    • -hardcore
    • -gold
  • Sync Setting:
    • -sync
    • -nosync
  • PVP/PVE Setting:
    • -pvp
    • -pve
  • Misc:
    • -pass:[PASSWORD]
    • -port:[PORT NUMBER]
    • -players:[PLAYER MAX]
    • -nographics (This command is needed to not see the welcome screen. Instead you see a black screen with no GUI.)
    • -sv (needs to be at the end of the parameters)
    • -batchmode (prevents the game from launching a GUI, and makes it run as a background process. Greatly reduces CPU usage)

Connecting:

You should now be able to connect to your own server by running the game through Steam. To do this, click "Play", and then "Connect", and in the IP field, type "localhost", then click "Connect" to join your own server.

If you fail to connect to your own server, try installing SteamVR (found under tools in Steam).

Note: Other players will not use "localhost", only you will. Other players will use your EXTERNAL IP to connect to your server. Find your external IP by visiting http://www.whatismyip.com/

Firewall

If you have correctly set up your server and can't even connect to it, you might want to check if your firewall is blocking the port. On Windows, it shouldn't be that hard; open Control Panel, Security, and click "Allow a Program". Here, you can choose the Unturned application, and voila!

For MacOS, open System Preferences. Go to Security and Privacy, Firewall, then unlock the settings via the padlock at the bottom left of the window. Next, go to Firewall Options, scroll down the list, click on Unturned, and on the right of it, make sure it says "Allow incoming connections". If not, click on it, and choose that option. Close the window, making sure to apply settings, padlock the settings, and you're done!

For Fedora/RedHat:

sudo firewall-cmd --zone=public --add-port=27015-27017/tcp --permanent
sudo firewall-cmd --zone=public --add-port=27015-27017/tcp --permanent

For Ubuntu/Debian:

sudo ufw enable
sudo ufw allow 27015:27017/tcp
sudo ufw allow 27015:27017/udp

For both, if you selected a different port via the start command or Commands.dat, change the first number to the port you selected, and the second port two ports ahead (ex. 27040-27042).

Port Forwarding:

NOTE: Port Forwarding has to be done carefully. Nobody will be able to connect to your server if you do this incorrectly.

In order for anyone to access the server you've set up, you need to go into your router's settings and open the server's set ports.

Follow the steps below:

  1. Open any internet browser, and type your default gateway into the address bar, then hit enter.
  2. Find a section for Port Forwarding.
  3. Click the option that allows you to add a new port, or rule.
  4. The default port range is 27015 to 27017, with 27015 being the connecting port.
  5. You must enter an IP Address, or Destination Address, using either a Dynamic IP or Static IP.
  6. The preferred protocol is UDP.

If you are unable to locate these things, try checking https://portforward.com/router.htm to see specific instructions for your router.

Alternatively, you can put your hosting system into the DMZ. This opens all ports and is an option if for some reason normal port-forwarding fails. Putting your system into the DMZ opens up numerous security vulnerabilities and should only be used as a last resort!

  1. Follow the steps above until you reach your router page (from the default gateway)
  2. Find a section for DMZ (Demilitarized Zone)
  3. Input your computer's internal IP Address

Optional Server Improvements

No-ip Add a host
  • (Free) Turn your IP address into a DNS:
    • Utilizing a website such as http://www.noip.com/ will allow you to create an easy-to-remember text-based IP address, such as "myserver.zapto.net". Players will use this name to connect to your server instead of the numbered alternative, such as "74.12.127.76".
      1. Register for a new account (free)
      2. Aftering signing in, select "Add a Host"
      3. Most of the fields are already done for you. You only need to give the host a name in the "Hostname" field, such as "unturned", "myserver", etc. You also have the option of choosing the domain name from the drop-down menu immediately to the right of the hostname. In the example to the right, my hostname will become "unturned.ddns.net".
      4. Once you click "Add Host", your IP address now matches the Hostname. Players can now use your hostname to connect to your server instead of your numbered IP address.
      5. Optional but recommended: Download the No-IP client in the sidebar menu on the left (download link here ). The client will run in your taskbar and automatically update your hostname to match your IP address if it changes in the future. If you skip this step, you will need to change your IP address manually with "Manage Hosts" on the noip.com website.
  • (Free) IP to DNS via Duckdns (extra option for DNS):
    • The steps are listed on https://duckdns.org and are similar to steps for no-ip. It's just another option that exists to achieve the same goal. They have a clear FAQ and Install guide for people new to it.