How to Create Your Own Rust Server
Complete guide to create and configure a dedicated Rust server on a VPS or dedicated Linux server. Installation with SteamCMD, configuration, Oxide (uMod), wipe and systemd service.
On this page
Your values
Enter them once and the commands in this guide update.
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).
- Performance VPS - Dedicated resources and fast processors, ideal for Rust
- NVMe VPS - For a small server or a test server
- Eco Dedicated Servers - For servers with many players
- Performance Dedicated Servers - Maximum performance
Prerequisites
- 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
| Component | Minimum | Recommended |
|---|---|---|
| RAM | 8 GB | 32 GB and more |
| CPU | 2 cores | 4 cores or more, high frequency |
| Storage | 20 GB SSD | 40 GB NVMe SSD |
| Network | 300 Mbps | 1 Gbps |
System Update
sudo apt update && sudo apt upgrade -yInstalling Dependencies
Install the required packages:
sudo apt install -y wget tar unzip screen lib32gcc-s1Creating a Dedicated User
For security reasons, create a dedicated user:
sudo adduser --disabled-password --gecos "" rustPorts Used
| Port | Protocol | Usage |
|---|---|---|
| 28015 | UDP | Game |
| 28017 | UDP | Queries (server list) |
| 28016 | TCP | RCON (remote administration), restrict to your IP addresses |
| 28082 | TCP | Rust+ (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 reloadWith 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.v4Saving 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.confInstalling 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.gzDownloading 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 +quitWhen 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 28082Custom 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 28082Making the Script Executable
Whichever version you chose, make the script executable:
chmod +x ~/rust-server/start.shMain Parameters
| Parameter | Description |
|---|---|
server.identity |
Name of the server's save folder (inside server/) |
server.level |
Map type (Procedural Map for a generated map) |
server.seed |
Map generation seed |
server.worldsize |
Map size (from 1000 to 6000) |
server.levelurl |
Download address of a custom map (if set, server.worldsize and server.seed must be removed) |
server.maxplayers |
Maximum number of players |
server.hostname |
Public name of the server |
server.description |
Description displayed in the server list |
server.saveinterval |
Automatic save interval (seconds) |
rcon.port |
RCON port |
rcon.password |
RCON password |
rcon.web |
1 = WebSocket RCON (used by administration tools) |
app.port |
Rust+ port |
First Launch
~/rust-server/start.shTo 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.zipAt the next startup, the oxide/ folder is created. Plugins go in oxide/plugins/.
Server Size Configuration
Recommended Memory
| Server size | Players | Map size | Recommended RAM |
|---|---|---|---|
| Small | 1-50 | 2500-3000 | 8 GB |
| Medium | 50-100 | 3500 | 12-16 GB |
| Large | 100-200 | 4000 and more | 16-32 GB |
These values are indicative: actual consumption increases with the number of plugins and the length of the wipe.
File Structure
| Path | Description |
|---|---|
RustDedicated |
Server executable |
server/server1/ |
Server data (map, saves, configuration) |
server/server1/cfg/server.cfg |
Server 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/serveremojiThen 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.pngis used with:poop:.
Emojis can be refreshed with the following command, to be run via RCON:
server.resetserveremojiPlayers must reconnect to see the new 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.serviceFile 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.targetEnable and Start Service
sudo systemctl daemon-reload
sudo systemctl enable rust.service
sudo systemctl start rust.serviceManagement 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 -fLaunching with screen (alternative)
sudo -u rust bash
screen -S rust
~/rust-server/start.shTo 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| Option | Description |
|---|---|
-A |
Adapts the window to the terminal size |
-d -m |
Starts the session detached, in the background |
-S rust |
Session name |
-L |
Saves 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.0If an error occurs at startup, this is the first file to check. To return to the server console: screen -r rust
Server Update
Stop Server
sudo systemctl stop rust.serviceDownload the New Version
sudo -u rust bash
cd ~/steamcmd
./steamcmd.sh +force_install_dir /home/rust/rust-server +login anonymous +app_update 258550 validate +quitUpdate / 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
exitWithout Oxide, simply type exit to leave the rust user's session.
Restart Server
sudo systemctl start rust.serviceServer 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| File | Content | Effect of deletion |
|---|---|---|
clans.*.db |
Clans (members, roles) | Clans disappear |
player.blueprints*.db |
Blueprints learned by players | Blueprints reset |
player.deaths*.db |
Death history | History erased |
player.identities*.db |
Player identity (name, character appearance) | Players start over with a new character |
player.states*.db |
Persistent player state | Progression reset |
player.tokens* |
Data specific to each player (map markers, timers) | Data reset |
relationship* |
Relationships between players | Relationships 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.
Console Commands
These commands are used via RCON (administration tool or in-game console).
| Command | Description |
|---|---|
status |
Shows connected players |
server.save |
Save 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.writecfg |
Save the configuration and permissions |
oxide.plugins |
List loaded plugins |
oxide.reload <plugin> |
Reload a plugin |
quit |
Stop 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.shSchedule Backup
sudo crontab -u rust -eAdd:
# Backup every 6 hours
0 */6 * * * /home/rust/backup.shConnecting to Server
Players can connect via:
- Launch Rust
- Open the console with the
F1key - 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
exitPlayers can't connect
-
Check that port 28015 is open on UDP:
Terminalsudo 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 completein 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.versioncommand - Check the logs in
oxide/logs/
Performance Issues
- Reduce
server.worldsizeandserver.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 reloadiptables:
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.v4nftables:
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.confI get "Permission denied" when running ./steamcmd.sh
Apply a chmod:
chmod +x /home/rust/steamcmd/linux32/steamcmd && chmod +x /home/rust/steamcmd/steamcmd.shI 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-8If the locale-gen command is not found, first install the locales package with sudo apt install -y locales.