Shopping Cart

Manage server FiveM (restart/start/stop/screen/status) on linux – Server Tutorials


Hi !
I would like to add my small contribution for the management of a server FiveM under linux. I know there are already several topics, but I find some are incomplete or not practical uses, that’s why I created my own script.

Nothing complicated to use it.

You will need :

  • Server Linux
  • Server FiveM
  • A mouse
  • A keyboard
  • Putty (or other)

What does this script do?

It allows to start, restart, stop, screen, and check the status of its server FiveM. But not only!
It also restart mysql, clear the server cache and restart sessionmanager.


I will not show you how to use putty, it’s way too simple.

  1. Open putty and connect to your linux server.
  2. Once connected, navigate to your FiveM directory via the command cd
  3. Once you are at the root of your server, use the wget command

  1. Technically, you should have a file named at the root of your directory

  2. Now, edit this files. Two solutions, via the editor (vim/nano…), or via your ftp if you are a slacker. I will use nano.

  3. Edit the vith the command nano You go into edit mode

  4. Arrived at this stage, You only have to modify a few lines.

8.Once modified, you just have to do CTRL + X, type O and press ENTER

Use script

/! At the first use, the fivem server must be completely off, because here I use as the name of screen fxserver

  1. To use this script, you must be at the root of your fivem server (ex: /home/FiveM).

    I advise you to use the dos2unix command (apt-get install dos2unix) to convert your file to the correct format.
    Like this :


    And you need to add permissions on this file :

    chmod -R 755
  2. Now, we simply use the command ./ start
    This will start the server.

Other uses

./ start : start server
./ stop : stop server
./ restart : restart server
./ screen : connect to the screen (console)
./ status : lets you know if the fivem server is started or not

Add a cron task

If you want to use this script for an automatic reboot at any time, you must create a cron task.

For this, i use crontab -e. You need to defile the file editor with your arrow keys.

Exemple :

Here the server will reboot at 00:00, 12pm, 18pm.

00 00 * * * /home/FiveM/ restart
0 12 * * * /home/FiveM/ restart
0 18 * * * /home/FiveM/ restart

Once modified, you just have to do CTRL + X, type O and press ENTER

I do not know if I would update this post and the file. It was just to share.




Premium ESX Scripts? Click here!

Leave a Reply
FiveM ESX Scripts

The best scripts and maps

Best support

Problems? We are there to help!

Wide range of products

We have a wide range of products

100% Secure Checkout

Easy and encrypted