Deployment Overview of Rust Server on Server¶
Prerequisites and Basic Requirements¶
To ensure the successful deployment and operation of the Rust Dedicated Server, the following system requirements must be met:
-
Operating System: Ubuntu (64-bit)
-
Privileges: Root or sudo access is required for package installation and service configuration.
-
Dependencies: The
libc6-i386library must be installed to support SteamCMD functionality. -
Network Ports: The following ports must be open in the firewall:
| Port | Service | Description |
|---|---|---|
28015 | Game Client | Main game traffic |
28016 | RCON | Remote console access |
28017 | Query | Server query/status information |
File and Directory Structure¶
The application uses a dedicated user for security isolation. The following directory structure is established on the host:
-
/home/rust/: Home directory for the service user. -
/home/rust/steamcmd/: Contains the SteamCMD installation files. -
/home/rust/rust/: The main working directory for the Rust Dedicated Server. -
/home/rust/.rust/: Secure storage for sensitive information (e.g., RCON passwords).
Application Installation Process¶
The application is installed using a combination of system package management and SteamCMD. The installation process follows these steps:
-
System Preparation: The
libc6-i386package is installed via the package manager to provide necessary 32-bit compatibility. -
User Creation: A dedicated system user named
rustand a corresponding group are created to run the server processes with minimal privileges. -
SteamCMD Installation:
-
The SteamCMD archive is downloaded from official Steam servers.
-
The archive is extracted into
/home/rust/steamcmd. -
The
steamcmd.shscript is made executable. -
Rust Server Deployment:
-
SteamCMD is used to download and validate the Rust Dedicated Server files (App ID:
258550) into the server directory. -
Service Configuration: A systemd service unit is configured to manage the application lifecycle, ensuring it starts automatically on boot and restarts upon failure.
Access Rights and Security¶
-
User Isolation: The server runs under a non-privileged user
rust. -
Sensitive Data Protection: An RCON password is generated and stored in
/home/rust/.rust/rcon_passwordwith restricted permissions (0600), accessible only by therustuser. -
Directory Permissions: Server files are owned by the
rustuser, and sensitive directories are set to0700.
Databases¶
This specific deployment does not utilize an external database server; all game state and configuration data are managed within the application's local file structure in /home/rust/rust/.
Custom Scripts and Additional Setup¶
The installation includes a custom startup script used to initialize the environment:
-
Location:
/home/rust/rust/runds.sh -
Purpose: This script configures the runtime environment by setting the
LD_LIBRARY_PATHto include necessary plugin directories and executes theRustDedicatedbinary with specific parameters, including: -
Server identity and hostname.
-
Map settings (Procedural Map, Seed, World Size).
-
Player limits and networking ports.
-
RCON configuration for remote management.
Application Update Instructions¶
To update the Rust Dedicated Server to the latest version, you must use SteamCMD via the following command:
/home/rust/steamcmd/steamcmd.sh +force_install_dir /home/rust/rust +login anonymous +app_update 258550 validate +quit
After the update is complete, restart the service to apply changes:
Location of Configuration Files and Data¶
-
Server Logs:
/home/rust/rust/rustserver.log -
RCON Password:
/home/rust/.rust/rcon_password -
Startup Script:
/home/rust/rust/runds.sh -
Systemd Service Unit:
/etc/systemd/system/rust.service
Available Ports for Connection¶
| Port | Protocol | Usage |
|---|---|---|
28015 | UDP/TCP | Game Traffic |
28016 | TCP | RCON Management |
28017 | UDP | Query Port |
Starting and Stopping the Application¶
The application is managed via systemctl. Use the following commands to control the server:
-
Start the server:
sudo systemctl start rust -
Stop the server:
sudo systemctl stop rust -
Restart the server:
sudo systemctl restart rust -
Check status:
sudo systemctl status rust