Hosting a Dedicated Server

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.

## Networking:

In order for others to join the server, several ports must be forwarded on your router.

### Port Range Forwarding:

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.

## Setup:

### Windows:

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"

```

### Mac OS X:

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 translate it into a line of text)
11. Press space
12. 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)
13. Then press enter

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.

## Configuration:

### Commands.dat:

The **Commands.dat** file is used to set the general server settings that will run whenever the server starts. It can be opened with any text editor. A separate line should be used for each unique command inputted.

## 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/