打开官网,点击 下载服务端(非商业),如图所示

网页跳转到官方说明文档

该说明文档提供了安装在 Windows 和 Linux 上的方法,下面逐一介绍。

Windows

前提条件:

1.Visual C++ Redistributable 2019

2.Git

3.高配置服务器一台

安装步骤

1.创建新文件夹为 D:\FxServer

2.下载最新 Windows 端服务器文件:artifacts server

3.解压下载的服务器文件到 FxServer 文件夹中

4.克隆cfx-server-data到 D:\FxServer 中,并重名名为 server-data,且与服务器文件夹 server 同级.命令:git clone https://github.com/citizenfx/cfx-server-data.git server-data

5.在 server-data 文件夹下创建 server.cfg 配置文件,文件内容来自example server.cfg ,内容如下:

# Only change the IP if you're using a server with multiple network interfaces, otherwise change the port only.
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"# These resources will start by default.
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure fivem
ensure hardcap
ensure rconlog
ensure scoreboard# This allows players to use scripthook-based plugins such as the legacy Lambda Menu.
# Set this to 1 to allow scripthook. Do note that this does _not_ guarantee players won't be able to use external plugins.
sv_scriptHookAllowed 0# Uncomment this and set a password to enable RCON. Make sure to change the password - it should look like rcon_password "YOURPASSWORD"
#rcon_password ""# A comma-separated list of tags for your server.
# For example:
# - sets tags "drifting, cars, racing"
# Or:
# - sets tags "roleplay, military, tanks"
sets tags "default"# A valid locale identifier for your server's primary language.
# For example "en-US", "fr-CA", "nl-NL", "de-DE", "en-GB", "pt-BR"
sets locale "root-AQ"
# please DO replace root-AQ on the line ABOVE with a real language! :)# Set an optional server info and connecting banner image url.
# Size doesn't matter, any banner sized image will be fine.
#sets banner_detail "https://url.to/image.png"
#sets banner_connecting "https://url.to/image.png"# Set your server's hostname
sv_hostname "FXServer, but unconfigured"# Nested configs!
#exec server_internal.cfg# Loading a server icon (96x96 PNG file)
#load_server_icon myLogo.png# convars which can be used in scripts
set temp_convar "hey world!"# Uncomment this line if you do not want your server to be listed in the server browser.
# Do not edit it if you *do* want your server listed.
#sv_master1 ""# Add system admins
add_ace group.admin command allow # allow all commands
add_ace group.admin command.quit deny # but don't allow quit
add_principal identifier.fivem:1 group.admin # add the admin to the group# Hide player endpoints in external log output.
sv_endpointprivacy true# Server player slot limit (must be between 1 and 32, unless using OneSync)
sv_maxclients 32# Steam Web API key, if you want to use Steam authentication (https://steamcommunity.com/dev/apikey)
# -> replace "" with the key
set steam_webApiKey ""# License key for your server (https://keymaster.fivem.net)
sv_licenseKey changeme

中文解释:

# 一般情况下不用修改!
# 只有使用多个服务器协议的时候才需要更改。默认的TCP和UDP端口为30120
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"# 默认启动资源。
start mapmanager
start chat
start spawnmanager
start sessionmanager
start fivem
start hardcap
start rconlog
start scoreboard
start playernames# 允许玩家使用scripthook挂载的修改器,例如lambda菜单。
# 设置为0可以禁用。
sv_scriptHookAllowed 1# 取消前面的#可以启动RCON,记住你更改的密码。
#rcon_password changeme         #一般用不到# 服务器标签,中间用逗号隔开
# 例如:
# - sets tags "drifting, cars, racing"
# 或者:
# - sets tags "roleplay, military, tanks"
sets tags "default"# 设置服务器横幅或者链接横幅的URL
# 大小没有限制,任何图像都可以.
#sets banner_detail "http://url.to/image.png"
#sets banner_connecting "http://url.to/image.png"# 设置服务器名称
sv_hostname "My new FXServer!"# 嵌套配置!一般不改。
#exec server_internal.cfg# 服务器LOGO图标 (96x96 PNG文件)
#load_server_icon myLogo.png# 可以在脚本中使用的封面。
set temp_convar "hey world!"# #如果你不想服务器显示在FiveM网页服务器列表,可以把#号删掉。
#sv_master1 ""# 只能让Steam或者第三方运营商进入你的FiveM服务器?
# 不要忘记Social Club也是第三方提供商!
# 一般不改
#sv_authMaxVariance 1
#sv_authMinTrust 5# 添加系统管理员。
add_ace group.admin command allow # allow all commands
add_ace group.admin command.quit deny # but don't allow quit
add_principal identifier.steam:1 group.admin # add the admin to the group# 在外部输出日志上不显示玩家的信息。
sv_endpointprivacy true# 服务器人数设置 (必须在 1 到 32)
sv_maxclients 32# 服务器密钥 (https://keymaster.fivem.net)
sv_licenseKey changeme

