How to set up your own MTA San Andreas server (Linux)

Intro

MTA:SA (Multi Theft Auto: San Andreas) is a widely used multiplayer mod created for San Andreas. This guide will show you how to set up an MTA:SA server on a Linux box.

The first thing you will need is a Linux box with root access. Either a dedicated server or a VPS (Virtual Private Server will do).

I would suggest using Vultr (please use this link to help support me!) for this, as they offer fast and cheap KVM machines in multiple locations across the world, starting from $5/month.

This guide will focus on setting up a Vultr VPS using Debian 8, but should work with other hosts and other Linux distributions, although I can’t guarantee it.

Creating and connecting to the VPS

Note: you can skip this bit if you know how to connect to your server

Once you have signed up at Vultr, you will be able to create a VPS. Just go to Servers then click the plus sign (+) and choose your location by clicking on the flag (choose the country nearest to you, or nearest to where the majority of your players will be. London is a good choice for covering most of Europe as well as the east coast of USA) then click Debian and select 8 x64 then under Server Size choose the specs you want. You should be able to easily host up 50+ players on the smallest 768MB RAM package, so choose this one for now. Once you click deploy, wait a few minutes for the server to be created.

Next, download PuTTY from this link. This is the program you will use to connect to your server and run commands. Open the file once it’s done downloading, and set it up like this

Host Name (or IP Address): the IP address given to you by Vultr on the “servers” page
Port: 22
Saved Sessions: in this box, type a name for your server like “MTA”

After that, click Save, then click Open

