Skip to Content
ℹ️

Result: A fully functional, joinable FiveM server with QBCore framework running and database persistence enabled.

How to Create a 5M Server - Complete Tutorial

This comprehensive guide will walk you through how to create a 5M server (FiveM server) from scratch. By the end of this tutorial, you’ll have a working FiveM server that players can join, complete with a framework, database, and proper configuration.

Prerequisites

Before you start learning how to create a 5M server, ensure you have:

Estimated time: 30-45 minutes
Difficulty: Beginner

Step 1: System Preparation

The first step in learning how to create a 5M server is preparing your system with the necessary dependencies and firewall rules.

Step 2: Get Your License Key

A Cfx.re license key is required to create a 5M server. This is a critical step that many tutorials skip.

  1. Visit keymaster.fivem.net 
  2. Sign in with your Cfx.re account (create one if needed)
  3. Click “Create New Key”
  4. Copy the generated license key - you’ll need it in the next step
⚠️

Important: Keep your license key secure. Never commit it to version control or share it publicly.

Step 3: Download FiveM Server Artifacts

Now we’ll download the FiveM server files. This is the core of your 5M server.

Step 4: Set License Key

Before starting your 5M server, you must configure the license key. This is essential for server operation.

Step 5: Set Up Database

A database is required for frameworks like QBCore. Let’s set up MariaDB/MySQL.

Step 6: Run txAdmin Setup Wizard

Now we’ll start the FiveM server and complete the txAdmin setup. This is where your 5M server comes to life.

Step 7: Configure Basic server.cfg

After the wizard completes, you need to verify and configure your server.cfg file. This file controls your 5M server’s behavior.

Step 8: Verify Your 5M Server is Working

Now let’s verify that your server is fully functional and joinable.

Validation Checklist

  1. Server Console

  2. txAdmin Web Interface

  3. Database Connection

  4. Network Connectivity

    Test if server is listening on port 30120:

  5. Join Test

Step 9: (Optional) Set Up Systemd Service (Linux)

For production servers, set up a systemd service so your 5M server starts automatically on boot.

Troubleshooting Common Issues

When learning how to create a 5M server, you may encounter these issues:

License Key Errors

Problem: Server shows “Invalid license key” or “License key required”

Solution:

Database Connection Errors

Problem: Framework fails to connect to database

Solution:

Port Already in Use

Problem: “Port 30120 already in use”

Solution:

Can’t Join Server

Problem: Server shows online but can’t connect

Solution:

Resources Not Loading

Problem: Resources fail to start or show errors

Solution:

Next Steps

Congratulations! You’ve successfully learned how to create a 5M server. Now explore these topics:

Summary

This tutorial covered the complete process of how to create a 5M server:

  1. ✅ System preparation (dependencies, firewall)
  2. ✅ License key acquisition and configuration
  3. ✅ FiveM server download and extraction
  4. ✅ Database setup (MariaDB/MySQL)
  5. ✅ txAdmin setup wizard completion
  6. ✅ Basic server.cfg configuration
  7. ✅ Server validation and testing
  8. ✅ Optional systemd service setup

Your FiveM server is now ready for players to join!