需要修改的几项有:
sv_hostname:服务器名称,随便写
load_server_icon:服务器列表显示的图标,去掉#表示开启,自定义图片必须是 96x96 分辨率的 png 图片而且放在 server-data 目录中与配置文件同级目录
add_principal identifier.steam:根据注册的账号 ID 添加管理员

6.去FiveM 论坛 注册账户

7.再去获取服务器密钥(序列号申请次数无上限)

8.申请序列号之后将 server.cfg 配置文件最后一项的 changeme 部分替换成上一步申请的序列号即可

9.打开终端,输入下面两句命令即可启动服务器:

cd  /d D:\FXServer\server-data
D:\FXServer\server\run.cmd +exec server.cfg

注意:若觉得每次启动服务器麻烦,可以新建一个 bat 文件,将上述两句命令粘贴进去,每次启动服务器的时候双击 bat 文件即可

Linux

由于 Linux 搭建方法与 Windows 大同小异,故整理了一个自动化部署脚本

#下载服务器文件
wget https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/1688-c814f804e64c28952269bc5abbac92d7c956f844/fx.tar.xz#下载资源文件
git clone https://github.com/citizenfx/cfx-server-data.git server-data#创建文件夹
mkdir -p /usr/local/src/FiveM/server#解压服务器文件到指定文件夹
tar -xf fx.tar.xz -C /usr/local/src/FiveM/server#复制资源文件到指定文件夹
cp -r server-data /usr/local/src/FiveM/#创建配置文件
cat <<EOF >/usr/local/src/FiveM/server-data/server.cfg
# Only change the IP if you're using a server with multiple network interfaces, otherwise change the port only.
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"# These resources will start by default.
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure fivem
ensure hardcap
ensure rconlog
ensure scoreboard# This allows players to use scripthook-based plugins such as the legacy Lambda Menu.
# Set this to 1 to allow scripthook. Do note that this does _not_ guarantee players won't be able to use external plugins.
sv_scriptHookAllowed 0# Uncomment this and set a password to enable RCON. Make sure to change the password - it should look like rcon_password "YOURPASSWORD"
#rcon_password ""# A comma-separated list of tags for your server.
# For example:
# - sets tags "drifting, cars, racing"
# Or:
# - sets tags "roleplay, military, tanks"
sets tags "default"# A valid locale identifier for your server's primary language.
# For example "en-US", "fr-CA", "nl-NL", "de-DE", "en-GB", "pt-BR"
sets locale "root-AQ"
# please DO replace root-AQ on the line ABOVE with a real language! :)# Set an optional server info and connecting banner image url.
# Size doesn't matter, any banner sized image will be fine.
#sets banner_detail "https://url.to/image.png"
#sets banner_connecting "https://url.to/image.png"# Set your server's hostname
sv_hostname "FXServer, but unconfigured"# Nested configs!
#exec server_internal.cfg# Loading a server icon (96x96 PNG file)
#load_server_icon myLogo.png# convars which can be used in scripts
set temp_convar "hey world!"# Uncomment this line if you do not want your server to be listed in the server browser.
# Do not edit it if you *do* want your server listed.
#sv_master1 ""# Add system admins
add_ace group.admin command allow # allow all commands
add_ace group.admin command.quit deny # but don't allow quit
add_principal identifier.fivem:1 group.admin # add the admin to the group# Hide player endpoints in external log output.
sv_endpointprivacy true# Server player slot limit (must be between 1 and 32, unless using OneSync)
sv_maxclients 32# Steam Web API key, if you want to use Steam authentication (https://steamcommunity.com/dev/apikey)
# -> replace "" with the key
set steam_webApiKey ""# License key for your server (https://keymaster.fivem.net)
sv_licenseKey changemeEOF

