Rust is a multiplayer survival game from Facepunch Studios, and its dedicated server (RustDedicated) runs natively on Linux. Hosting your own server lets you choose the map size, player limit, wipe schedule and plugins.

In this tutorial you will install the Rust dedicated server on Ubuntu 24.04 with SteamCMD, run it as a systemd service under its own user, open the required ports, make yourself an admin, add the Oxide plugin framework and learn how to update and wipe the server.

Prerequisites

To follow this tutorial, you will need:

  • A server running Ubuntu 24.04, for example a CubePath VPS. Rust is memory hungry: plan for at least 4 vCPUs and 12 GB of RAM for a 3000-4000 map with a few dozen players, and 16 GB or more for larger maps or busy servers.
  • At least 30 GB of free disk space (the server files take about 10 GB, plus saves and backups).
  • A non-root user with sudo privileges and UFW enabled.
  • A Steam account to play on the server and your SteamID64 (the 17-digit number starting with 7656), which you can find on your Steam profile page or with a lookup site such as steamid.io.

Step 1 - Installing SteamCMD

SteamCMD is Valve's command-line client for downloading dedicated servers. Ubuntu ships it in the multiverse repository, and it needs 32-bit libraries, so enable both:

sudo dpkg --add-architecture i386
sudo add-apt-repository -y multiverse
sudo apt update

Install SteamCMD:

sudo apt install -y steamcmd

During the installation you are asked to accept the Steam license. Use the arrow keys and Enter to accept it. The binary is installed as /usr/games/steamcmd.

Step 2 - Creating a dedicated user

Running a game server as root means any exploit in the server gives an attacker full control of the machine. Create an unprivileged user without a password, which you access from your admin account with sudo:

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

Switch to it and confirm:

sudo -iu rust
whoami
rust

Step 3 - Downloading the Rust dedicated server

As the rust user, download the server (Steam app ID 258550) into ~/server. The download is anonymous, so no Steam login is needed:

/usr/games/steamcmd +force_install_dir /home/rust/server +login anonymous +app_update 258550 validate +quit

The first run updates SteamCMD itself, then downloads roughly 10 GB. When it finishes you should see:

Success! App '258550' fully installed.

Check that the server binary is there:

ls -l ~/server/RustDedicated

Type exit to return to your admin user.

Step 4 - Opening the firewall ports

Rust uses these ports by default:

PortProtocolPurpose
28015UDPGame traffic
28017UDPSteam query (server browser)
28016TCPRCON (remote console), keep closed unless you need remote admin tools
28082TCPRust+ companion app (optional)

Open the game and query ports, plus the Rust+ port if you want players to use the companion app:

sudo ufw allow 28015/udp
sudo ufw allow 28017/udp
sudo ufw allow 28082/tcp
sudo ufw status

Leave the RCON port closed. You will be able to administer the server from the in-game console, and if you later use a remote RCON tool, allow the port only from your own IP address with sudo ufw allow from your_ip to any port 28016 proto tcp.

Step 5 - Creating the systemd service

Rust takes most of its settings as command-line arguments. Defining them in a systemd unit gives you automatic restarts after crashes, startup on boot and logs in the journal.

Create the unit file:

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

Paste the following, replacing the hostname, description, seed and your_rcon_password:

[Unit]
Description=Rust dedicated server
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
User=rust
Group=rust
WorkingDirectory=/home/rust/server
Environment=LD_LIBRARY_PATH=/home/rust/server/RustDedicated_Data/Plugins:/home/rust/server/RustDedicated_Data/Plugins/x86_64
ExecStart=/home/rust/server/RustDedicated -batchmode \
    +server.identity "main" \
    +server.hostname "Your Server Name" \
    +server.description "Your server description" \
    +server.level "Procedural Map" \
    +server.seed 12345 \
    +server.worldsize 3500 \
    +server.maxplayers 50 \
    +server.port 28015 \
    +server.queryport 28017 \
    +rcon.port 28016 \
    +rcon.password "your_rcon_password" \
    +rcon.web 1 \
    +app.port 28082 \
    +server.saveinterval 600
Restart=on-failure
RestartSec=30
TimeoutStopSec=60

[Install]
WantedBy=multi-user.target

What the main options do:

  • server.identity is the folder under ~/server/server/ where the map, saves and configuration of this server are stored.
  • server.seed and server.worldsize define the procedural map. The same seed and size always generate the same map; sizes between 3000 and 4500 suit most servers, and larger maps need more RAM.
  • server.saveinterval is the autosave interval in seconds.
  • rcon.web 1 enables the WebSocket RCON protocol that modern admin tools use. Use a long, random RCON password.

Because the unit contains the RCON password, make it readable only by root:

sudo chmod 600 /etc/systemd/system/rust.service

Reload systemd and start the server:

sudo systemctl daemon-reload
sudo systemctl enable --now rust

The first start generates the map, which takes several minutes. Follow the log:

sudo journalctl -u rust -f

The server is ready when a line like this appears:

Server startup complete

Press Ctrl+c to stop following the log (the server keeps running), then check that it is listening:

sudo ss -ulnp | grep RustDedicated
UNCONN 0      0            0.0.0.0:28015      0.0.0.0:*    users:(("RustDedicated",pid=4121,fd=112))
UNCONN 0      0            0.0.0.0:28017      0.0.0.0:*    users:(("RustDedicated",pid=4121,fd=115))

To join, open Rust, press F1 to open the console and type:

client.connect your_server_ip:28015

Community servers can take up to an hour to appear in the in-game server browser, so connecting directly is the fastest way to test.

Step 6 - Making yourself an admin

Rust reads owner and moderator accounts from users.cfg inside the server identity folder. Create it as the rust user:

sudo -u rust mkdir -p /home/rust/server/server/main/cfg
sudo -u rust nano /home/rust/server/server/main/cfg/users.cfg

Add one line per admin, with the SteamID64, a name and a note:

ownerid 76561198000000000 "your_name" "server owner"

Restart the server to load the file:

sudo systemctl restart rust

When you join, the in-game F1 console accepts admin commands. Some useful ones:

CommandWhat it does
statusList connected players with their SteamIDs
say "message"Send a message to all players
kick "player" "reason"Kick a player
ban "player" "reason"Ban a player
server.saveSave the world immediately
server.writecfgWrite changed server variables and bans to disk

Run server.save before any planned stop or restart so players lose no progress since the last autosave.

Step 7 - Installing Oxide for plugins (optional)

Oxide is the most widely used plugin framework for Rust. It replaces some server files, so it must be reinstalled after every Rust update.

As the rust user, stop the server, then download the Linux build from the Oxide GitHub releases and extract it over the server directory:

sudo systemctl stop rust
sudo apt install -y unzip
sudo -iu rust
cd ~/server
curl -fLo Oxide.Rust-linux.zip https://github.com/OxideMod/Oxide.Rust/releases/latest/download/Oxide.Rust-linux.zip
unzip -o Oxide.Rust-linux.zip
rm Oxide.Rust-linux.zip
exit

Start the server again:

sudo systemctl start rust

On start, Oxide creates the ~/server/oxide/ directory. Confirm it loaded by checking the log for Oxide messages:

sudo journalctl -u rust --since "10 minutes ago" | grep -i oxide

Plugins are single .cs files that you download from sites such as umod.org and copy into ~/server/oxide/plugins/. Oxide compiles and loads them automatically, and it creates each plugin's configuration in ~/server/oxide/config/. After editing a plugin's configuration, reload it from the F1 console:

oxide.reload PluginName

Step 8 - Updating and wiping the server

Facepunch releases a mandatory update on the first Thursday of every month, and clients cannot join an outdated server. To update, save the world, stop the service and run SteamCMD again:

sudo systemctl stop rust
sudo -u rust /usr/games/steamcmd +force_install_dir /home/rust/server +login anonymous +app_update 258550 validate +quit
sudo systemctl start rust

If you use Oxide, repeat Step 7 after the update and before starting the server.

Monthly updates usually force a map wipe. A wipe means deleting the map and save files so the server generates a fresh world. With the server stopped, remove them from the identity folder:

sudo systemctl stop rust
sudo -u rust find /home/rust/server/server/main -maxdepth 1 \( -name '*.map' -o -name '*.sav*' \) -print -delete

The -print flag shows every file that is deleted. To also wipe blueprints, delete the player.blueprints.*.db files in the same folder. Change server.seed in the unit file if you want a different map, then run sudo systemctl daemon-reload and sudo systemctl start rust.

Step 9 - Backing up the world

Everything specific to your server (map, saves, users.cfg, bans) lives in the identity folder, and Oxide data lives in ~/server/oxide. Back them up daily with a cron job in the rust user's crontab:

sudo -u rust mkdir -p /home/rust/backups
sudo -u rust crontab -e

Add these lines, which create a compressed archive at 05:00 and delete archives older than 7 days:

0 5 * * * tar -czf /home/rust/backups/rust-$(date +\%F).tar.gz -C /home/rust/server server/main oxide 2>/dev/null
30 5 * * * find /home/rust/backups -name 'rust-*.tar.gz' -mtime +7 -delete

The % characters are escaped because cron treats a bare % as a newline. If you don't use Oxide, remove oxide from the first line. Copy the archives off the server as well, since a backup on the same disk does not survive a disk failure.

Troubleshooting

The service stops right after starting. Read the last lines of the log with sudo journalctl -u rust -n 50. An error about a missing .so library usually means LD_LIBRARY_PATH in the unit is wrong or the download was incomplete; run the SteamCMD command with validate again.

The process is killed during map generation. Check sudo journalctl -k | grep -i "out of memory". Rust needs more RAM than most game servers: reduce server.worldsize or move to a plan with more memory.

Players get "Connection attempt failed". Confirm UFW allows 28015/udp and that the server printed Server startup complete. If the server is outdated after a Thursday update, clients are refused until you update it.

Oxide plugins stop working after an update. The Rust update overwrote the Oxide files. Reinstall Oxide as in Step 7.

Conclusion

You now have a Rust dedicated server running on Ubuntu 24.04 as an unprivileged systemd service, with admin access, optional Oxide plugins, and a routine for monthly updates, wipes and daily backups.

As next steps, consider scheduling a daily restart during quiet hours to release memory, adding plugins for admin tools or kits, and copying your backups to object storage or another server.