Skip to content

Commit 6d56307

Browse files
committed
Initial commit.
0 parents  commit 6d56307

File tree

6 files changed

+421
-0
lines changed

6 files changed

+421
-0
lines changed

.dtua/links.env

Whitespace-only changes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Update Topic On TMC Forum
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
update-discourse:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- uses: gamemann/[email protected]
16+
with:
17+
discourse_api_key: ${{ secrets.DISCOURSE_API_KEY }}
18+
discourse_api_user: ${{ secrets.DISCOURSE_API_USER }}
19+
discourse_topic_id: 0
20+
discourse_api_url: ${{ secrets.DISCOURSE_API_URL }}

README.md

Lines changed: 339 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,339 @@
1+
<div align="center">
2+
3+
![banner](./images/banner.png)
4+
5+
</div>
6+
7+
A guide on how to **download**, **install**, and **configure** a [Rust](https://rust.facepunch.com/) game server on **Windows** and **Linux**.
8+
9+
This guide is focused on setting up a **vanilla** server, but additional guides will be linked that go over how to **install mods and addons** like [uMod](https://umod.org/) (formerly Oxide).
10+
11+
## Table Of Contents
12+
* [Requirements](#requirements)
13+
* [Downloading Server Files](#downloading-server-files)
14+
* [Starting The Server](#starting-the-server)
15+
* [Startup Commands](#startup-commands)
16+
* [Windows](#windows)
17+
* [Creating Startup Script](#creating-startup-script)
18+
* [Linux](#linux)
19+
* [Creating Startup Script](#creating-startup-script-1)
20+
* [Using Screen](#using-screen)
21+
* [Additional Configuration](#additional-configuration)
22+
* [Conclusion](#conclusion)
23+
* [See Also](#see-also)
24+
* [How To Install uMod](#how-to-install-umod)
25+
* [Rust Autowipe Tool For Pterodactyl](#rust-autowipe-tool-for-pterodactyl)
26+
27+
## Requirements
28+
* A server or computer with at least **9 - 10 GBs** of free space.
29+
* A server or computer with at least **8 GBs** of RAM available (depends on world size, player count, etc.).
30+
* You can also use [this](https://pinehosting.com/tools/rust-ram-calculator) neat tool that estimates the amount of RAM you need based off of the server's map size, player count, and more!
31+
* A basic understanding of navigating folders and files along with knowing how to execute commands.
32+
* **Windows**: Using PowerShell and/or Command Prompt.
33+
* **Linux**: Using shell commands through a terminal.
34+
35+
While not *required*, it is **strongly recommended** you create a **separate user** on Windows or Linux to run the Rust server for better security.
36+
37+
## Downloading Server Files
38+
Firstly, you'll want to download the game server files using [SteamCMD](https://developer.valvesoftware.com/wiki/SteamCMD).
39+
40+
I've made a separate guide on how to download and use SteamCMD. Please give it a read below if you don't know how to use it. To note before reading the guide, the Rust server's app ID is `258550` for both Windows and Linux.
41+
42+
https://forum.moddingcommunity.com/t/how-to-download-run-steamcmd-2025/190
43+
44+
After you've downloaded the server, navigate to the folder or directory with the following executable file.
45+
46+
* **Windows**: `RustDedicated.exe`
47+
* **Linux**: `RustDedicated`
48+
49+
## Starting The Server
50+
By now, you should be in the folder with the Rust server's executable file. We're going to start off by executing the startup command in the system's shell and then create a script to start the sever automatically.
51+
52+
### Startup Commands
53+
Before continuing, I wanted to break down and explain the required startup commands. These are global across both Windows and Linux Rust servers.
54+
55+
| Command | Default | Description |
56+
| ------- | ------- | ----------- |
57+
| `server.ip` | `0.0.0.0` | The IP address to bind the server to. Use `0.0.0.0` to bind to all IPs and network interfaces (most common).
58+
| `server.port` | `28015` | The UDP port to bind the server to.
59+
| `server.tickrate` | `10` | The tickrate to run the server at. Increasing this value will consume more resources. Use `10` if you're not sure.
60+
| `server.hostname` | `` | The server's hostname to use when users are trying to find the server within the server browser (or via A2S queries).
61+
| `server.identity` | `` | The name of the folder created inside of the `servers/` folder. This folder contains additional configuration files, map saves, player storage, and more.
62+
| `server.worldsize` | `` | The size of the world when generating a new one. |
63+
| `server.seed` | `` | The seed to use when generating a new world. |
64+
| `server.maxplayers` | `` | The maximum amount of players allowed on the server at once. |
65+
| `rcon.ip` | `0.0.0.0` | The IP to bind the RCON listener to. Use `0.0.0.0` to bind to all IPs and network interfaces (most command). |
66+
| `rcon.port` | `28016` | The TCP port to bind the RCON listener to. |
67+
| `rcon.password` | *N/A* | The password required to use RCON (make sure it's secure and **at least** 8 characters in length!). |
68+
69+
Additionally, the `-batchmode` flag is required when running a server. The `-nographics` flag ensures there isn't a GUI launched (while I don't believe this flag is *needed* in most cases, most people still include this option).
70+
71+
**NOTE** - When compiling the main server's startup command later on, you will need to prepend `-` or `+` (most common) to each command.
72+
**NOTE** - When generating a new world using the seed and size commands above, I recommend using a website like [Rust Maps](https://rustmaps.com)!
73+
74+
#### RCON Information
75+
RCON is used to execute commands on the server **remotely**. You will need to ensure the client executing the RCON commands can access its IP and TCP port (you may need to port forward).
76+
77+
Make sure you only give the RCON password to users you trust!
78+
79+
### Windows
80+
To start a Rust server on Windows, you will need to execute the `RustDedicated.exe` executable file with the required startup commands.
81+
82+
Firstly, open up a terminal and change your folder to the Rust server folder where the `RustDedicated.exe` file is located. In file explorer, you can just right click in the main folder which will show you a menu. Click the **Terminal** button from here to open a terminal in that folder.
83+
84+
Here's the base of the startup command.
85+
86+
```batch
87+
.\RustDedicated.exe -batchmode -nographics
88+
```
89+
90+
Now we need to append the required startup commands above by inserting `+<command> <value>` for each command.
91+
92+
Here's an example!
93+
94+
```batch
95+
.\RustDedicated.exe -batchmode -nographics +server.ip "0.0.0.0" +server.port 28015 +server.tickrate 10 +server.hostname "My Rust Server!" +server.identity "server01" +server.seed 793197 +server.maxplayers 200 +server.worldsize 600 +rcon.ip 0.0.0.0 +rcon.port 28016 +rcon.password "test1234"
96+
```
97+
98+
Edit the startup command values to your liking and execute the command!
99+
100+
It will take some time depending on your server's specs, the map seed, the world size, and more.
101+
102+
You will see a message like the one below when the server is officially started!
103+
104+
```
105+
SteamServer Initialized
106+
Server startup complete
107+
SteamServer Connected
108+
```
109+
110+
#### Creating Startup Script
111+
To make it easier to launch the server, let's create a [Batch](https://www.tutorialspoint.com/batch_script/index.htm) that automatically starts the server.
112+
113+
1. Create a new file through the File Explorer using a text editor such as Notepad (built-in) or [VS Code](https://code.visualstudio.com/) and name the file `start.bat`.
114+
* Make sure the file is located in the same folder as the `RustDedicated.exe` file.
115+
* If you can't edit file extensions (`.bat`), take a look at [this](https://helpx.adobe.com/x-productkb/global/show-hidden-files-folders-extensions.html) guide!
116+
2. Paste the following contents into the file:
117+
```batch
118+
@echo off
119+
setlocal
120+
121+
set RESTART_DELAY=5
122+
123+
:restart
124+
cls
125+
126+
echo Starting Rust server...
127+
echo.
128+
129+
.\RustDedicated.exe -batchmode -nographics ^
130+
+server.ip "0.0.0.0" ^
131+
+server.port 28015 ^
132+
+server.tickrate 10 ^
133+
+server.hostname "My Rust Server!" ^
134+
+server.identity "server01" ^
135+
+server.level "Procedural Map" ^
136+
+server.seed 793197 ^
137+
+server.maxplayers 200 ^
138+
+server.worldsize 600 ^
139+
+rcon.ip 0.0.0.0 ^
140+
+rcon.port 28016 ^
141+
+rcon.password "test1234"
142+
143+
echo.
144+
echo Detected server stop or crash. Restarting in %RESTART_DELAY% seconds...
145+
146+
timeout /t %RESTART_DELAY% /nobreak > nul
147+
148+
goto restart
149+
```
150+
4. Modify startup command values and restart delay if necessary.
151+
5. Save the file and exit.
152+
153+
Now double click the Batch file to start the server. This script also automatically
154+
155+
### Linux
156+
Before continuing, ensure you're inside of the directory with the `RustDedicated` file and execute the following in your terminal.
157+
158+
```bash
159+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)
160+
```
161+
162+
The above is now required before running a Rust server on many Linux distros including Debian and Ubuntu. Otherwise, the server will most likely crash due to linker issues.
163+
164+
Now, let's get to starting the server!
165+
166+
To start a Rust server on Linux, you will need to execute the `RustDedicated` file with the required startup commands.
167+
168+
Here's the base of the startup command.
169+
170+
```bash
171+
./RustDedicated -batchmode -nographics
172+
```
173+
174+
Next, we need to append the required startup commands explained above by inserting `+<command> <value>` for each command.
175+
176+
Here's an example!
177+
178+
```bash
179+
./RustDedicated -batchmode -nographics +server.ip "0.0.0.0" +server.port 28015 +server.tickrate 10 +server.hostname "My Rust Server!" +server.identity "server01" +server.seed 793197 +server.maxplayers 200 +server.worldsize 600 +rcon.ip 0.0.0.0 +rcon.port 28016 +rcon.password "test1234"
180+
```
181+
182+
After modifying the command above, you can execute it. This will start up the Rust server.
183+
184+
It will take some time depending on your server's specs, the map seed, the world size, and more.
185+
186+
You will see a message like the one below when the server is officially started!
187+
188+
```
189+
SteamServer Initialized
190+
Server startup complete
191+
SteamServer Connected
192+
```
193+
194+
**NOTE** - You can also execute and set commands through the server's console. If you retrieve a response, it indicates the server is online. For example, try executing the `status` command after the server is up!
195+
196+
#### Creating Startup Script
197+
Having to copy and paste the command we've compiled above can become annoying and tedious.
198+
199+
To make things simpler, let's create a Bash script that starts up the Rust server.
200+
201+
1. Choose a text editor like `nano` or `vim` and create a new file called `start.sh`.
202+
* Make sure the file is located in the same directory as the `RustDedicated` executable.
203+
2. Paste and modify the following contents into the file:
204+
```bash
205+
#!/bin/bash
206+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)
207+
208+
RESTART_DELAY=5
209+
210+
clear
211+
212+
while :
213+
do
214+
echo "Starting Rust server..."
215+
echo
216+
217+
./RustDedicated -batchmode -nographics \
218+
+server.ip "0.0.0.0" \
219+
+server.port 28015 \
220+
+server.tickrate 10 \
221+
+server.hostname "My Rust Server!" \
222+
+server.identity "server01" \
223+
+server.level "Procedural Map" \
224+
+server.seed 793197 \
225+
+server.maxplayers 200 \
226+
+server.worldsize 600 \
227+
+rcon.ip 0.0.0.0 \
228+
+rcon.port 28016 \
229+
+rcon.password "test1234"
230+
231+
echo
232+
echo "Detected server stop or crash. Restarting in ${RESTART_DELAY} seconds..."
233+
234+
sleep $RESTART_DELAY
235+
done
236+
```
237+
4. Modify the startup command values and restart delay to your liking.
238+
5. Save the file.
239+
6. Make the file executable by the user using the following command:
240+
```bash
241+
chmod u+x start.sh
242+
```
243+
244+
The above script starts the Rust server and if the server crashes or is shut down, will attempt to automatically start the server again.
245+
246+
You should be able to execute it using the following command.
247+
248+
```bash
249+
./start.sh
250+
```
251+
252+
#### Using Screen
253+
Something Linux users will likely find annoying is that you can't execute commands in the same terminal you run the Rust server until you shut it fully down using `CTRL` + `C` for example.
254+
255+
To resolve this annoyance, I recommend installing and utilizing the [`screen`](https://www.geeksforgeeks.org/linux-unix/screen-command-in-linux-with-examples/) command which comes with most Linux distros via package managers.
256+
257+
```bash
258+
# For Debian/Ubuntu
259+
sudo apt install -y screen
260+
261+
# For CentOS/RHEL
262+
sudo yum install screen
263+
```
264+
265+
Next, prepend the following when executing the startup script.
266+
267+
```bash
268+
screen -S <name>
269+
```
270+
271+
For example:
272+
273+
```bash
274+
screen -S rustsrv01 ./start.sh
275+
```
276+
277+
When you execute the command with `screen`, you can then press `CTRL` + `D` to detach the current screen.
278+
279+
To reattach to the screen, you can use the following command.
280+
281+
```bash
282+
# Replace <name> with your session name above (e.g. rustsrv01).
283+
screen -r <name>
284+
```
285+
286+
You can also list sessions using the following command.
287+
288+
```bash
289+
screen -ls
290+
```
291+
292+
For more information on using `screen`, I recommend giving [this](https://www.geeksforgeeks.org/linux-unix/screen-command-in-linux-with-examples/) useful guide a read!
293+
294+
## Additional Configuration
295+
You can create a configuration file called `server.cfg` inside of your server identity's `cfg` folder where you can set [additional commands/ConVars](https://rust.fandom.com/wiki/Server_Commands).
296+
297+
The `cfg` folder is located at the following location starting from the root of your Rust server files.
298+
299+
```
300+
.\servers\<identity>\cfg
301+
```
302+
303+
For example, in this guide I've been using `server01` as the server's identity, so I'd create the file in the following folder.
304+
305+
```
306+
.\servers\server01\cfg
307+
```
308+
309+
Inside of this file, you can also *technically* set some of the startup command's values above, but most administrators recommend setting those specific commands through the command line from what I see. Like startup commands, you can also set additional commands and ConVars through the command line as well, but I think it's easier and cleaner to use the dedicated `server.cfg` file personally.
310+
311+
For example, if you want to set a URL for your server, you can do so in the `server.cfg` file like this:
312+
313+
```
314+
server.url "https://rust.mydomain.com"
315+
```
316+
317+
Now save and restart the server! You can check if the value has changed by executing `server.url` (or whichever command(s) you've set) which should print the new value.
318+
319+
## Conclusion
320+
By now, you should have a basic understanding on how to set up and configure a Rust server!
321+
322+
Running and managing Rust servers are fun to many users, but can also be very complicated at times, especially when installing and configuring mods and such.
323+
324+
## See Also
325+
* [Rust - Facepunch](https://rust.facepunch.com/)
326+
* [Rust - Steam](https://store.steampowered.com/app/252490/Rust/)
327+
* [RAM Calculator Tool](https://pinehosting.com/tools/rust-ram-calculator)
328+
* [Rust Maps](https://rustmaps.com/) - Used to generate world sizes and seeds for Rust servers.
329+
* [Pterodactyl](https://pterodactyl.io) - A popular panel for managing game servers and applications like Rust.
330+
331+
### How To Install [uMod](https://umod.org/)
332+
A guide I made on how to download, install, and configure [uMod](https://umod.org/) (Oxide).
333+
334+
https://forum.moddingcommunity.com/t/how-to-install-umod-oxide-onto-your-rust-game-server-2025/489
335+
336+
### [Rust Autowipe Tool For Pterodactyl](https://github.com/gamemann/Rust-Auto-Wipe)
337+
I also made a [tool](https://github.com/gamemann/Rust-Auto-Wipe) for [Pterodactyl](https://pterodactyl.io) that automatically wipes a Rust server based on cron jobs. It comes with many features!
338+
339+
This guide will be **worked** and **improved** on *over time*. If you have any suggestions or questions, please reach out!

images/banner.png

458 KB
Loading

scripts/start-server.bat

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@echo off
2+
setlocal
3+
4+
set RESTART_DELAY=5
5+
6+
:restart
7+
cls
8+
9+
echo Starting Rust server...
10+
echo.
11+
12+
.\RustDedicated.exe -batchmode -nographics ^
13+
+server.ip "0.0.0.0" ^
14+
+server.port 28015 ^
15+
+server.tickrate 10 ^
16+
+server.hostname "My Rust Server!" ^
17+
+server.identity "server01" ^
18+
+server.level "Procedural Map" ^
19+
+server.seed 793197 ^
20+
+server.maxplayers 200 ^
21+
+server.worldsize 600 ^
22+
+rcon.ip 0.0.0.0 ^
23+
+rcon.port 28016 ^
24+
+rcon.password "test1234"
25+
26+
echo.
27+
echo Detected server stop or crash. Restarting in %RESTART_DELAY% seconds...
28+
29+
timeout /t %RESTART_DELAY% /nobreak > nul
30+
31+
goto restart

0 commit comments

Comments
 (0)