Installation d'un serveur FiveM sous Linux

PRÉREQUIS

  • Un VPS ou un dédié avec une distribution linux
  • Accès à l'utilisateur root

1. Installation

Installation des packages requis
1
apt install wget git
Copied!
Créations des dossier pour le serveur FiveM
1
mkdir -p /root/FXServer/server && cd /root/FXServer/server
Copied!
Téléchargement de l'artefact en précisant son URL que vous pouvez obtenir ici
1
wget [url de l'artefact]
Copied!
Extraction des fichiers
1
tar xf fx.tar.xz
Copied!
Téléchargement des fichiers du serveur
1
git clone https://github.com/citizenfx/cfx-server-data.git /root/FXServer/server-data
Copied!
Création du fichier de configuration du serveur
1
nano /root/FXServer/server-data/server.cfg
Copied!
Mis en place de la configuration du serveur
1
# Only change the IP if you're using a server with multiple network interfaces, otherwise change the port only.
2
endpoint_add_tcp "0.0.0.0:30120"
3
endpoint_add_udp "0.0.0.0:30120"
4
5
# These resources will start by default.
6
ensure mapmanager
7
ensure chat
8
ensure spawnmanager
9
ensure sessionmanager
10
ensure basic-gamemode
11
ensure hardcap
12
ensure rconlog
13
14
# This allows players to use scripthook-based plugins such as the legacy Lambda Menu.
15
# Set this to 1 to allow scripthook. Do note that this does _not_ guarantee players won't be able to use external plugins.
16
sv_scriptHookAllowed 0
17
18
# Uncomment this and set a password to enable RCON. Make sure to change the password - it should look like rcon_password "YOURPASSWORD"
19
#rcon_password ""
20
21
# A comma-separated list of tags for your server.
22
# For example:
23
# - sets tags "drifting, cars, racing"
24
# Or:
25
# - sets tags "roleplay, military, tanks"
26
sets tags "default"
27
28
# A valid locale identifier for your server's primary language.
29
# For example "en-US", "fr-CA", "nl-NL", "de-DE", "en-GB", "pt-BR"
30
sets locale "root-AQ"
31
# please DO replace root-AQ on the line ABOVE with a real language! :)
32
33
# Set an optional server info and connecting banner image url.
34
# Size doesn't matter, any banner sized image will be fine.
35
#sets banner_detail "https://url.to/image.png"
36
#sets banner_connecting "https://url.to/image.png"
37
38
# Set your server's hostname
39
sv_hostname "FXServer, but unconfigured"
40
41
# Nested configs!
42
#exec server_internal.cfg
43
44
# Loading a server icon (96x96 PNG file)
45
#load_server_icon myLogo.png
46
47
# convars which can be used in scripts
48
set temp_convar "hey world!"
49
50
# Remove the `#` from the below line if you do not want your server to be listed in the server browser.
51
# Do not edit it if you *do* want your server listed.
52
#sv_master1 ""
53
54
# Add system admins
55
add_ace group.admin command allow # allow all commands
56
add_ace group.admin command.quit deny # but don't allow quit
57
add_principal identifier.fivem:1 group.admin # add the admin to the group
58
59
# enable OneSync (required for server-side state awareness)
60
set onesync on
61
62
# Server player slot limit (see https://fivem.net/server-hosting for limits)
63
sv_maxclients 48
64
65
# Steam Web API key, if you want to use Steam authentication (https://steamcommunity.com/dev/apikey)
66
# -> replace "" with the key
67
set steam_webApiKey ""
68
69
# License key for your server (https://keymaster.fivem.net)
70
sv_licenseKey changeme
Copied!
Ajoutez votre clé de licence sv_licenceKeyainsi que votre clé d'API Steam steam_webApiKey
Démarrage du serveur FiveM sans TXAdmin
1
bash /root/FXServer/server/run.sh +exec /root/FXServer/server-data/server.cfg
Copied!
Démarrage du serveur FiveM avec TXAdmin
1
bash /root/FXServer/server/run.sh +set serverProfile dev_server +set txAdminPort 40125
Copied!

2. Configuration

EN REDACTION

Fin !

Rédigé par Hugo (Aidant) pour CUBIXSERV.
Dernière mise à jour 10mo ago