How to: Host your own Rust Dedicated Server
Decided to run a Rust Dedicated Server? The installation and set-up for the Rust Dedicated Server is very easy and straightforward. This guide is for the installation of a server on a Windows Server
System Requirements
The Rust server can be taxing on your host but maybe not as much as you would think. As a baseline a 3 square km (default gen size) map freshly generated will run at close to 2 gigabytes of ram. After some stress testing and 150k entities later, can use 6+ gigabytes of memory. So I would suggest having at least 7 gigs allocated per server.
Installing the Rust Dedicated Server
Run the following commands, one at a time, at the Steam> prompt, to start downloading the server to your computer.
force_install_dir "c:\rustserver\"
login anonymous
app_update 258550
quit
These are all of the necessary files required for a “Vanilla” server. Modified servers require a little more work.
Changing to a different branch
If you want to download the staging branch of Rust that receives the most recent updates, modify the app_update command as follows:
app_update 258550 -beta staging
If you want to download the prerelease branch of Rust that receives the future/work-in-progress updates, modify the app_update command as follows:
app_update 258550 -beta prerelease
Configuring and running the server
To get a server instance up and running you need to make at least one batch script file. To start, create a file named RustServer.bat in your server install directory (c:\rustserver) then right click and edit the file.
The Batch Script File
A batch script is a text document that stores a list of commands to be run in sequence. The main use of a batch script for hosting a server is to enable the server owner to make sure their server is up to date and if the server crashes that it will resume. The easiest way to do this is by using the GOTO statement. GOTO will allow you to jump around in your batch script to any other part of the batch file.
It’s important to note that Rust sometimes hangs instead of completely closing. In this case the server will not restart if the process hangs because the process did not actually stop. Batch scripting waits for a command to complete (in this case the RustDedicated.exe) but if that process never completes the batch script will just sit there.
For the most part, you will have to configure all of your server settings in this batch script. The config files for the server don't quite work yet so explicitly defining all of your settings in the batch script is the best way to go. Below is an example.:
1.) echo off
2:) :start
3:) C:\steamcmd\steamcmd.exe +login anonymous +force_install_dir c:\rustserver\ +app_update 258550 +quit
4:) RustDedicated.exe -batchmode +server.port 28015 +server.level "Procedural Map" +server.seed 1234 +server.worldsize 4000 +server.maxplayers 10 +server.hostname "Name of Server as Shown on the Client Server List" +server.description "Description shown on server connection window." +server.url "http://yourwebsite.com" +server.headerimage "http://yourwebsite.com/serverimage.jpg" +server.identity "server1" +rcon.port 28016 +rcon.password letmein +rcon.web 1
5:) goto start
Note: Do not use this example without making changes. Line numbers are shown for reference only and MUST be removed.
Here is an explanation of each line in the batch file.
echo off
This suppresses the console window’s desire to display each command in the batch file as they are executed.
:start
The is a label for a loop starting point.
C:\steamcmd\steamcmd.exe +login anonymous +force_install_dir c:\rustserver\ +app_update 258550 +quit
Executes SteamCMD to check for server updates and apply if needed.
RustDedicated.exe -batchmode +server.port 28015 +server.level "Procedural Map" +server.seed 1234 +server.worldsize 4000 +server.maxplayers 10 +server.hostname "Name of Server as Shown on the Client Server List" +server.description "Description shown on server connection window." +server.url "http://yourwebsite.com" +server.headerimage "http://yourwebsite.com/serverimage.jpg" +server.identity "server1" +rcon.port 28016 +rcon.password letmein +rcon.web 1
-batchmode
Opens Unity in non-GUI mode, and eliminates the need for any human intervention.
+server.port 28015
Rust client connection port.
+server.level "Procedural Map"
The map type to use. Options are "Procedural Map","Barren",”HapisIsland”,”SavasIsland” and “SavasIsland_koth”
+server.seed 1234
Determines shape of procedural and barren maps (used with server.worldsize). Values range from 0 to 2147483647.
+server.worldsize 4000
Determines shape of procedural and barren maps (used with server.seed). Values range from 1000 to 6000.
+server.maxplayers 10
Number of players that can be connected
+server.hostname "Name of Server as Shown on the Client Server List"
Name of the server as shown on the client’s server list
+server.description "Description shown on server connection window."
Description shown on the client’s server connection window
+server.url "http://yourwebsite.com"
A valid website. Causes the “View Webpage” button to appear on the connection window
+server.headerimage "http://yourwebsite.com/serverimage.jpg"
A valid link for the connection window background image. Use a JPG image of 512 x 256.
+server.identity "server1"
The directory name used as the parent for all the server files. Do not use spaces or special characters.
+rcon.port 28016
Rcon client connection port.
+rcon.password letmein
The password required for Rcon access. Do not use spaces or special characters.
+rcon.web 1
Uses websocket connection mode for rcon (recommended)
goto start
Instructs the batch file to jump to the ‘start’ label. Remove this line if you do not want your server to automatically restart after it shuts down.
Connecting to your server
Run the Rust Client, and do not select a server. Note that your server will not show up under the “Local Network” tab. Instead, press F1 and go to the client console. Assuming you used the default port of 28015, type in the following command to connect to your server:
client.connect localhost:28015
If you used a different port, change it accordingly.
Owners and Moderators
Once the server is up and running you may choose to assign ownership to yourself. This is done with the ownerid command. You will need your 17 digit SteamID number. The easiest way to get it, is to log in and then run the users command at the console. Then enter the command as follows:
ownerid 12345678901234567 AdminName
For example:
ownerid 12345678901234567 "Admin Name"
You can do the same for moderators using the moderatorid command
moderatorid 12345678901234567 "Admin Name"
Note: As with most commands that allow the use of player names, if the name has spaces or special characters in it, you must use quotes to contain the name.
Be sure to use the writecfg command after doing this and then the person must logout and log back in to receive the permissions. The two permissions are almost identical. Owners can create, kick and ban moderators if needed, but moderators cannot affect owners.
Sharing Your Server with the World
If you wish others to be able to connect to your server from the outside world, you will need to setup a port forward using the port you used listed above. I recommend using this Steam Server Guide if you are unfamiliar with setting up port forwarding. You will need to forward your “server.port” as well as “rcon.port” if used. By default these are 28015 and 28016.
Even if your server does not show up on the server list, players may be able to connect to you via the client.connect command if they know your public IP. Local firewall programs can also affect the ability to connect from the outside world. If you suspect this, turn off the firewall briefly.
List of known RCon/Console commands:
Note: UID stands for User ID - this refers to someone’s SteamID64 key.
Note 2: Do not execute the commands in red. They either won’t do anything, aren’t complete, or will break something on your server.
Note 3: If you send a command that can have parameters, but you do not specify any parameters, the command may still work but will substitute that missing parameter with a default value.
Note 4: Wow more notes. Remember that these commands can be entered using the server’s console window or RCon (when that comes around).
Note 5: Lol, I don’t think this ends. Also know that parameters with quotes require quotes and ones with braces can just be the number/boolean/whatever itself.
Note 6: Some commands don’t work completely or aren’t fully implemented.
kick <UID> “Player name” “Reason”
kickall <Invalid parameter, just put “”> “Reason”
ban “Player name” “Reason”
banid <UID> “Player name” “Reason”
say ”Message” ; Sends a message in chat.
users ; Show user info for players on server.
banlist ; List of banned users.
banlistex ; List of banned users - shows reasons and usernames.
listid ; List of banned users, by UID.
event.run ; Sends an airdrop from a random direction to drop crates at (0,0,0).
server.port <Number (Default 28015)> ; Sets the connection port of the server.
server.maxplayers <Number (Default 500)> ; Sets the maximum amount of players that can join.
server.hostname “Server name” ; Sets the server name.
server.identity “Identity” ; Sets the server’s identity; this is used for the folder name of the server data.
server.level “Map name” ; Sets the server’s map.
server.seed <Number (Default 123456)> ; Sets the server’s map generation seed.
server.saveinterval <Number (Default 60)> ; Sets the server’s the auto-save interval.
server.secure <true/false (Default true)> ; If true, EAC will kick banned or unregistered users upon joining.
server.tickrate <Number (Default 30)> ; Uhh… sets the tick rate?
server.start ; Uhh… starts your server? Wait, isn’t it already running?
server.stop “Reason” ; Stops yours server with a specified reason.
server.writecfg ; Creates a server.cfg in your server’s \<identity>\cfg\ folder… but know that these cfgs don’t actually load.
inventory.give “Item name” <Amount> ; Gives yourself an item. Only works on RCon?
gc.collect ; Recollects unused memory and unloads unused assets.
construct.frameminutes ; How many minutes before a placed frame gets destroyed.
chat.enabled <true/false (Default true)> ; Enables/disables chat.
chat.serverlog <true/false (Default true)> ; If true, chat will be logged to the console.
effects.aa <true/false (Default true)> ; Sets anti-aliasing.
effects.ao <true/false (Default true)> ; Sets ambient occlusion.
effects.lensdirt <true/false (Default true)> ; Sets lens dirt.
effects.motionblur <true/false (Default true)> ; Sets motion blur.
effects.shafts <true/false (Default true)> ; Sets light shafts.
effects.vignet <true/false (Default true)> ; Sets vignet (??).
effects.color <true/false (Default true)> ; Sets visibility of color (??).
effects.reflect <true/false (Default true)> ; Sets water reflection (??).
fps.graph <true/false (Default true)> ; Displays the fps graph on screen.
terrain.quality <Number (Default 1)> ; Sets the terrain quality.
objects ; Lists all objects in the world.
wakeup ; Forces your avatar to wakeup.
textures ; Lists all loaded textures.
spectate ; Kills your avatar and goes into spectator mode.
sleep ; Forces your avatar to go to sleep.
quit ; Writes the cfg file, and stops the server/game.
colliders ; Displays how many colliders exist in the world separated by enabled and disabled ones.
kill ; Commits suicide.