Skip to main content

How to Create Your Own Rust Server

This guide explains how to install and configure a dedicated Rust server on your VPS or dedicated Linux server, with the option of adding plugins thanks to Oxide (uMod).

Order a Server​

To host your Rust server, HostMyServers offers several gaming-oriented options. Rust is very demanding: favor a fast processor and plenty of RAM (8 GB minimum, more for a public server).

Prerequisites​

Resources

The resources listed below correspond to the server's requirements and do not take into account the resources already used by the operating system, installed software or other services present on the machine. Allow 200 Mbps for 100 players at tickrate 30 (community estimate). The required configuration is based on a vanilla server (without extensions or plugins).

  • SSH access as root or user with sudo privileges
  • 64-bit Linux system (Debian 12/13 or Ubuntu 22.04/24.04 recommended)
  • Active firewall: nftables (recommended), iptables or ufw (use only one firewall tool at a time)
  • Minimum 8 GB of RAM (32 GB recommended)
  • About 20 GB of free disk space (NVMe SSD recommended)
  • Ports 28015 UDP, 28017 UDP and 28082 TCP accessible, and port 28016 TCP (RCON) accessible from your fixed IP address only

Required Configuration​

ComponentMinimumRecommended
RAM8 GB32 GB and more
CPU2 cores4 cores or more, high frequency
Storage20 GB SSD40 GB NVMe SSD
Network300 Mbps1 Gbps
Performance

Rust's engine mainly depends on single-core performance: a high-frequency processor is more important than a large number of cores.

System Update​

sudo apt update && sudo apt upgrade -y

Installing Dependencies​

Install the required packages:

sudo apt install -y wget tar unzip screen lib32gcc-s1

Creating a Dedicated User​

For security reasons, create a dedicated user:

sudo adduser --disabled-password --gecos "" rust

Ports Used​

PortProtocolUsage
28015UDPGame
28017UDPQueries (server list)
28016TCPRCON (remote administration), restrict to your IP addresses
28082TCPRust+ (mobile app)

Firewall Configuration​

Open the required ports. The RCON port (28016 TCP) must be restricted to your fixed IP address: replace YOUR_IP.

With UFW​

sudo ufw allow 28015/udp
sudo ufw allow 28017/udp
sudo ufw allow from YOUR_IP to any port 28016 proto tcp
sudo ufw allow 28082/tcp
sudo ufw reload

With iptables​

sudo iptables -A INPUT -p udp --dport 28015 -j ACCEPT
sudo iptables -A INPUT -p udp --dport 28017 -j ACCEPT
sudo iptables -A INPUT -p tcp -s YOUR_IP --dport 28016 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 28082 -j ACCEPT
sudo iptables-save | sudo tee /etc/iptables/rules.v4

Saving the rules across reboots requires the iptables-persistent package.

With nftables​

These commands use the inet filter table and the input chain, present by default in /etc/nftables.conf on Debian.

sudo nft add rule inet filter input udp dport 28015 accept
sudo nft add rule inet filter input udp dport 28017 accept
sudo nft add rule inet filter input ip saddr YOUR_IP tcp dport 28016 accept
sudo nft add rule inet filter input tcp dport 28082 accept
(echo "flush ruleset"; sudo nft list ruleset) | sudo tee /etc/nftables.conf
RCON security

The RCON port (28016) allows administering the server: never open it to everyone. Without a fixed IP address, do not open this port and use an SSH tunnel instead.

Installing SteamCMD​

Log in as the rust user:

sudo -u rust bash
cd ~

Create the directories and download SteamCMD:

mkdir -p ~/steamcmd ~/rust-server
cd ~/steamcmd
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xzf steamcmd_linux.tar.gz

Downloading the Rust Server​

Start the server installation (application ID 258550):

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

If the installation stops with an error, simply run the same command again: SteamCMD resumes where it left off.

When it finishes, the message Success! App '258550' fully installed. is displayed.

Launch Script​

The launch script depends on the map type. Choose one of the two versions below.

Generated Map (default)​

Create the launch script:

nano ~/rust-server/start.sh
#!/bin/bash
cd /home/rust/rust-server
export LD_LIBRARY_PATH="/home/rust/rust-server/RustDedicated_Data/Plugins/x86_64:$LD_LIBRARY_PATH"