将脚本中的 changeme 替换成服务器密钥即可部署

启动服务

使用如下命令启动:

cd /usr/local/src/FiveM/server-data
/usr/local/src/FiveM/server/run.sh +exec server.cfg

切记,不可用 /usr/local/src/FiveM/server/run.sh +exec /usr/local/src/FiveM/server-data/server.cfg 命令启动,会失败,具体原因未知

开机自启

为了做到开机自启,我采用了 Supervisor 的方式(使用 systemctl 方式会无限重启,原因未知):
先创建一个启动服务的脚本 /usr/local/src/FiveM/start.sh:

cd /usr/local/src/FiveM/server-data && /usr/local/src/FiveM/server/run.sh +exec server.cfg

然后在 Supervisor 的配置文件夹 /etc/supervisor/conf.d/ 中新建 FiveM 的启动文件 fivem.conf

[program:fivem]
command=/usr/bin/bash /usr/local/src/FiveM/start.sh
directory=/usr/local/src/FiveM
user=root
stdout_logfile=/var/log/fivem.log
autostart=true
autorestart=true
redirect_stderr=true
stopsignal=QUIT

最后使用 supervisorctl reload,选择 y 即可开机自启 FiveM 服务

[root@centos ~]# supervisorctl status
fivem                            RUNNING   pid 3316, uptime 5:24:59

实时日志如下(每三分钟发一次心跳):

[root@centos ~]# tail /var/log/fivem.log -f
Sending heartbeat to live-internal.fivem.net:30110
Sending heartbeat to live-internal.fivem.net:30110
Sending heartbeat to live-internal.fivem.net:30110
Sending heartbeat to live-internal.fivem.net:30110
Sending heartbeat to live-internal.fivem.net:30110
Sending heartbeat to live-internal.fivem.net:30110
Sending heartbeat to live-internal.fivem.net:30110
Sending heartbeat to live-internal.fivem.net:30110
Sending heartbeat to live-internal.fivem.net:30110
Sending heartbeat to live-internal.fivem.net:30110

连接情况(服务器需要添加 30120 的 TCP 和 UDP 入站规则):

