Rust Wiki

Revision Difference

Creating-a-server#529021

<cat>Play.Hosting</cat> <title>Creating a server [Under Construction]</title> Creating a dedicated server is as easy as learning how to drive. With time spent comes understanding. The more research you do the more you will understand and easier this will be. # Requirements * Windows Machine * 8GB or more RAM * 10GB free space * 100 mb/s or more up and down internet speed You can get by with less memory if you run small maps and have fewer users. Note that you do NOT need a Steam account to have a Rust server running. If you want to PLAY on that server or give yourself admin/mod rights, you DO need a Steam account. # Step 1 - Create the directories you will need * Create a directory for the SteamCmd program such as C:\Rust\SteamCmd * Create a directory for the server to reside such as C:\Rust\MyServer # Step 2 - Downloading SteamCMD We need a tool steam provides us called "SteamCMD". This is used to download and update the server files. * Download [SteamCmd](https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip) and place in a temporary folder * Extract the files into the directory created # Step 3 - Update SteamCMD * Navigate to the SteamCMD directory and run the SteamCMD.exe file. * When executed, SteamCMD will set itself up for running, downloading additional files * It will finish updating by giving you a ">Steam" prompt. # Step 4 - Downloading Rust Server files Since downloading a Rust server does not require a steam account, we will log in anonymously, then tell SteamCMD where to put the files, then tell it to download the files. After that we can exit from SteamCMD. * To do that, while still in SteamCMD run the following commands: ```markdown Steam> login anonymous Steam> force_install_dir "C:\Rust\MyServer\" Steam> app_update 258550 Steam> quit ``` # Step 5 - Setting up a batch file to run your server Your server needs to know how you want the server to run. There are numerous switches and configuration settings you can tell your server at startup. An example command line to run your server would be: ```markdown 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 ``` That looks like a lot, but lets break down each item one by one: | Setting | Function | Notes | | --------------------- | ----------------------------------------------------------- | ----------------------------------------- | | -batchmode | Tells the server to run without a GUI || | +server.port 28015 | Sets the port people will use to connect to the game | 28015 is typical| | +server.level "Procedural Map"| Sets the type of map. There are other values for Barren or Hapis| For now keep Procedural.| | +server.seed 1234 | Sets the random seed for how the map is generated | Change this value to any number up to 8 digits long | | +server.worldsize 4000 | Sets the world size. | The larger the map, the more disk space and memory you need. Use 1000 to 6000| | +server.maxplayers 10 | Sets the max number of players connecting at one time | The more players, the faster your computer CPU needs to be| | +server.hostname "Tom Server" | Sets a server name| Name of server as shown on the client server list| | +server.description "Awesome!"| Sets a description for your server | Description shown on server connection window, for example you could show the size or intent of the server.| | +server.url "http://mysite.com"| If you have your own website, you can set it here. | You can also omit this. For this example we will leave a generic non-working name| | +server.headerimage "http://mysite.com/serverimage.jpg"| Sets the picture for the server | Not required| | +server.identity "server1" | This is the internal name of the server. | This example name will be used to create a "C:\Rust\MyServer\server1" directory for all of your server files.| | +rcon.port 28016 | Set the remote connect port. | Use this port to remote connect to the server for admin configuration/control.| | +rcon.password letmein | Sets the remote connect password for remote administration. | Change this value!!! | +rcon.web 1 | Sets the type of remote connect method. | rcon.web 1 is suggested.| Steps to create the batch file. * Change file explorer to show known file extensions * Navigate to "C:\Rust\MyServer\" * Right click and select "New | Text Document" * Change the name to "RunServer.BAT" and hit enter * Confirm file extension is fine * Right click on file name and select edit * Copy the example command line above and paste into notepad * Change the settings to what your server should be (seed, password, worldsize, maxplayers) * Save (TODO add notepad screenshots) * Run this batch file. After a few minutes the server will have created all of the files it needs to run. Congratulations! You have just created a whole new world! You are a GOD! (TODO add screenshot) # Step 6 - Additional and optional considerations in setup Beta versions Rust has beta branches available for your server if you are wanting to test new features not released to the public. To set up a server with one of these beta branches, you need to change your SteamCMD above to download the "beta prerelease" or "beta staging" branches of rust development. For example, you can choose ONE of these branches: ``` Steam> app_update 258550 beta staging Steam> app_update 258550 beta prerelease ``` Better batch file You may wish for your batch file to be more robust. An example of some things you may want to do would make your batch file look like this: ``` :start C:\Rust\SteamCMD\SteamCMD.exe +login anonymous +force_install_dir c:\Rust\Server\ +app_update 258550 +quit RustDedicated.exe -batchmode +server.port 28015 +...(and all of your other configuration as you chose before) C:\Rust\SteamCMD\SteamCMD.exe +login anonymous +force_install_dir C:\Rust\MyServer\ +app_update 258550 +quit RustDedicated.exe -batchmode +server.port 28015 +...(and all of your other configuration you chose before) goto start ``` * The ":start" line sets up a place for the "goto start" to jump to. * The SteamCMD line does all of the steps to update your server just as you did manually above. * The RustDedicated line is the line to start your server * The "goto start" line is run when the server is shut down via failure or command "restart" in the server. There are many other things you could put in this, such as logging the restart or starting other background services that you use for your server. All of this is optional. # Step 7 - Determine your local IP Your server will have been assigned an IP address by your router. Here we will determine what IP address that is. * Hold down the windows key and hit R * In the Run Box that pops up, type "CMD" and hit enter * In the Command Box that runs, type "ipconfig" and hit enter. Your screen will have a section that looks similar to this ``` Ethernet adapter Ethernet: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::1de5:48b8:737d:342a%8 IPv4 Address. . . . . . . . . . . : 192.168.1.2 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.1.1 ``` * Look for the line that starts with IPv4 Address and record this number This is the IP address for your Rust Server that you will use to connect to it. # Step 8 - Test local connection on your network You can run the server using the IP address set by your local router. In Step 7 above, we found the IP address to be 192.168.1.2 In step 5 above, we set the server port to be 28015 To test this, we are going to start a Rust client and check to see if we can connect locally. * Log in to Steam * Run Rust * Hit F1 to bring up the console * Type in "connect 192.168.1.2:28015" (or whatever your information is) You should be in and playing locally # Step 9 - Adding yourself as administrator Once you are playing locally, switch to the black command box that is the server and type "users". Don't confuse this command with a SteamCMD. This is to be done in the text window that is your server. You should receive back that 1 user is connected. It will give you data similar to the following but with your Steam information: ``` > users <slot:userid:"name"> 12345678901234567:"TomSmith" 1users ``` While still in the server command box, to set yourself up as admin or moderator respectively, type one the following: ``` > ownerid 12345678901234567 "TomSmith" Added owner TomSmith, steamid 12345678901234567 > moderatorid 12345678901234567 "TomSmith" Added moderator TomSmith, steamid 12345678901234567 ``` Note that the if you know how to copy/paste, the colon ":" in the output needs to be replaced with a space. Now write the config change with the following command: ``` writecfg ``` You are now able to do admin/moderator functions while playing rust with your client. # Step 10 - Setting up your router You want your server to always be the same local IP. To do this, you need to set up your router to always assign the same IP address to the computer running your server Refer to your router user manual for how to set up a static IP for your rust server computer. If you want people outside your network to be able to connect, you need to have your router forward traffic coming from the internet to the port on your computer. If you are just running on your local network, you don't need this step. Refer to your router user manual on how to port forward internet traffic to a specific computer and UDP port. #Links Additional server commands are needed for <page>Hosting Custom Maps</page>