How to Host a FiveM Server on a Windows VPS
What is FiveM?
FiveM is a modification framework for GTA V that allows you to:
- Create custom multiplayer servers
- Add custom maps, vehicles, and weapons
- Install roleplay frameworks (ESX, QBCore, etc.)
- Host private or public servers
- Run custom game modes and scripts
- Build gaming communities
Prerequisites
What You'll Need
1. Windows VPS:
- Operating System: Windows Server 2019, 2022, or 2025
- RAM: Minimum 4 GB (8 GB+ recommended for larger servers)
- CPU: Minimum 2 vCPUs (4+ recommended)
- Storage: 20 GB+ available space (server files are duplicated for cache)
- Bandwidth: Unlimited or high bandwidth for player connections
2. Software Requirements:
- Visual C++ Redistributable (latest version)
- 7-Zip (for extracting server files)
- Web browser (Chrome, Firefox, Edge)
3. FiveM Requirements:
- Valid GTA V copy (for testing, not required on server)
- CFX.re account (free to create)
- FiveM license key (free to generate)
4. Optional but Recommended:
- MySQL database (for most resources/frameworks)
- HeidiSQL or phpMyAdmin (database management)
- FileZilla or WinSCP (FTP client for file transfers)
- Visual Studio Code (code editor)
Step 1: Connect to Your Windows VPS
Using Remote Desktop Connection
On Windows:
- Press Windows Key + R
- Type mstsc and press Enter
- Or search for Remote Desktop Connection
Enter Connection Details:
- Computer: Your VPS IP address (e.g., 123.45.67.89)
- Username: Usually
Administrator - Password: Your VPS password (sent by hosting provider)
Connect:
- Click Connect
- Accept security certificate if prompted
- Enter credentials if asked again
- You're now connected to your VPS desktop
On Mac:
- Download Microsoft Remote Desktop from App Store
- Add new connection with VPS IP and credentials
On Linux:
- Use Remmina or xfreerdp
Step 2: Install Required Software
Install Visual C++ Redistributable
FiveM requires Visual C++ to run.
- Open a web browser on the VPS
- Go to: https://aka.ms/vs/17/release/vc_redist.x64.exe
- Download and run the installer
- Click Install
- Restart VPS if prompted
Alternative: Download from Microsoft's official page and search for "Visual C++ Redistributable"
Install 7-Zip (for extracting files)
- Go to: https://www.7-zip.org
- Download 64-bit Windows x64 version
- Install with default settings
Optional: Install MySQL (for databases)
Many FiveM resources require a database:
Option 1: XAMPP (Easiest)
- Download from: https://www.apachefriends.org
- Install with MySQL and Apache
- Start MySQL from XAMPP Control Panel
Option 2: Standalone MySQL
- Download MySQL Server from: https://dev.mysql.com/downloads/mysql/
- Follow installation wizard
- Set root password
Step 3: Download FiveM Server Files
Get Latest Server Artifacts
- On the VPS, open a web browser
- Go to: https://runtime.fivem.net/artifacts/fivem/build_server_windows/master/
- Download the Latest Recommended build
- Or download the latest version from the list
File downloaded: A .zip file (e.g., server.zip)
Create Server Directory
- Open File Explorer (Windows Key + E)
- Go to This PC → C:
- Create new folder: C:\FXServer
- Right-click the folder → Properties → Make sure it's not Read-only
Extract Server Files
- Right-click the downloaded
.zipfile - Select 7-Zip → Extract to "server" (or similar)
- Move all extracted files to C:\FXServer
- You should see files like
FXServer.exe,run.cmd, etc.
Step 4: Generate FiveM License Key
Every FiveM server needs a free license key.
Create CFX.re Account
- Go to: https://keymaster.fivem.net
- Click Login or Register
- Sign in with your preferred method (Steam, Discord, etc.)
- Complete registration
Generate License Key
- Once logged in to Keymaster
- Scroll down to Create a New Server Key
- Fill in the form:
- Label/Name: Your server name (e.g., "My FiveM Server")
- Server IP Address: Your VPS IP address
- Server Type: Select VPS
- Click Generate
- Copy your license key - looks like:
cfxk_xxxxx... - Save it in a text file for later use
Important: Keep this key private and don't share it publicly.
Step 5: Configure Windows Firewall
Allow FiveM server ports through the Windows Firewall.
Method 1: Using PowerShell (Recommended)
Open PowerShell as Administrator:
- Click Start menu
- Search for PowerShell
- Right-click Windows PowerShell
- Select Run as Administrator
Add Firewall Rules:
Copy and paste these commands one by one:
New-NetFirewallRule -DisplayName "FiveM Server" -Direction Inbound -LocalPort 30120 -Protocol TCP -Action Allow
New-NetFirewallRule -DisplayName "FiveM Server" -Direction Inbound -LocalPort 30120 -Protocol UDP -Action Allow
New-NetFirewallRule -DisplayName "FiveM Server" -Direction Outbound -LocalPort 30120 -Protocol TCP -Action Allow
New-NetFirewallRule -DisplayName "FiveM Server" -Direction Outbound -LocalPort 30120 -Protocol UDP -Action Allow
New-NetFirewallRule -DisplayName "txAdmin" -Direction Inbound -LocalPort 40120 -Protocol TCP -Action Allow
New-NetFirewallRule -DisplayName "txAdmin" -Direction Outbound -LocalPort 40120 -Protocol TCP -Action Allow
What these do:
- Port 30120: Main FiveM server port (TCP and UDP)
- Port 40120: txAdmin web interface (TCP)
Method 2: Using Windows Defender Firewall (Manual)
- Open Windows Defender Firewall with Advanced Security
- Click Inbound Rules → New Rule
- Select Port → Next
- Choose TCP and Specific local ports: 30120
- Select Allow the connection
- Apply to all profiles (Domain, Private, Public)
- Name: "FiveM Server TCP"
- Repeat for UDP on port 30120
- Repeat for Outbound Rules
- Repeat for port 40120 (TCP only) for txAdmin
Step 6: Start FiveM Server (First Time)
Launch Server
- Navigate to C:\FXServer
- Double-click FXServer.exe
What happens:
- A command prompt window opens
- Server starts initializing
- After a few seconds, you'll see a PIN code displayed
- Example:
PIN: 1234 - Server also displays txAdmin URL
Access txAdmin
On the VPS:
- Browser automatically opens to
http://localhost:40120
From your PC:
- Open browser and go to:
http://YOUR_VPS_IP:40120 - Example:
http://123.45.67.89:40120
Enter the PIN:
- Enter the PIN shown in the server console
- Click Link Account
Step 7: Configure txAdmin
txAdmin is the web-based control panel for managing your FiveM server.
Link Your CFX.re Account
- Click Link Account
- Sign in to CFX.re if not already signed in
- Click Authorize to link txAdmin with your account
Create Master Account
- Discord ID (Optional): Enter your Discord ID for in-game admin panel
- Backup Password: Create a strong password
- Confirm Password: Re-enter password
- Read and accept Creator PLA and txAdmin License
- Click Register
Important: Save this password - you'll need it to access txAdmin later.
Server Setup Wizard
Step 1: Server Name
- Enter your Server Name
- This is the name displayed in the FiveM server list
- Example: "My Awesome Roleplay Server"
- Click Next
Step 2: Deployment Type
Choose how to set up your server:
Option 1: Popular Recipes (Recommended for Beginners)
- Pre-configured server templates
- Includes popular frameworks
- Quick setup
Option 2: Custom Template
- Use a custom template from URL
- For advanced users
Option 3: Existing Server Data
- Import from existing server
- If you have existing server files
Select: Popular Recipes → Click Next
Step 3: Select Recipe
Choose a server template:
CFX Default FiveM:
- Basic FiveM server
- No frameworks
- Good for vanilla or custom setup
ESX Legacy:
- Popular roleplay framework
- Economy, jobs, vehicles
- Many resources available
QBCore Framework:
- Modern roleplay framework
- Alternative to ESX
- Active development
Select your preferred recipe → Click Next
Step 4: Server Data Path
- Default path is auto-filled:
C:\FXServer\txData - Usually no need to change this
- Click Next or Save
Step 5: Go to Recipe Deployer
- Click Go to Recipe Deployer
Deploy Your Server
Enter License Key
- License Key: Paste your FiveM license key from earlier
- Server Name: Confirm or edit server name
- Click Next
Database Configuration (If Required)
If using ESX or QBCore:
- Click Show/Hide Database Options
- Enter database details:
- Host:
localhostor127.0.0.1 - Port:
3306 - Username:
root - Password: Your MySQL root password
- Database Name: Will be created automatically
- Host:
- Leave other settings as default
Run Recipe
- Review all settings
- Click Run Recipe
- Wait for deployment (2-10 minutes)
- Progress shown in console
What happens:
- Server files downloaded
- Resources installed
- Database created (if applicable)
- Configuration files generated
Configure server.cfg
After deployment:
- Review basic server settings
- Set server name, player slots, etc.
- Click Save & Run Server
Step 8: Server is Running!
Access Your Server
From txAdmin:
- Dashboard shows server status
- Green = Running
- Click Live Console to see server logs
In-game:
- Launch FiveM on your PC
- Press F8 to open console
- Type:
connect YOUR_VPS_IP:30120 - Example:
connect 123.45.67.89:30120 - Press Enter
Or find in server list:
- Search for your server name in FiveM server browser
Manage Your Server
txAdmin URL:
- Access from anywhere:
http://YOUR_VPS_IP:40120 - Login with your backup password
Main Features:
- Dashboard: Server overview and status
- Live Console: View server logs and execute commands
- Resources: Manage installed resources
- Server Log: View detailed logs
- CFG Editor: Edit server.cfg file
- Admins: Manage admin permissions
- Settings: Server settings and configuration
- System Log: txAdmin logs
Step 9: Customize Your Server
Edit server.cfg
Located in: C:\FXServer\txData\CFXDefault_XXXXX\server.cfg
Important settings:
# Server name
sv_hostname "My FiveM Server"
# Max players
sv_maxclients 32
# License key
sv_licenseKey "YOUR_LICENSE_KEY_HERE"
# Server tags
tags "roleplay, esx, english"
# Enable OneSync (for more players)
onesync on
# Server description
sets sv_projectName "My Roleplay Server"
sets sv_projectDesc "Welcome to my server!"
# Discord invite
sets Discord "https://discord.gg/yourcode"
Save changes and restart server from txAdmin
Add Resources
Resources are scripts/mods for your server.
Where to find resources:
- https://forum.cfx.re/
- https://github.com (search "fivem")
- Community Discord servers
How to install:
- Download resource files (usually a folder)
- Place folder in:
C:\FXServer\txData\CFXDefault_XXXXX\resources\ - Edit
server.cfg - Add line:
ensure resource_name - Restart server
Example:
ensure my_custom_car
ensure police_job
ensure hospital_script
Database Management
Access database:
- Use HeidiSQL, phpMyAdmin, or MySQL Workbench
- Connect to
localhost:3306 - Username:
root - Password: Your MySQL password
View tables:
- Your FiveM database contains player data, inventory, vehicles, etc.
- Be careful when editing - always backup first!
Step 10: Manage Players and Admins
Add Administrators
Via txAdmin:
- Go to txAdmin → Admins
- Click Add Admin
- Enter:
- Name: Admin name
- Identifier: Player identifier (steam:, discord:, license:)
- Permission Level: Master, Admin, Moderator, etc.
- Click Save
How to get player identifier:
- Player joins server
- Check Live Console
- See message: "Player connecting: identifier"
- Copy identifier
Kick/Ban Players
Via txAdmin Live Console:
- Click player name
- Options: Kick, Ban, Warn, DM
- Enter reason and duration
In-game (if admin):
- Press T to open chat
- Type:
/txto open admin menu - Manage players from menu
Troubleshooting
Server Won't Start
Check console for errors:
- Missing license key: Add key to server.cfg
- Port already in use: Make sure no other FiveM server is running
- Missing resources: Check resource paths
Can't Connect to Server
Solutions:
- Verify firewall rules are correct
- Check server is running in txAdmin
- Try direct connect:
connect IP:30120 - Ensure your hosting provider allows game servers
- Check VPS firewall/security groups
Players Can't Join
Common causes:
- Firewall blocking connections
- Wrong port forwarding
- Server at max capacity
- OneSync not configured properly
Solutions:
- Verify firewall ports (30120 TCP/UDP)
- Increase
sv_maxclientsin server.cfg - Enable OneSync for more players
High CPU/RAM Usage
Optimization tips:
- Remove unused resources
- Use optimized scripts
- Limit max players
- Upgrade VPS resources
Database Connection Failed
Solutions:
- Start MySQL/XAMPP
- Check database credentials
- Verify database exists
- Check port 3306 is open
Best Practices
Security
- Change default passwords
- MySQL root password
- txAdmin backup password
- Keep license key private
- Regular backups of server data and database
- Update server artifacts regularly
- Vet resources before installing (check for malware)
Performance
- Optimize resources - Remove unused ones
- Use recommended server build - Not always latest
- Monitor server stats - CPU, RAM, network
- Restart server regularly - Clears memory leaks
- Use SSD storage - Faster loading
Management
- Set up automated backups
- Keep server.cfg organized
- Document custom changes
- Test resources on local server first
- Monitor server logs for errors
Advanced Configuration
OneSync Configuration
For servers with more than 32 players:
# In server.cfg
onesync on
sv_maxclients 64
Custom Loading Screen
- Create HTML loading screen
- Place in:
C:\FXServer\txData\CFXDefault_XXXXX\resources\[local]\loading-screen\ - Add to server.cfg:
load_server_icon myLogo.png
Discord Integration
- Create Discord bot
- Get bot token
- Add to server.cfg:
set discord_token "YOUR_BOT_TOKEN"
Summary
To host a FiveM server on Windows VPS:
- Connect to VPS via Remote Desktop
- Install prerequisites - Visual C++, 7-Zip
- Download FiveM server artifacts
- Generate license key from CFX.re
- Configure firewall - Open ports 30120, 40120
- Start server - Run FXServer.exe
- Setup txAdmin - Link account, choose recipe
- Deploy server - Enter license, configure settings
- Customize - Add resources, edit server.cfg
- Manage - Use txAdmin for administration
Your FiveM server is now online and ready for players!
Quick Reference
Important Directories
- Server Root:
C:\FXServer\ - Server Data:
C:\FXServer\txData\CFXDefault_XXXXX\ - Resources:
C:\FXServer\txData\CFXDefault_XXXXX\resources\ - Config:
C:\FXServer\txData\CFXDefault_XXXXX\server.cfg
Important URLs
- txAdmin:
http://YOUR_VPS_IP:40120 - Connect:
connect YOUR_VPS_IP:30120 - Artifacts: https://runtime.fivem.net/artifacts/fivem/build_server_windows/master/
- Keymaster: https://keymaster.fivem.net
- Forums: https://forum.cfx.re/
Default Ports
- FiveM Server: 30120 (TCP/UDP)
- txAdmin: 40120 (TCP)
- MySQL: 3306 (TCP)
Your FiveM server is ready to create amazing multiplayer experiences!


