exec ./RustDedicated -batchmode \
+server.ip 0.0.0.0 \
+server.port 28015 \
+server.queryport 28017 \
+server.identity "server1" \
+server.level "Procedural Map" \
+server.seed 12345 \
+server.worldsize 3500 \
+server.maxplayers 100 \
+server.hostname "My Rust Server" \
+server.description "Welcome to my Rust server" \
+server.saveinterval 300 \
+rcon.port 28016 \
+rcon.password "ChangeMe" \
+rcon.web 1 \
+app.port 28082

Custom Map​

To use a custom map hosted online, replace the map generation parameters with +server.levelurl:

nano ~/rust-server/start.sh
#!/bin/bash
cd /home/rust/rust-server
export LD_LIBRARY_PATH="/home/rust/rust-server/RustDedicated_Data/Plugins/x86_64:$LD_LIBRARY_PATH"

exec ./RustDedicated -batchmode \
+server.ip 0.0.0.0 \
+server.port 28015 \
+server.queryport 28017 \
+server.identity "server1" \
+server.levelurl "https://your_domain.com/my_map.map" \
+server.maxplayers 100 \
+server.hostname "My Rust Server" \
+server.description "Welcome to my Rust server" \
+server.saveinterval 300 \
+rcon.port 28016 \
+rcon.password "ChangeMe" \
+rcon.web 1 \
+app.port 28082

Making the Script Executable​

Whichever version you chose, make the script executable:

chmod +x ~/rust-server/start.sh
Security

Choose a long and unique rcon.password. Anyone who knows it can administer your server.

Main Parameters​

ParameterDescription
server.identityName of the server's save folder (inside server/)
server.levelMap type (Procedural Map for a generated map)
server.seedMap generation seed
server.worldsizeMap size (from 1000 to 6000)
server.levelurlDownload address of a custom map (if set, server.worldsize and server.seed must be removed)
server.maxplayersMaximum number of players
server.hostnamePublic name of the server
server.descriptionDescription displayed in the server list
server.saveintervalAutomatic save interval (seconds)
rcon.portRCON port
rcon.passwordRCON password
rcon.web1 = WebSocket RCON (used by administration tools)
app.portRust+ port
First startup

On first startup, map generation takes several minutes. The server is ready when the logs display Server startup complete.

First Launch​

~/rust-server/start.sh

To stop the server, use Ctrl+C or the quit command from RCON.

Installing Oxide (uMod)​

Oxide lets you add plugins to your server. Stop the server, then:

cd ~/rust-server
wget https://github.com/OxideMod/Oxide.Rust/releases/latest/download/Oxide.Rust-linux.zip
unzip -o Oxide.Rust-linux.zip

At the next startup, the oxide/ folder is created. Plugins go in oxide/plugins/.

Updates

Every Rust update overwrites Oxide's files. After each server update, reinstall Oxide with the unzip -o command above.

Server Size Configuration​

Server sizePlayersMap sizeRecommended RAM
Small1-502500-30008 GB
Medium50-100350012-16 GB
Large100-2004000 and more16-32 GB

These values are indicative: actual consumption increases with the number of plugins and the length of the wipe.

File Structure​

PathDescription
RustDedicatedServer executable
server/server1/Server data (map, saves, configuration)
server/server1/cfg/server.cfgServer configuration
oxide/plugins/Oxide plugins
oxide/config/Plugin configuration
oxide/data/Plugin data
oxide/logs/Oxide logs

Adding Custom Emojis​

Create the serveremoji folder in the server folder (the name server1 matches server.identity):

mkdir -p /home/rust/rust-server/server/server1/serveremoji

Then drop your images into it.

Image Requirements​

  • The image must not exceed 256x256 pixels.
  • .jpg or .png format only (8-bit or 16-bit PNGs do not work).
  • The image size must be under 250 KB.
  • The file name becomes the emoji name: poop.png is used with :poop:.

Emojis can be refreshed with the following command, to be run via RCON:

server.resetserveremoji

Players must reconnect to see the new emojis.

Content

Facepunch may remove from the server list the servers that use offensive or inappropriate emojis.

Configuration as systemd Service​

Create Service File​

Exit the rust user's session (exit) to return to your administrator account, then create the service file:

sudo nano /etc/systemd/system/rust.service

File content:

[Unit]
Description=Rust Dedicated Server
After=network.target

[Service]
Type=simple
User=rust
Group=rust
WorkingDirectory=/home/rust/rust-server
ExecStart=/home/rust/rust-server/start.sh
Restart=on-failure
RestartSec=20
LimitNOFILE=100000

[Install]
WantedBy=multi-user.target

Enable and Start Service​

sudo systemctl daemon-reload
sudo systemctl enable rust.service
sudo systemctl start rust.service

Management Commands​

# Check status
sudo systemctl status rust.service

# Stop server
sudo systemctl stop rust.service

# Restart server
sudo systemctl restart rust.service

# View logs
sudo journalctl -u rust.service -f
Tip

Before stopping or restarting the server, send the server.save command via RCON to make sure player progress is saved.

Launching with screen (alternative)​

Only one launch mode

If the systemd service is started, stop it first (sudo systemctl stop rust.service): two servers cannot use the same ports.

sudo -u rust bash
screen -S rust
~/rust-server/start.sh

To detach: Ctrl+A then D

To reattach: screen -r rust

Running in the Background with a Log​

sudo -u rust bash
cd ~/rust-server
screen -AdmSL rust ./start.sh
OptionDescription
-AAdapts the window to the terminal size
-d -mStarts the session detached, in the background
-S rustSession name
-LSaves the server output to a log file

The screenlog.0 file is created in the folder where the command is run (~/rust-server) and contains all the server-side output. To follow it live:

tail -f ~/rust-server/screenlog.0

If an error occurs at startup, this is the first file to check. To return to the server console: screen -r rust

Tip

The screenlog.0 file grows with every launch. Remember to purge or delete it regularly.

Server Update​

Stop Server​

sudo systemctl stop rust.service

Download the New Version​

sudo -u rust bash
cd ~/steamcmd
./steamcmd.sh +force_install_dir /home/rust/rust-server +login anonymous +app_update 258550 validate +quit

Update / Reinstall Oxide​

If you use Oxide, reinstall it (still as the rust user), then exit the session:

cd ~/rust-server
wget -O Oxide.Rust-linux.zip https://github.com/OxideMod/Oxide.Rust/releases/latest/download/Oxide.Rust-linux.zip
unzip -o Oxide.Rust-linux.zip
exit

Without Oxide, simply type exit to leave the rust user's session.

Restart Server​

sudo systemctl start rust.service

Server Wipe​

A wipe resets the map to zero. Stop the server, then delete the map files as the rust user:

sudo systemctl stop rust.service
sudo -u rust bash
cd ~/rust-server/server/server1
rm -f *.*.map *.*.sav*

For a full wipe including player blueprints, also delete:

rm -f clans.*.db
rm -f player.blueprints*.db
rm -f player.deaths*.db
rm -f player.identities*.db
rm -f player.states*.db
rm -f player.tokens*
rm -f relationship*
rm -f sv.files*

Then exit the rust user's session:

exit
FileContentEffect of deletion
clans.*.dbClans (members, roles)Clans disappear
player.blueprints*.dbBlueprints learned by playersBlueprints reset
player.deaths*.dbDeath historyHistory erased
player.identities*.dbPlayer identity (name, character appearance)Players start over with a new character
player.states*.dbPersistent player stateProgression reset
player.tokens*Data specific to each player (map markers, timers)Data reset
relationship*Relationships between playersRelationships erased
sv.files*Files stored by the server (sign images, paintings)Sign images and paintings deleted

Then edit +server.seed in start.sh (or the +server.levelurl address for a custom map) to generate a new map, then restart the server.

Forced wipe

Facepunch enforces a map wipe on the first Thursday of every month, with the game update.

Console Commands​

These commands are used via RCON (administration tool or in-game console).

CommandDescription
statusShows connected players
server.saveSave the world
say <message>Send a message to all players
kick <player>Kick a player
ban <player>Ban a player
unban <steamid>Unban a player
ownerid <steamid> "name" "reason"Grant owner rights
moderatorid <steamid> "name" "reason"Grant moderator rights
server.writecfgSave the configuration and permissions
oxide.pluginsList loaded plugins
oxide.reload <plugin>Reload a plugin
quitStop the server