[root@VM_0_7_centos ~]# lsof -i:30120
COMMAND    PID USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
ld-musl-x 3317 root   28u  IPv4 36571478      0t0  TCP VM_0_7_centos:30120->150.116.85.124:55130 (ESTABLISHED)
ld-musl-x 3317 root   31u  IPv4 36470180      0t0  TCP *:30120 (LISTEN)
ld-musl-x 3317 root   33u  IPv6 36470181      0t0  UDP *:30120
ld-musl-x 3317 root   35u  IPv4 36476879      0t0  TCP VM_0_7_centos:30120->201.75.45.121:52624 (ESTABLISHED)
ld-musl-x 3317 root   36u  IPv4 36477004      0t0  TCP VM_0_7_centos:30120->67.166.27.29:57882 (ESTABLISHED)
ld-musl-x 3317 root   37u  IPv4 36509773      0t0  TCP VM_0_7_centos:30120->adria.kvarteto.net:50084 (ESTABLISHED)
ld-musl-x 3317 root   38u  IPv4 36483951      0t0  TCP VM_0_7_centos:30120->cable-188-2-205-27.dynamic.sbb.rs:52447 (ESTABLISHED)
ld-musl-x 3317 root   39u  IPv4 36484090      0t0  TCP VM_0_7_centos:30120->49.230.56.194:50631 (ESTABLISHED)
ld-musl-x 3317 root   40u  IPv4 36571801      0t0  TCP VM_0_7_centos:30120->176.148.208.253:58608 (ESTABLISHED)
ld-musl-x 3317 root   41u  IPv4 36484632      0t0  TCP VM_0_7_centos:30120->179.219.232.155:55005 (ESTABLISHED)
ld-musl-x 3317 root   42u  IPv4 36488632      0t0  TCP VM_0_7_centos:30120->client-201.230.158.233.speedy.net.pe:13723 (ESTABLISHED)
ld-musl-x 3317 root   43u  IPv4 36489318      0t0  TCP VM_0_7_centos:30120->112.201.139.65.pldt.net:ema-sent-lm (ESTABLISHED)
ld-musl-x 3317 root   44u  IPv4 36504202      0t0  TCP VM_0_7_centos:30120->cpc69049-oxfd25-2-0-cust839.4-3.cable.virginm.net:55972 (ESTABLISHED)
ld-musl-x 3317 root   45u  IPv4 36509900      0t0  TCP VM_0_7_centos:30120->106.203.63.106:64732 (ESTABLISHED)
ld-musl-x 3317 root   46u  IPv4 36490560      0t0  TCP VM_0_7_centos:30120->177.155.219.25:58726 (ESTABLISHED)
ld-musl-x 3317 root   47u  IPv4 36510686      0t0  TCP VM_0_7_centos:30120->187.21.113.230:51463 (ESTABLISHED)
ld-musl-x 3317 root   48u  IPv4 36509557      0t0  TCP VM_0_7_centos:30120->pc-252-52-100-190.cm.vtr.net:50904 (ESTABLISHED)
ld-musl-x 3317 root   49u  IPv4 36492966      0t0  TCP VM_0_7_centos:30120->170.254.133.248:4657 (ESTABLISHED)
ld-musl-x 3317 root   50u  IPv4 36512199      0t0  TCP VM_0_7_centos:30120->93-86-107-145.dynamic.isp.telekom.rs:58530 (ESTABLISHED)
ld-musl-x 3317 root   51u  IPv4 36523715      0t0  TCP VM_0_7_centos:30120->c-71-193-90-215.hsd1.mn.comcast.net:64846 (ESTABLISHED)
ld-musl-x 3317 root   52u  IPv4 36515098      0t0  TCP VM_0_7_centos:30120->37.236.124.65:60517 (ESTABLISHED)
ld-musl-x 3317 root   53u  IPv4 36524821      0t0  TCP VM_0_7_centos:30120->ppp-223-24-144-28.revip6.asianet.co.th:11693 (ESTABLISHED)
ld-musl-x 3317 root   54u  IPv4 36522366      0t0  TCP VM_0_7_centos:30120->c-98-192-236-150.hsd1.de.comcast.net:58986 (ESTABLISHED)
ld-musl-x 3317 root   55u  IPv4 36522517      0t0  TCP VM_0_7_centos:30120->190.200.255.39:17832 (ESTABLISHED)
ld-musl-x 3317 root   56u  IPv4 36525992      0t0  TCP VM_0_7_centos:30120->cm-27-145-135-149.revip12.asianet.co.th:52631 (ESTABLISHED)
ld-musl-x 3317 root   57u  IPv4 36531724      0t0  TCP VM_0_7_centos:30120->73.126.70.158:50722 (ESTABLISHED)
ld-musl-x 3317 root   58u  IPv4 36555357      0t0  TCP VM_0_7_centos:30120->cpc139088-jarr15-2-0-cust109.16-2.cable.virginm.net:52928 (ESTABLISHED)
ld-musl-x 3317 root   59u  IPv4 36531740      0t0  TCP VM_0_7_centos:30120->c-174-50-61-97.hsd1.la.comcast.net:52188 (ESTABLISHED)
ld-musl-x 3317 root   60u  IPv4 36551137      0t0  TCP VM_0_7_centos:30120->187.21.84.137:65142 (ESTABLISHED)
ld-musl-x 3317 root   61u  IPv4 36555172      0t0  TCP VM_0_7_centos:30120->77.202.162.69:54845 (ESTABLISHED)
ld-musl-x 3317 root   62u  IPv4 36563973      0t0  TCP VM_0_7_centos:30120->199.199.246.200:63485 (ESTABLISHED)

注意:因为我是放在服务器上的,所以刚搭建完没多久就有客户端连接上来了

资源占用情况:

