Skip to content

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

  • Privileges: Root access or sudo privileges are required to install system packages, create users, and manage systemd services.

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

  1. The steamcmd_linux.tar.gz archive 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 downloaded and installed into /home/rust/rust by executing SteamCMD with the application ID 258550.

  4. 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 rust user and rust group.

  • The rust user has a home directory at /home/rust.

  • The RCON password is stored in /home/rust/.rust/rcon_password with strict permissions (0600) to prevent unauthorized access.

  • The .rust directory itself is set to 0700 permissions.

  • The main server directory (/home/rust/rust) and SteamCMD directory (/home/rust/steamcmd) are set to 0755 permissions.

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:

    sudo systemctl start rust
    

  • Stop the service:

    sudo systemctl stop rust
    

  • Restart the service:

    sudo systemctl restart rust
    

  • Check service status:

    sudo systemctl status rust
    

  • Enable auto-start on boot:

    sudo systemctl enable rust
    

The service is configured to restart automatically if it fails (Restart=always) with a 10-second delay (RestartSec=10).

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