Setting up a fivem server on a linux vps from scratch
Got an Ubuntu VPS and want a small roleplay server for friends. The guides I've found skip steps or point to old builds. What's the order to get the server artifacts running and keep it online after I close SSH?
The rough order that works:
1. Make a non-root user and a folder for the server.
2. Download the latest Linux server build (the fx.tar.xz) from the cfx artifacts page and extract it into that folder.
3. Clone the cfx-server-data repo next to it, that gives you the base resources.
4. Get a license key from the Cfx.re portal (log in with your forum account) and put it in server.cfg as sv_licenseKey.
5. Open port 30120 for both TCP and UDP in your firewall and in the VPS provider's panel if they have one.
6. Start it with run.sh and +exec server.cfg.
Run it inside screen or tmux, otherwise it dies the moment you close SSH. The thing that catches most people is step 5: opening TCP only. The server starts fine, then nobody can connect and the logs don't tell you why.
If you'd rather have a web panel, the first launch without a config will offer txAdmin on port 40120, which handles the recipe setup for you.