Atualização do linux, apertar y quando perguntar
sudo apt update && sudo apt upgrade
Instalação do git, nano e screen, apertar y quando perguntar
sudo apt install git nano screen
Abertura das portas 30120 e 30110 externamente
Abrir as portas externamente da instância, ir em attached VNICs -> subnet -> default security list -> add ingress rules. Em source colocar “0.0.0.0/0 em IP protocol “TCP” em destination port range “30120” e em descrição “Porta 30120 TCP” REPETIR O PROCESSO COM O IP PROTOCOL “UDP”
Repetir o procedimento acima com a porta 30110
Abrir as portas internamente
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 30120 -j ACCEPT
sudo iptables -I INPUT 6 -m state --state NEW -p udp --dport 30120 -j ACCEPT
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 30110 -j ACCEPT
sudo iptables -I INPUT 6 -m state --state NEW -p udp --dport 30110 -j ACCEPT
sudo netfilter-persistent save
Criar pasta e entrar nela
mkdir ~/fivem_server
cd ~/fivem_server
Site para pegar arquivos https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/
Com o link copiado usar o wget pra baixar o arquivo
sudo wget LINKCOPIADO
Descompactar o arquivo
tar -xvf fx.tar.xz
Deletar o arquivo
rm fx.tar.xz
Baixar arquivos do servidor
git clone https://github.com/citizenfx/cfx-server-data ~/fivem_resources
Alterando nome do servidor e adicionando licença do fivem
nano ~/fivem_resources/server.cfg
Código para colar dentro do server.cfg, para pegar a licença entrar no site https://keymaster.fivem.net/login?return_url=/
# 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"
# 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 "NOMEDOSERVIDOR"
# 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.steam:110000100000000 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
# License key for your server at keymaster.fivem.net
sv_licenseKey CHAVEGERADANOSITE
Para iniciar o servidor utilizar o comando
cd ~/fivem_resources && bash ~/fivem_server/run.sh +exec server.cfg
Para fechar o servidor usar o CTRL + C 2 vezes
Dúvidas deixem nos comentários