Deployment Overview of Rust Server on Server¶
Prerequisites and Basic Requirements¶
The deployment requires a Linux-based operating system, specifically Ubuntu, running on a server with full root privileges. The following components and network configurations are required for the server to operate:
-
Operating System: Ubuntu (verified compatibility via
aptpackage management). -
Privileges: Root access (
sudo) is required to install system packages, create system users, and configuresystemdservices. -
Required System Package: The
libc6-i386library must be installed to support 32-bit compatibility layers required by the game server. -
User and Group: A dedicated system user named
rustand a corresponding group namedrustare created and used for all server operations. -
Network Ports: The following ports must be open and accessible for game connectivity, query, and remote administration:
-
Game Port:
28015 -
RCON Port:
28016 -
Query Port:
28017
File and Directory Structure¶
The Rust server files, configuration, and data are organized within the home directory of the rust user. The primary locations are:
-
Server Directory:
/home/rust/rust -
Contains the
RustDedicatedbinary, data files, and the startup scriptrunds.sh. -
Subdirectory
RustDedicated_Dataholds game assets and plugins. -
SteamCMD Directory:
/home/rust/steamcmd -
Contains the SteamCMD client (
steamcmd.sh) used for downloading and validating the server files. -
Secrets Directory:
/home/rust/.rust -
Stores sensitive configuration data, specifically the RCON password.
-
Log File:
rustserver.loglocated inside the server directory (/home/rust/rust/rustserver.log).
Application Installation Process¶
The application is installed by downloading the SteamCMD client, extracting it, and using it to download and validate the Rust Dedicated Server (App ID 258550).
-
The
steamcmdclient is downloaded fromhttps://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz. -
The archive is extracted to
/home/rust/steamcmd. -
The server files are installed into
/home/rust/rustusing the command: -
A custom startup script named
runds.shis deployed to the server directory to configure launch arguments. -
A
systemdservice unit file is created at/etc/systemd/system/rust.serviceto manage the application lifecycle.
Access Rights and Security¶
The server runs under the unprivileged rust user account to isolate the application from root access. Security measures include:
-
User Isolation: All server files and processes run as the
rustuser within therustgroup. -
RCON Security: A unique RCON password is generated and stored in
/home/rust/.rust/rcon_passwordwith file permissions set to0600(readable only by the owner). -
RCON Binding: The RCON interface is bound to
0.0.0.0on port28016, allowing remote administration from any IP address, provided the correct password is used. -
File Permissions:
-
The server directory (
/home/rust/rust) and SteamCMD directory (/home/rust/steamcmd) are set to0755. -
The secrets directory (
/home/rust/.rust) is set to0700. -
The startup script (
runds.sh) is executable (0755).
Permission Settings¶
Ownership and permissions are strictly enforced for all deployed components:
-
Directory Ownership: All files within
/home/rust/rustand/home/rust/steamcmdare owned byrust:rust. -
System Service: The
rust.servicefile is owned byroot:rootwith permissions0644. -
Secret Files: The RCON password file is restricted to the owner only to prevent unauthorized access to the remote administration credentials.
Location of Configuration Files and Data¶
Configuration is managed through command-line arguments defined in the startup script and stored files for dynamic secrets.
-
Startup Script:
/home/rust/rust/runds.sh -
Defines server identity, ports, map settings, and RCON credentials.
-
RCON Password:
/home/rust/.rust/rcon_password -
Contains the plaintext RCON password used by the startup script.
-
Service Definition:
/etc/systemd/system/rust.service -
Defines the system service parameters, including the working directory and execution user.
Starting, Stopping, and Updating¶
The Rust server is managed as a systemd service. Use the following commands to control the service:
-
Start the service:
-
Stop the service:
-
Restart the service:
-
Check status:
-
Enable auto-start on boot:
The service is configured to automatically restart if it crashes (Restart=always) with a 10-second delay between restart attempts.
Available Ports for Connection¶
The server listens on the following ports for different types of traffic. These ports must be allowed through any firewall configurations on the host.
| Port | Protocol | Purpose |
|---|---|---|
| 28015 | UDP/TCP | Game Server Connection |
| 28016 | TCP | RCON (Remote Console) |
| 28017 | UDP | Server Query |
The server configuration sets the maximum player count to 50 (maxplayers) and the map world size to 4500 units. The server identity is set to the hostname of the machine running the server.