fivemHow to Set Up a FiveM Localhost Development Server with Git [2026 Guide]
Why Every Server Developer Needs a Localhost Server
Never test new scripts, cars, or database migrations directly on a live production server.
Testing unverified code on a live server risks:
- Corrupting real player inventory databases
- Causing unexpected server thread crashes that disconnect 100+ active players
- Accidentally exposing half-finished developer commands or exploit loopholes to players
- Prolonging maintenance downtime and frustrating your community
A Localhost Development Server runs completely on your personal Windows PC. It provides a private, zero-latency sandbox where you can break things, debug errors, test scripts, and benchmark performance in complete privacy—without spending a penny on extra hosting.
Production vs. Localhost Development Workflow
┌─────────────────────────────────────────────────────────────┐
│ PROFESSIONAL DEVOPS PIPELINE │
├─────────────────────────────────────────────────────────────┤
│ 1. DEVELOP & TEST (Localhost PC) │
│ • Code scripts in VS Code │
│ • Test in-game on 127.0.0.1 │
│ • Debug with live console & F8 Resmon │
│ │
│ 2. VERSION CONTROL (Git & GitHub) │
│ • Commit clean code to 'dev' branch │
│ • Merge into 'main' branch once verified │
│ │
│ 3. DEPLOY TO PRODUCTION (Live VPS / Dedicated Host) │
│ • Pull latest Git commits onto live server │
│ • Zero downtime, zero broken databases │
└─────────────────────────────────────────────────────────────┘Prerequisites Before Starting
| Requirement | Details |
|---|---|
| Operating System | Windows 10 or Windows 11 (64-bit) |
| Database Server | MariaDB 10.11+ (recommended) or XAMPP |
| Database Client | HeidiSQL (comes bundled with MariaDB) |
| Cfx.re Keymaster | A free developer license key from keymaster.fivem.net |
| Code Editor | Visual Studio Code with the FiveM Lua extension |
| Git for Windows | Optional but highly recommended for version control |
Did you know? Resources on FiveVault are built to follow standard FiveM directory conventions, making them 100% plug-and-play on both localhost test environments and live VPS hosts. Browse verified resources on FiveVault →
Step 1: Install Local MariaDB & HeidiSQL
- Download the MariaDB 10.11 LTS (x64) installer from the official MariaDB website.
- Run the installer, accept the defaults, and set a simple local root password (e.g.,
rootorpassword123).
> Note: Because this is a private localhost environment not accessible from the internet, a simple password is fine for testing.
- Keep HeidiSQL checked during installation.
- Launch HeidiSQL, connect to
127.0.0.1as userroot, right-click in the left pane, and click Create new > Database. Name itfivem_dev.
Step 2: Download FXServer Artifacts & Launch txAdmin
- Create a dedicated folder on your main drive, such as
C:\FiveM_Dev\. - Inside it, create two separate subfolders:
C:\FiveM_Dev\
├── artifacts\
└── server-data\
- Visit the FiveM Windows Server Artifacts Hub.
- Download the latest Recommended build (
server.7z). - Extract all files from
server.7zinto yourC:\FiveM_Dev\artifacts\folder. - Double-click
FXServer.exeinside yourartifacts/folder. - A command window will open, and your web browser will automatically launch the txAdmin Setup Wizard (
http://127.0.0.1:40120).
Step 3: Run the txAdmin Setup Wizard
- In your browser, txAdmin will ask for a 4-digit PIN displayed in the server console window. Enter it and click Link Account to log in with your Cfx.re forum account.
- Choose a master password for your local txAdmin panel.
- Click Next on the Welcome screen.
- Set Server Name: Dev Sandbox.
- Select Deployment Type:
- Choose Popular Recipes > Qbox, QBCore, or CFX Default (Standalone).
- Target Data Directory: Confirm it points to
C:\FiveM_Dev\server-data. - Configure Database:
- Host: 127.0.0.1
- User: root
- Password: Your MariaDB password
- Database Name: fivem_dev
- License Key:
- Go to Cfx.re Keymaster.
- Generate a new key: Label it "Localhost Dev", set Server IP to 127.0.0.1, and select Server Type: Home hosted.
- Paste the key into txAdmin and click Run Recipe.
txAdmin will automatically clone the framework, run database migrations, and configure your local server.cfg in under 60 seconds!
Step 4: Connecting to Your Localhost Server
- Once the txAdmin recipe finishes, click Save & Start Server.
- Launch your regular FiveM game client on your PC.
- Press F8 to open the client console.
- Type:
connect 127.0.0.1:30120
# Or simply:
connect localhost
- Press Enter. You will instantly connect into your local test world!
[!TIP]
You do not need to open firewall ports or configure port forwarding on your home router to connect to localhost. Localhost traffic stays 100% inside your personal computer.
Step 5: Setting Up Git for FiveM Version Control
Using Git on your localhost server allows you to roll back broken code instantly and collaborate with other developers.
- Open a terminal or PowerShell inside
C:\FiveM_Dev\server-data\resources\. - Initialize a Git repository:
git init
- Create a
.gitignorefile. This prevents temporary files, caches, and database credentials from being tracked.
The Ultimate FiveM .gitignore:
# Server Caches
cache/
.cache/
*.log
# txAdmin Data & Database Credentials
txData/
credentials.cfg
mysql.cfg
# OS & Editor Artifacts
.DS_Store
Thumbs.db
.vscode/
.idea/
# Large Vehicle / Map Binaries (Store separately if needed)
*.rpf
*.7z
*.zip- Stage and commit your clean files:
git add .
git commit -m "feat: initial local development framework setup"
Now, whenever you add a new script or edit a configuration, you can test it safely. If it breaks, simply run git checkout . to instantly revert your code to a clean, working state!
Step 6: Essential Developer Commands & In-Game Tools
Speed up your testing workflow using built-in developer tools:
┌─────────────────────────────────────────────────────────────┐
│ ESSENTIAL DEVELOPER COMMANDS │
├──────────────────────────┬──────────────────────────────────┤
│ restart [resource] │ Live reloads a script in txAdmin │
│ │ console without kicking players │
├──────────────────────────┼──────────────────────────────────┤
│ resmon 1 │ Run in F8 to open the live client│
│ │ CPU/Tick rate resource monitor │
├──────────────────────────┼──────────────────────────────────┤
│ neteventlog │ Run in F8 to log all incoming │
│ │ network events in real time │
└──────────────────────────┴──────────────────────────────────┘Troubleshooting Common Localhost Issues
❌ "Failed to handshake with server at 127.0.0.1:30120"
Cause: FXServer is not running, or your Windows Firewall is blocking the local loopback connection. Solution: Verify that the server status in txAdmin is green (Running). In Windows Defender Firewall, allowFXServer.exe through private networks.
❌ "Keymaster key verification failed" on server boot
Cause: You entered an invalid license key, or your computer's system clock is out of sync. Solution: Ensure your Windows time is synchronized with the internet (Settings > Time & Language > Sync Now). Verify that the key in server.cfg matches your Cfx.re Keymaster dashboard.
❌ [oxmysql] [ERROR] Access denied for user 'root'@'localhost'
Cause: Incorrect database credentials in your server.cfg mysql_connection_string.
Solution: Open HeidiSQL and verify that you can connect with the username and password listed in your server.cfg.
Recommended Server Tools & Verified Resources
| Resource | Purpose | Benefit |
|---|---|---|
| MariaDB 10.11+ | Local Database | Fast, modern SQL engine matching production server environments |
| HeidiSQL | Database Management | Instant visual inspection and editing of local player tables |
| Visual Studio Code | IDE | Industry-standard editor with Lua syntax highlighting and Git integration |
| FiveVault Verified Scripts | Script Marketplace | Clean, verified code ready for rapid localhost testing |
| txAdmin | Server Automation | Built-in web panel for one-click restarts, logs, and recipe deployments |
Final Best Practices for Local Development
- ✅ Keep
artifactsandserver-datain separate folders for painless 30-second binary updates. - ✅ Never hardcode production API keys or Discord webhooks in your local test environment.
- ✅ Use Git branches (
git checkout -b feature/new-job) to keep experimental code isolated. - ✅ Test with
resmon 1to verify that newly created scripts idle at0.00msbefore deploying. - ✅ Backup your local SQL database before testing major schema alterations.
Frequently Asked Questions
Q: Can my friends join my localhost server from their homes?A: By default, no, because 127.0.0.1 is a local loopback address only reachable from your own computer. If you want friends to test with you, you must either forward port 30120 UDP/TCP on your home router or use a virtual LAN tool like ZeroTier or Radmin VPN.
A: FXServer itself requires very little hardware (less than 1GB RAM and 5% CPU). However, because you are running both the FiveM game client and the server simultaneously on one PC, 16GB of system RAM and a modern quad-core CPU are recommended.
Q: Can I copy my entire localhost server to a live Linux VPS later?A: Yes! You can simply transfer your resources folder, your server.cfg, and export your MariaDB database via HeidiSQL. On your Linux VPS, install Linux FXServer artifacts, import the database, and start the server.
Need help securing your FiveM server or auditing your resources? Join our Discord — 17,000+ members and counting.