U3-Docs

Server Hosting

All multiplayer servers are hosted using the Unturned Dedicated Server tool, which is installed and updated through Valve’s SteamCMD tool.

Multiplatform:

Windows:

Linux:

How to Install SteamCMD on Windows

  1. Download From Here
  2. Extract the contents of the zip somewhere you can find it again.
  3. Run steamcmd.exe

Continue to: How to Install Server using SteamCMD

How to Install SteamCMD on Linux

Installation on Linux varies by distribution and your admin preferences, so refer to Valve’s Linux Documentation. Once downloaded, run the steamcmd.sh script.

Continue to: How to Install Server using SteamCMD

How to Install Server using SteamCMD

  1. Login to Steam anonymously:

     login anonymous
    
  2. Download the server:

     app_update 1110390
    

    Note: this command can also be used to update the server.

  3. Close SteamCMD:

     quit
    
  4. The server files are now in the …SteamCMD\steamapps\common\U3DS directory.

Continue to: How to Launch Server on Windows or How to Launch Server on Linux

How to Launch Server on Windows

  1. Navigate to the ...\SteamCMD\steamapps\common\U3DS directory.
  2. Create a new text file by right-clicking an empty space within the U3DS directory, and selecting New > Text Document. This will create a new text file called “New Text Document.txt”.
    1. If the file name does not display the .txt file extension, then you need to enable the viewing of “File name extensions”.
    2. At the top of the File Explorer window, navigate to the View tab on the ribbon.
    3. In the Show/hide section of options, ensure that the “File name extensions” box is checked. File name extensions
    4. File extensions should now be displayed at the end of file names.
  3. Rename the “New Text Document.txt” file, and change it from a text file (.txt) to a batch script file (.bat). For example, “Tutorial.bat”.
  4. Right-click on the batch script (Tutorial.bat) and select Edit. This will open the batch file in your default text editor, although any text editor (e.g., Notepad, WordPad, Notepad++) can be used.
  5. Add the script that will start your server when the batch script is ran.
    • For an internet server, copy-and-paste the following text into the file: start "" "%~dp0ServerHelper.bat" +InternetServer/MyServer
    • For a LAN server, copy-and-paste the following text into the file: start "" "%~dp0ServerHelper.bat" +LanServer/MyServer

    Note: running an internet server will require opening ports on your router (this is called “port forwarding”).

    In this example “MyServer” is used as the ServerID for savedata and configuration purposes; you may choose to replace “MyServer” with a different name. For an example batch script, open the built-in ExampleServer.bat file in a text editor._

  6. Save your changes to the file, and close the file.
  7. Double-click the batch script to launch the server. A command-line interface should appear. Because this is the first time we have ran the batch file, it is going to generate a bunch of necessary server files. U3DS command-line interface

  8. When the command-line interface stops outputting new lines of text, it has finished loading (and finished generating all necessary files). You can safely close the server by executing (typing, and then pressing the “↵ Enter” key on your keyboard) the following command on the command-line interface: shutdown

  9. The batch script has created a new file directory located in …\U3DS\Servers, called “MyServer”. This directory is where all the savedata and configuration files are kept. Changing the MyServer ServerID (from step 5) in the batch script to a different name will allow for keeping savedata separate across multiple servers, and for running multiple servers at once.

  10. (optional) For your server to be visible on the in-game internet server list you will need to set a Login Token and configure Port Forwarding.

How to Launch Server on Linux

  1. Navigate to the .../SteamCMD/steamapps/common\U3DS directory.
  2. To create our server, we need to execute a command.
    • For an internet server run the following command: ./ServerHelper.sh +InternetServer/MyServer
    • For a LAN server run the following command: ./ServerHelper.sh +LanServer/MyServer

    Note: running an internet server will require opening ports on your router (this is called “port forwarding”).

    In this example “MyServer” is used as the ServerID for savedata and configuration purposes; you may choose to replace “MyServer” with a different name. For an example batch script, open the built-in ExampleServer.bat file in a text editor._

  3. You can safely close the server by executing (typing, and then pressing the “↵ Enter” key on your keyboard) the following command on the command-line interface: shutdown

  4. The executed command has created a new file directory located in …/U3DS/Servers, called “MyServer”. This directory is where all the savedata and configuration files are kept. Changing the MyServer ServerID (from step 2) in the batch script to a different name will allow for keeping savedata separate across multiple servers, and for running multiple servers at once.

  5. (optional) For your server to be visible on the in-game internet server list you will need to set a Login Token and configure Port Forwarding.

How to Configure Server

Each individual ServerID has its own savedata and configuration.

  1. Determine the ServerID. This is the name after the +InternetServer/ or +LanServer/ command.
  2. Navigate to U3DS > Servers > ServerID.

Launch commands are setup in the Server > Commands.dat file. Each line should have one command.

Common useful commands are:

Game rules, listing display, and many other options are available in the Config.json file. Game options mirror the in-game Play > Singleplayer > Config menu. This file deserves further documentation, but is not officially documented yet.

Steam Workshop add-ons (e.g., maps, items, vehicles) are setup in the WorkshopDownloadConfig.json file. To include a Workshop file on your server:

  1. Browse to its web page, for example: Hawaii
  2. Copy the file ID from the end of the URL.

     URL: https://steamcommunity.com/sharedfiles/filedetails/?id=1753134636
     ID: 1753134636
    
  3. Insert the file ID into the File_IDs list:

     "File_IDs":
     [
         1753134636
     ],
    

    Multiple file IDs should be separated by commas:

     "File_IDs":
     [
         1753134636,
         1702240229
     ],
    
  4. During startup the files will be updated, and any dependencies detected. Players will have the files downloaded while connecting to the server.

How to Host Curated Maps

Curated maps are available as workshop items, so are configured in the WorkshopDownloadConfig.json file. During startup the Map command searches installed workshop items for a matching name.

Alphabetically sorted list of curated map file IDs:

How to Host Over Internet

Hosting a publicly-accessible internet server requires an extra step compared to a LAN server. When on a home network Port Forwarding is required in order to direct traffic to the host computer.

One way to think of it is that when there are multiple devices (e.g. computers and phones) connected to the LAN, the outside internet does not know which device is the Unturned server. In this case port forwarding specifies which LAN device is the host.

For port ranges and other details: Port Forwarding

Listing your server on the in-game internet server list requires a Login Token to be set.