Once you click that, a window should pop up and ask you for a password. This is the root password of your server, and will have been emailed to you by Vultr (or you can click on your server in the control panel, and click the eye next to Password.

Once you’ve logged in to your VPS you should see something similar to this

root@vultr:~#

If you see that, move onto the next step. If not, try again or post a comment below and I will try to help.

Setting up the VPS

Note: to paste something in PuTTY, just right click inside the window

 

Now we need to update our server and install some things. First, you may want to change the password.

To change your password type passwd and press enter. Then it will ask you to choose a password, and after pressing enter it will ask you to confirm it. Type it in again and press enter, it should say passwd: password updated successfully

Next, run the following command to update your server and install unzip (to unzip some files), nano (a commandline text editor which we will use later), screen (used to run MTA:SA in the background when you disconnect from the server) and unattended-upgrades (to help keep your server secure)

apt-get update && apt-get -y dist-upgrade && apt-get -y install unattended-upgrades unzip nano

If you used Vultr, it will most likely be updated and already have some of these installed.

Installing MTA

Note: to paste something in PuTTY just right click inside the window

Now is the bit you really care about. Download and extract the MTA:SA server files by copy and pasting the following command into PuTTY, then press enter.

wget http://linux.mtasa.com/dl/152/multitheftauto_linux_x64-1.5.2.tar.gz && tar -zxvf multitheftauto_linux_x64-1.5.2.tar.gz && rm multitheftauto_linux_x64-1.5.2.tar.gz

Next we want to do the same thing with some default config files. Copy and paste the following command and press enter

wget http://linux.mtasa.com/dl/152/baseconfig-1.5.2.tar.gz && tar -zxvf baseconfig-1.5.2.tar.gz && mv baseconfig/* multitheftauto_linux_x64-1.5.2/mods/deathmatch && rm -rf baseconfig && rm baseconfig-1.5.2.tar.gz

And finally we want all of the default resources, so we’ll create the folder, change to that folder, then download and extract them with the following command

mkdir multitheftauto_linux_x64-1.5.2/mods/deathmatch/resources && cd multitheftauto_linux_x64-1.5.2/mods/deathmatch/resources && wget https://mirror.mtasa.com/mtasa/resources/mtasa-resources-latest.zip && unzip mtasa-resources-latest.zip && rm mtasa-resources-latest.zip

Configuring MTA

Now let’s configure it!

Type in the following command and press enter to open the main server config file

cd ~/multitheftauto_linux_x64-1.5.2/ && nano mods/deathmatch/mtaserver.conf

Now the file is open with nano and we can edit it! Use the arrow keys to move around, and then use it like a normal text editor (backspace to delete, etc.)

The main thing you will want to change is <servername>Default MTA Server</servername>

The bit you want to change is inside the <servername> and </servername> tags, so change it to something like this

<servername>My own MTA:SA server!</servername>

You can also go through and change FPS limit, number of players, etc.

Once you’ve made all of your changes hold Ctrl and press X to save it. It will confirm you want to save it so type Y and press enter.

Now we can start the server

Starting your MTA server

We want to keep MTA running when we disconnect from the server, so we need to use screen. Enter the following command and press enter

screen -S mta

Now we’re inside a screen session. Type the following command and press enter to start MTA

./mta-server64

Wait a few seconds and MTA will now be running.

To leave it running in the background, hold Ctrl + A together, then Press D at the same time.

To then enter the screen session again, type the following command and press enter

screen -r mta

Next we’ll create an admin account

Creating an admin account

Now the server is running, and we can type commands in the MTA console (black screen with the green bar at the bottom) we’ll create an admin account. Enter the following (replacing yourusername and yourpassword) and press enter

addaccount yourusername yourpassword

The server should reply with the following (ACCOUNTS: Console added account ‘yourusername’ with password ‘yourpassword’)

Now, we need to give ourselves admin permissions, so enter the following command and press enter

shutdown

Then type the following command and press enter

nano mods/deathmatch/acl.xml

We’re in nano (the text editor) again. Using the arrow keys to navigate, find the section starting with <group name=”Admin”>

Once you’ve found this, within the section you should see <object name=”resource.admin”></object>

We need to create another object for our user, so in the same section (above or below the other <object> tags) add this, replacing yourusername with your actual username

<object name=”user.yourusername”></object>

Once you’ve added that, hold Ctrl and press X to save it. Type Y then press enter.

Now we can start the server back up. Enter the following command and press enter

./mta-server64

Now we want to leave it running in the background again, so do the following

Hold Ctrl + A, then press D

Aaccessing the admin panel in-game

Note: NEVER give your admin password to anyone. Only ever enter it in the command panel when logging in, make sure you don’t enter it in the chat at all

Now you can disconnect from the server and join your server in MTA! The server address will be the following (replace yourIP with your actual IP)

mtasa://yourIP:22003

Once you’re connected to your server in-game, open the console by pressing F8 and login with the following command (replacing yourusername and yourpassword)

login yourusername yourpassword

Now you’re logged in to your account with admin access, press P in-game to bring up the admin panel, where you can configure everything on the server easily 🙂

Thanks for reading this guide, and if you want to help me, as well as have a great experience on your own MTA server, considering using Vultr as the host and signing up with this link

If you have any issues at all, leave a comment below and I will try to get back to you!

How to run a Gmod server on a Linux VPS

About Gmod and this guide

Gmod (or Garry’s Mod) is a sandbox physics game based on the Counter-Strike: Source engine. The game places you in an empty world with access to items from Source games, and you can do/build anything you want.

This guide will show you how to set up Gmod

What is required?

The only thing you need is a Linux VPS running Debian (or Ubuntu) with at least 512MB RAM (preferably 1GB), a good CPU core (especially a host that allows you to utilise it) and a good connection speed (at least 10mbps up). At least 10GB HDD space for extra maps, mods, etc.

Since many hosts ban gameservers and/or don’t allow you to use a lot of CPU, I would recommend using Vultr since I have used them before and I am very happy with the performance and price. You can also check this thread for any Vultr coupons/offers.

Configuring the VPS

First, we want a clean VPS, so run the following command and hit enter

apt-get remove --purge -y apache2* bind9* sendmail* vim vim-* samba*

Then we want to upgrade everything and also installed some required libraries so run the following command as well and hit enter

apt-get update && apt-get -y dist-upgrade && apt-get -y install lib32gcc1

Then we’ll create a Gmod user so it’s not running as root. Run the following command and hit enter

adduser gmod

Now choose a secure password, and fill in the rest of the info (you can just press enter and leave everything (except the password) blank if you want).

Now log out, and log back in with the gmod user.

Installing Gmod

Before installing Gmod, we need to install the Steam client, so run the following command and press enter

mkdir ~/bin && cd ~/bin && wget http://media.steampowered.com/client/steamcmd_linux.tar.gz && tar -zxvf steamcmd_linux.tar.gz && ./steamcmd.sh +login anonymous +quit

Once that’s installed, we can download and install Gmod. Run the following command which will change to the home directory, download a shell script (you can open this in any text editor to check what it does first) and then run that shell script, which will download Gmod to the gmod folder. Press enter after,  and it will show you the progress of the dowload.

cd ~ && wget http://ehwtf.com/gmod/update_gmod.sh && chmod +x update_gmod.sh && ./update_gmod.sh

Starting Gmod

To start Gmod, and keep it running after we disconnect from the VPS, we need to start it in a screen session.

Run the following command and press enter

screen -S gmod

Then, once you’re in a screen session, run the following command and press enter to start the server.

~/gmod/srcds_run -game garrysmod +maxplayers 12 +map gm_flatgrass

Note: changing the number after +maxplayers will change the max player limit. Also, after +map you can choose specify the map. The default maps installed are gm_flatgrass (flat area) or gm_construct (small area with some buildings)

Once the server is running, hold down the Ctrl and A button, and then while doing that, press D on your keyboard. You can then log off your VPS

Stopping and restarting Gmod

To stop Gmod, you need to re-enter the screen session, so enter the following command and press enter

screen -r gmod

Now, to stop Gmod press CtrlC

Then type the following command and press enter

exit

To start the server again, follow Starting Gmod section above.

Any issues/errors

If you have any issues, please leave a comment below. I will do my best to reply.