Skip to content

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 apt package management).

  • Privileges: Root access (sudo) is required to install system packages, create system users, and configure systemd services.

  • Required System Package: The libc6-i386 library must be installed to support 32-bit compatibility layers required by the game server.

  • User and Group: A dedicated system user named rust and a corresponding group named rust are 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 RustDedicated binary, data files, and the startup script runds.sh.

  • Subdirectory RustDedicated_Data holds 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.log located 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).

  1. The steamcmd client is downloaded from https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz.

  2. The archive is extracted to /home/rust/steamcmd.

  3. The server files are installed into /home/rust/rust using the command:

    steamcmd.sh +force_install_dir /home/rust/rust +login anonymous +app_update 258550 validate +quit
    

  4. A custom startup script named runds.sh is deployed to the server directory to configure launch arguments.

  5. A systemd service unit file is created at /etc/systemd/system/rust.service to 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 rust user within the rust group.

  • RCON Security: A unique RCON password is generated and stored in /home/rust/.rust/rcon_password with file permissions set to 0600 (readable only by the owner).

  • RCON Binding: The RCON interface is bound to 0.0.0.0 on port 28016, 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 to 0755.

  • The secrets directory (/home/rust/.rust) is set to 0700.

  • 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/rust and /home/rust/steamcmd are owned by rust:rust.

  • System Service: The rust.service file is owned by root:root with permissions 0644.

  • 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:

    sudo systemctl start rust
    

  • Stop the service:

    sudo systemctl stop rust
    

  • Restart the service:

    sudo systemctl restart rust
    

  • Check status:

    sudo systemctl status rust
    

  • Enable auto-start on boot:

    sudo systemctl enable rust
    

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.

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×