如何搭建 GTA 5 私服--GTA5私服架设教程相关推荐

  1. 传奇私服开服架设教程 传奇服务端设置教程

    首先开区要使用两个必备的软件:DBC2000.传奇引擎,当然也少不了传奇服务端(传奇服务端在论坛免费服务端和商业服务端中有下载). 先把下载好的服务端解压到D盘或者某个般的根目录(所谓根目录,就是D盘 ...

  2. 传奇手游服务器搭建_传奇私服服务器端在云服务器架设,全版本通用的传奇游戏架设教程...

    原标题:传奇私服服务器端在云服务器架设,全版本通用的传奇游戏架设教程 传奇是一个经典古老的游戏,当年的火爆至今还历历在目!网上有许多单机版的传奇,不过过于无聊,很多东西仿的都不全.要是玩正版又没有那么 ...

  3. 使用Nexus搭建Maven私服、私服下载与上传

    目录 一.概念 1.私服简介 2.私服的好处 3.搭建私服的开源仓库管理软件 二.使用Nexus搭建Maven私服(Windows环境) 1.安装jdk 2.下载即安装Nexus 2.1 下载 2.2 ...

  4. 【转】冒险岛私服架设教程(一) 试玩

    <冒险岛>是我接触得 比较早 的大型网游,也是印象最深刻 的一个网游,它画面精美,背景音乐好听,我最喜欢这类游戏了 . 记得那年是初三毕业,因为电脑配置低, 基本上只玩<QQ堂 &g ...

  5. 使用nexus-3.0.2-02-win64搭建自己的Maven nexus私服

    使用nexus-3.0.2-02-win64搭建自己的Maven nexus私服 在Android开发中我们经常引用一些网上的android依赖,例如这种形式的 compile 'com.androi ...

  6. 搭建公司自己的npm私服服务器

    记录小白如何一步一步搭建自己公司的npm私服库,仅供公司内部使用 1.先下载mobaxterm软件 https://mobaxterm.mobatek.net/download-home-editio ...

  7. 梦幻西游H5私服服务端超详细图文架设教程

    想体验经典Q版西游霸服高兴吗?想体验满级VIP的尊贵吗?想体验一招秒杀的痛快吗?各种极品配备.翅膀.宠物统统给你,就在梦幻西游! 本文解说梦幻西游H5游戏的架设教程,想钻研H5游戏如何实现,体验游戏中 ...

  8. 原神服务端搭建架设教程win系统(附客户端+服务端+环境配置)

    原神服务端搭建架设教程win系统(附客户端+服务端+环境配置) 大家好,我是艾西原神一款开放世界冒险3D游戏以七种元素(分别为风.雷.岩.火.水.草.冰)交汇的幻想世界"提瓦特"创 ...

  9. 传奇手游服务器搭建_复古传奇手游服务端架设教程

    浙江复古传奇手游服务端架设教程地处长三角中心位置,复古传奇手游服务端架设教程具有独特的地理和爆光柱的传奇手游商业优势,交通便利,复古传奇魔龙怎么去运输快捷. 在传奇私服游戏中,是进级兵器能力晋升游戏兴 ...

最新文章

  1. Elasticsearch 如何做到快速检索 - 倒排索引的秘密
  2. find、sed、awk、grep命令总结
  3. grpc使用记录(一) gRPC编译(mscv/gcc)
  4. 软件工程之“个人附加题”
  5. IDEA中安装Restfultookit插件实现根据 URL 直接跳转到对应的方法定义
  6. php basic publish,RabbitMQ入门(PHP语言描述)
  7. SQL Server执行计划那些事儿(3)——书签查找
  8. Hadoop入门基础教程 Hadoop之完全分布式环境搭建
  9. 从前世今生聊一聊,大厂为啥亲睐时序数据库
  10. 9年120亿,美的数字化转型纪实
  11. 用命令来操作vSphere:十一 PowerCLI命令--虚拟机操作
  12. 19年Q2了,运维的你有啥计划吗?
  13. zencart模板如何设计
  14. 做一个思考者系列之--编程这件事(手稿版)
  15. postman批量调用接口操作步骤
  16. android studio 3.4教程,android studio3.4安装指南图文教程
  17. 基于视觉导航机器人的快递分拣系统(开放源码附带论文和github仓库)
  18. Java JVM 动态方法调用之方法句柄 MethodHandle
  19. 单链表删除元素之狸猫换太子法
  20. 连续系统的动态规划问题

热门文章

  1. 域名、主机和网站之间的区别
  2. Could not find artifact ...:pom:0.0.1-SNAPSHOT
  3. Windows2012上如何查光纤卡HBA的WWN
  4. Nmap扫描工具的使用
  5. 用低代码赋能数字化 快速打造项目管理系统
  6. 【HiFlow】腾讯云HiFlow场景连接器实现校园信息管理智能化
  7. 苹果电脑Finder快捷键汇总
  8. 华为内部的项目管理之沟通流程
  9. 信号与线性系统翻转课堂笔记3
  10. JVAV——网络编程UDP/TCP