Deployment Overview of Rust Server on Server¶
Prerequisites and Basic Requirements¶
The following requirements must be met on the target server before deployment:
-
Operating System: Ubuntu (compatible with
aptpackage manager). -
Privileges: Root access or
sudoprivileges are required to install system packages, create users, and manage systemd services. -
User Account: A dedicated system user named
rustand grouprustare created to run the server processes. -
Network Ports: The following ports must be open on the firewall for server connectivity:
-
28015: Game traffic (UDP/TCP). -
28016: RCON (Remote Console) traffic. -
28017: Query traffic.
File and Directory Structure¶
The application 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, game data, and the startup scriptrunds.sh. -
SteamCMD Directory:
/home/rust/steamcmd -
Contains the SteamCMD client used for downloading and updating the server files.
-
Secrets Directory:
/home/rust/.rust -
Stores sensitive configuration data, specifically the RCON password in the file
rcon_password. -
Systemd Service:
/etc/systemd/system/rust.service -
Defines the service unit for managing the server lifecycle.
Application Installation Process¶
The Rust Dedicated Server is installed using the SteamCMD client. The process involves the following steps:
-
The
steamcmd_linux.tar.gzarchive 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 downloaded and installed into
/home/rust/rustby executing SteamCMD with the application ID258550. -
The installation validates the files to ensure integrity.
Access Rights and Security¶
Security and access control are enforced through user isolation and file permissions:
-
The server runs under the non-privileged
rustuser andrustgroup. -
The
rustuser has a home directory at/home/rust. -
The RCON password is stored in
/home/rust/.rust/rcon_passwordwith strict permissions (0600) to prevent unauthorized access. -
The
.rustdirectory itself is set to0700permissions. -
The main server directory (
/home/rust/rust) and SteamCMD directory (/home/rust/steamcmd) are set to0755permissions.
Docker Containers and Their Deployment¶
This deployment does not utilize Docker containers. The application runs as a native systemd service managed by the host operating system.
Proxy Servers¶
This configuration does not include a proxy server (such as Nginx or Traefik) or SSL termination. The server is accessed directly via the configured ports.
Permission Settings¶
File and directory permissions are configured as follows:
-
/home/rust/rust:0755(Owner:rust, Group:rust). -
/home/rust/steamcmd:0755(Owner:rust, Group:rust). -
/home/rust/.rust:0700(Owner:rust, Group:rust). -
/home/rust/.rust/rcon_password:0600(Owner:rust, Group:rust). -
/home/rust/rust/runds.sh:0755(Owner:rust, Group:rust). -
/etc/systemd/system/rust.service:0644(Owner:root, Group:root).
Location of Configuration Files and Data¶
Configuration is primarily handled through command-line arguments passed to the RustDedicated binary via the runds.sh script. Key locations include:
-
Startup Script:
/home/rust/rust/runds.sh -
Contains server identity, ports, map settings, and RCON credentials.
-
RCON Password:
/home/rust/.rust/rcon_password -
A 32-character alphanumeric string used for remote administration.
-
Log File:
/home/rust/rust/rustserver.log -
Stores server runtime logs.
Available Ports for Connection¶
The server listens on the following ports:
-
28015: Main game port.
-
28016: RCON port.
-
28017: Query port.
Starting, Stopping, and Updating¶
The Rust server is managed as a systemd service named rust. Use the following commands to control the service:
-
Start the service:
-
Stop the service:
-
Restart the service:
-
Check service status:
-
Enable auto-start on boot:
The service is configured to restart automatically if it fails (Restart=always) with a 10-second delay (RestartSec=10).