How To Install A Rust Server On Ubuntu 20.04 With LinuxGSM
This installation method utilizes LinuxGSM in order to set up a Rust server from scratch on Ubuntu 20.04
First, we have to install our dependencies- though luckily we can do this with one command.
sudo dpkg --add-architecture i386; sudo apt update; sudo apt install curl wget file tar bzip2 gzip unzip bsdmainutils python3 util-linux ca-certificates binutils bc jq tmux netcat lib32gcc1 lib32stdc++6 libsdl2-2.0-0:i386 steamcmd lib32z1
After this we have to begin setting up requirements for our server, in this case, we will be setting up a user- named rustserver. We can do so by running:
Be sure to use a strong password! Security in your server is vital! Following this, we have to access our new user. We can do this with:
su - rustserver
Now we have to install LinuxGSM- we will install it using the following wget command:
wget -O linuxgsm.sh https://linuxgsm.sh && chmod +x linuxgsm.sh && bash linuxgsm.sh rustserver
Finally- to finish our installation process of LinuxGSM we have to run a command to actually execute the installer- we can do so by simply running:
Now that we have successfully installed LinuxGSM we can work with the basic commands for our server.
To list our new Rust server's commands we can run the following:
To get information such as ports, passwords & config files you can run the following:
To start our server we can run the following:
To stop our server we can run:
And that's the basics for your new rust server!
To automate LinuxGSM tasks we can use cronjobs- to run any command at a given time. To edit your crontab you can run the following:
Here is a list of some recommended crontabs:
*/5 * * * * /home/rustserver/rustserver monitor > /dev/null 2>&1 */30 * * * * /home/rustserver/rustserver update > /dev/null 2>&1 0 0 * * 0 /home/rustserver/rustserver update-lgsm > /dev/null 2>&1
For additional information on LinuxGSM commands & configurations- view their documentation page here.