How to Host a FiveM Server

A FiveM server is three things that have to agree with each other: the server artifacts, a MySQL database, and txAdmin sitting on top of both. This guide walks the build in the order that avoids the usual dead ends, and is honest about which parts stay your problem afterwards.

The build, in the order that works

1. A machine that can actually hold a cityFiveM is single-threaded where it matters, so clock speed beats core count. Budget roughly 6GB RAM for a 32-slot server before resources, and more for heavy MLOs and scripts. Linux is the usual choice; the artifacts are published for both.
2. MySQL first, framework secondqbcore, qbox and ESX all expect a working MySQL/MariaDB with a user, a schema and their SQL dump imported. Doing this before you install the framework saves a long evening: almost every "framework will not start" report is a database that was not ready.
3. Artifacts, txAdmin and a cfx.re keyDownload the current server artifacts, start them once to bring up txAdmin, then paste the cfxk_ key generated for your own account in the cfx.re portal. txAdmin takes over from there: recipes, resources, restarts and console.
4. Ports, and the ones people forget30120 TCP and UDP for the game itself, and txAdmin on its own port (40120 by default) which should never be open to the world without a password. Forgetting the UDP half is the classic cause of a server that lists but never connects.

Why the database comes first

Nothing in a roleplay server is stateless. Characters, vehicles, inventories, jobs and property all live in MySQL, which means the database is not a component of your server so much as the thing your server is made of. Install a framework before the database is ready and you get a server that starts, throws connection errors, and leaves your players with characters that vanish on reconnect.

It is also the part that punishes single-machine hosting hardest. A crashed VPS with no dump from last night is not an outage, it is a wipe. A wipe is the one thing a roleplay community does not forgive. Whatever you host on, decide your backup schedule before you open applications.

Mistakes that cost whole weekends

  • Opening txAdmin to the internet with the default setup, which hands over full server control
  • Skipping the SQL import, then blaming the framework for not starting
  • Running the database on the same disk with no backup and no dump schedule
  • Never updating artifacts, then hitting a client update that breaks the server
  • Letting resources grow unchecked until a restart takes four minutes

What self-hosting really costs

The VPS is the cheap part. The real cost is the hours: artifact updates after every client patch, a database you now administer, txAdmin exposed safely, restart schedules, and a resource list that grows until something starts timing out at peak. None of it is hard. All of it is recurring, and it arrives at the worst times. For a roleplay server that means Friday evening.

Or skip the build entirely

The same server, with txAdmin and a MySQL database synced across three independent nodes, deployed for you on the Flux decentralized cloud from $9.91/month. You still hold the cfx.re key, the resources and the data.

Frequently asked questions

What are the hardware requirements for a FiveM server?

Clock speed matters more than core count, because the FiveM server is single-threaded where it counts. As a rough guide, 6GB RAM and 2 fast cores suit a 32-slot server, 8GB and 4 cores a 48-slot one, and 12GB a busy 64-slot city. Resources, MLOs and scripts add to this quickly, so treat the base figures as a floor rather than a target.

Do I need MySQL to run a FiveM server?

For any roleplay framework, yes. qbcore, qbox and ESX all store characters, inventories, vehicles and jobs in MySQL or MariaDB, and none will start correctly until the database exists, a user has been granted access and the framework’s SQL dump has been imported. A vanilla server with no framework can run without one, but that is not what most people mean by a FiveM server.

What is txAdmin and do I have to use it?

txAdmin is the web control panel bundled with the FiveM server artifacts: recipes, resource management, console access, scheduled restarts and player administration. It is not mandatory, but it is how nearly everyone runs a server, and it is the piece that turns a bare artifact install into something you can administer without SSH.

Which ports does a FiveM server need?

Port 30120 on both TCP and UDP for the game, and a separate port for txAdmin (40120 by default). Opening only TCP is the most common misconfiguration. The server appears in the list, but players cannot connect. txAdmin should never be exposed publicly without a strong password, as it grants full control of the server.

Is self-hosting FiveM cheaper than managed hosting?

On the invoice, usually. In total, it depends what your evenings are worth. A VPS capable of a 48-slot city is not far off the price of a managed plan, and the difference buys you artifact updates, database administration, backups and being the one who fixes it when it breaks mid-session.