Automatic Backup​

Backup Script​

sudo nano /home/rust/backup.sh
#!/bin/bash
BACKUP_DIR="/home/rust/backups"
SERVER_DIR="/home/rust/rust-server"
DATE=$(date +%Y-%m-%d_%H-%M-%S)

mkdir -p $BACKUP_DIR

# Back up server and Oxide data
# (remove the oxide/... folders if you do not use Oxide)
tar -czf $BACKUP_DIR/rust_$DATE.tar.gz -C $SERVER_DIR server/server1 oxide/data oxide/config oxide/plugins

# Delete backups older than 7 days
find $BACKUP_DIR -name "rust_*.tar.gz" -mtime +7 -delete

echo "Backup completed: rust_$DATE.tar.gz"
sudo chown rust:rust /home/rust/backup.sh
sudo chmod +x /home/rust/backup.sh

Schedule Backup​

sudo crontab -u rust -e

Add:

# Backup every 6 hours
0 */6 * * * /home/rust/backup.sh

Connecting to Server​

Players can connect via:

  1. Launch Rust
  2. Open the console with the F1 key
  3. Type: client.connect SERVER_IP:28015

You can also add the server to your Steam favorites (View menu, Servers, Favorites tab).

Troubleshooting​

Server won't start​

  • Check the logs: sudo journalctl -u rust.service -n 100
  • Check that the script is executable: ls -l ~/rust-server/start.sh
  • Check the available disk space: df -h
  • Check the available memory: free -h

steamclient.so Error​

If the logs report an error about steamclient.so, log in as the rust user, then create the link to SteamCMD's 64-bit file:

sudo -u rust bash
mkdir -p ~/.steam/sdk64
ln -sf ~/steamcmd/linux64/steamclient.so ~/.steam/sdk64/steamclient.so
exit

Players can't connect​

  • Check that port 28015 is open on UDP:

    sudo ufw status
    sudo iptables -L INPUT -n --line-numbers | grep 28015
    sudo nft list ruleset | grep 28015
  • Check that the server is listening: ss -ulnp | grep 28015

  • Wait for startup to finish (Server startup complete in the logs)

Server doesn't appear in the list​

  • Check that port 28017 UDP is open
  • Wait a few minutes after startup
  • Check that the server has Internet access

Oxide doesn't load plugins​

  • Reinstall Oxide after every Rust update
  • Check the Oxide version with the oxide.version command
  • Check the logs in oxide/logs/

Performance Issues​

  • Reduce server.worldsize and server.maxplayers
  • Disable the most resource-hungry plugins
  • Increase your instance's RAM
  • Schedule one or two daily restarts
  • As a last resort, upgrade to the next plan

FAQ​

Which ports need to be opened?​

In addition to the server ports (see the "Ports Used" table), these ports are required by Steam. They allow the server to receive replies from Steam servers when your firewall blocks incoming traffic by default:

UFW:

sudo ufw allow proto udp from any port 27000:27030 to any port 1025:65535
sudo ufw allow proto udp from any port 4380 to any port 1025:65535
sudo ufw reload

iptables:

sudo iptables -A INPUT -p udp -m udp --sport 27000:27030 --dport 1025:65535 -j ACCEPT
sudo iptables -A INPUT -p udp -m udp --sport 4380 --dport 1025:65535 -j ACCEPT
sudo iptables-save | sudo tee /etc/iptables/rules.v4

nftables:

sudo nft add rule inet filter input udp sport 27000-27030 udp dport 1025-65535 accept
sudo nft add rule inet filter input udp sport 4380 udp dport 1025-65535 accept
(echo "flush ruleset"; sudo nft list ruleset) | sudo tee /etc/nftables.conf

I get "Permission denied" when running ./steamcmd.sh​

Apply a chmod:

chmod +x /home/rust/steamcmd/linux32/steamcmd && chmod +x /home/rust/steamcmd/steamcmd.sh

I get the message "WARNING: setlocale('en_US.UTF-8') failed, using locale: 'C'"​

This is not a real problem: only some international characters may display incorrectly. To fix it:

sudo locale-gen en_US.UTF-8
sudo update-locale LANG=en_US.UTF-8

If the locale-gen command is not found, first install the locales package with sudo apt install -y locales.