Setup a Multi Theft Auto Server on Debian

This is a tutorial that explains how to install a Multi Theft Auto server on Debian. It was last updated for Debian 7 and MTA 1.5.4.

Any VPS from AKLWEB HOST is great for an MTA server, whether it’s just a private server for friends or development, or a server that will host lots of people 24/7.

For a development server or a server for your friends, I would recommend the lowest-end VPS (768 MB RAM). The more people you are hosting, the bigger the server you would get (obviously).

Let's get started!

Credit goes to jhxp on the Multi Theft Auto forums for the majority of the steps in this tutorial. I have just added the links for 1.4.0 and changed a few things to make them shorter.

Installing Packages

These packages must be installed before the MTA Server.

For 32-bit Debian:

apt-get update; 
apt-get upgrade; 
apt-get -y install zip unzip libreadline5 screen

For 64-bit Debian:

apt-get update; 
apt-get upgrade; 
dpkg --add-architecture i386; #add the i386 architecture so the ia32-libs package can be installed
apt-get update; #update the list of packages so the ia32-libs package is included in the list
apt-get -y install zip unzip ia32-libs lib32ncursesw5 lib32readline5 screen

Summary:

Installing Multi Theft Auto

Do the steps listed below, one at a time:

cd ~; 
mkdir mtasa; 
cd mtasa;
wget -O mtasa-linux-server.tar.gz http://linux.mtasa.com/dl/154/multitheftauto_linux_x64-1.5.4.tar.gz;
wget -O baseconfig.tar.gz http://linux.mtasa.com/dl/154/baseconfig-1.5.4.tar.gz;
wget -O mtasa-resources.zip https://mirror.mtasa.com/mtasa/resources/mtasa-resources-latest.zip;
tar -zxf mtasa-linux-server.tar.gz; 
mv multitheftauto_linux_x64-1.5.4 mtasa-server; 
unzip -q mtasa-resources.zip -d mtasa-server/mods/deathmatch/resources/;
tar -zxf baseconfig.tar.gz; #uncompress default server configuration files
mv baseconfig/* mtasa-server/mods/deathmatch; 
rmdir baseconfig; 
rm mtasa-linux-server.tar.gz baseconfig.tar.gz mtasa-resources.zip; 

Summary:

Configuring The Server

Run the following commands:

cd ~; 
cd mtasa/mtasa-server/mods/deathmatch; 
nano mtaserver.conf;

Summary:

Now, we can configure our server. All that you need to configure in this step is the server name, the number of slots the server can have (default is 32), and what resources it will run upon start-up. To configure your server, make any changes to the mtaserver.conf file in nano that you deem necessary. Once you have finished, hold CTRL and press O, then type y to save.

Running The Server

Run the following commands:

cd ~; 
cd mtasa/mtasa-server/; 
./mta-server; 

Summary:

If everything is working, the MTA console should be displayed. The server will print a message stating that it is ready to accept connections.

There you go – you now have a fully working Multi Theft Auto 1.4.0 server that is ready for players!

Extras

At this point, the server is running. Once you exit the shell, though, the server will stop. To keep it running when you have exited the shell, run the following commands:

cd ~; 
cd mtasa/mtasa-server/; 
screen -dmS mtasa ./mta-server;

Summary:

To view your server, run screen with the process ID of the server:

screen -r PROCESS_ID

You can find the process ID of your server by running this command:

screen -ls

Your server will appear with the ID being the first number next to what you called the screen (Example: 1231.mtasa).

To exit the screen, hold down CTRL, then press A and D at the same time to exit. If you are using a shell program, such as PuTTY, then you can just close PuTTY.

To stop the server, go to the screen and type quit in the server console.

If the server has crashed, then get the screen ID and run: kill <id> or kill -9 <id>.

Enjoy your new MTA Server!