Logo

How to Host a FiveM Server on a Windows VPS

 How to Host a FiveM Server on a Windows VPS

This comprehensive guide explains how to install, configure, and host your own FiveM server on a Windows VPS. FiveM is a popular modification for Grand Theft Auto V that enables custom multiplayer servers with unique game modes, mods, and roleplay experiences.

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:

  1. Press Windows Key + R
  2. Type mstsc and press Enter
  3. 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:

  1. Click Connect
  2. Accept security certificate if prompted
  3. Enter credentials if asked again
  4. 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.

  1. Open a web browser on the VPS
  2. Go to: https://aka.ms/vs/17/release/vc_redist.x64.exe
  3. Download and run the installer
  4. Click Install
  5. Restart VPS if prompted

Alternative: Download from Microsoft's official page and search for "Visual C++ Redistributable"

Install 7-Zip (for extracting files)

  1. Go to: https://www.7-zip.org
  2. Download 64-bit Windows x64 version
  3. Install with default settings

Optional: Install MySQL (for databases)

Many FiveM resources require a database:

Option 1: XAMPP (Easiest)

  1. Download from: https://www.apachefriends.org
  2. Install with MySQL and Apache
  3. Start MySQL from XAMPP Control Panel

Option 2: Standalone MySQL

  1. Download MySQL Server from: https://dev.mysql.com/downloads/mysql/
  2. Follow installation wizard
  3. Set root password

Step 3: Download FiveM Server Files

Get Latest Server Artifacts

  1. On the VPS, open a web browser
  2. Go to: https://runtime.fivem.net/artifacts/fivem/build_server_windows/master/
  3. Download the Latest Recommended build
  4. Or download the latest version from the list

File downloaded: A .zip file (e.g., server.zip)

Create Server Directory

  1. Open File Explorer (Windows Key + E)
  2. Go to This PCC:
  3. Create new folder: C:\FXServer
  4. Right-click the folder → Properties → Make sure it's not Read-only

Extract Server Files

  1. Right-click the downloaded .zip file
  2. Select 7-ZipExtract to "server" (or similar)
  3. Move all extracted files to C:\FXServer
  4. 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

  1. Go to: https://keymaster.fivem.net
  2. Click Login or Register
  3. Sign in with your preferred method (Steam, Discord, etc.)
  4. Complete registration

Generate License Key

  1. Once logged in to Keymaster
  2. Scroll down to Create a New Server Key
  3. 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
  4. Click Generate
  5. Copy your license key - looks like: cfxk_xxxxx...
  6. 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.

Open PowerShell as Administrator:

  1. Click Start menu
  2. Search for PowerShell
  3. Right-click Windows PowerShell
  4. 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)

  1. Open Windows Defender Firewall with Advanced Security
  2. Click Inbound RulesNew Rule
  3. Select Port → Next
  4. Choose TCP and Specific local ports: 30120
  5. Select Allow the connection
  6. Apply to all profiles (Domain, Private, Public)
  7. Name: "FiveM Server TCP"
  8. Repeat for UDP on port 30120
  9. Repeat for Outbound Rules
  10. Repeat for port 40120 (TCP only) for txAdmin

Step 6: Start FiveM Server (First Time)

Launch Server

  1. Navigate to C:\FXServer
  2. 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.

  1. Click Link Account
  2. Sign in to CFX.re if not already signed in
  3. Click Authorize to link txAdmin with your account

Create Master Account

  1. Discord ID (Optional): Enter your Discord ID for in-game admin panel
  2. Backup Password: Create a strong password
  3. Confirm Password: Re-enter password
  4. Read and accept Creator PLA and txAdmin License
  5. Click Register

Important: Save this password - you'll need it to access txAdmin later.

Server Setup Wizard

Step 1: Server Name

  1. Enter your Server Name
  2. This is the name displayed in the FiveM server list
  3. Example: "My Awesome Roleplay Server"
  4. 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

  1. License Key: Paste your FiveM license key from earlier
  2. Server Name: Confirm or edit server name
  3. Click Next

Database Configuration (If Required)

If using ESX or QBCore:

  1. Click Show/Hide Database Options
  2. Enter database details:
    • Host: localhost or 127.0.0.1
    • Port: 3306
    • Username: root
    • Password: Your MySQL root password
    • Database Name: Will be created automatically
  3. Leave other settings as default

Run Recipe

  1. Review all settings
  2. Click Run Recipe
  3. Wait for deployment (2-10 minutes)
  4. Progress shown in console

What happens:

  • Server files downloaded
  • Resources installed
  • Database created (if applicable)
  • Configuration files generated

Configure server.cfg

After deployment:

  1. Review basic server settings
  2. Set server name, player slots, etc.
  3. 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:

  1. Launch FiveM on your PC
  2. Press F8 to open console
  3. Type: connect YOUR_VPS_IP:30120
  4. Example: connect 123.45.67.89:30120
  5. 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:

How to install:

  1. Download resource files (usually a folder)
  2. Place folder in: C:\FXServer\txData\CFXDefault_XXXXX\resources\
  3. Edit server.cfg
  4. Add line: ensure resource_name
  5. 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:

  1. Go to txAdmin → Admins
  2. Click Add Admin
  3. Enter:
    • Name: Admin name
    • Identifier: Player identifier (steam:, discord:, license:)
    • Permission Level: Master, Admin, Moderator, etc.
  4. 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: /tx to 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:

  1. Verify firewall rules are correct
  2. Check server is running in txAdmin
  3. Try direct connect: connect IP:30120
  4. Ensure your hosting provider allows game servers
  5. 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_maxclients in 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

  1. Change default passwords
    • MySQL root password
    • txAdmin backup password
  2. Keep license key private
  3. Regular backups of server data and database
  4. Update server artifacts regularly
  5. Vet resources before installing (check for malware)

Performance

  1. Optimize resources - Remove unused ones
  2. Use recommended server build - Not always latest
  3. Monitor server stats - CPU, RAM, network
  4. Restart server regularly - Clears memory leaks
  5. Use SSD storage - Faster loading

Management

  1. Set up automated backups
  2. Keep server.cfg organized
  3. Document custom changes
  4. Test resources on local server first
  5. 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

  1. Create HTML loading screen
  2. Place in: C:\FXServer\txData\CFXDefault_XXXXX\resources\[local]\loading-screen\
  3. Add to server.cfg:
load_server_icon myLogo.png

Discord Integration

  1. Create Discord bot
  2. Get bot token
  3. Add to server.cfg:
set discord_token "YOUR_BOT_TOKEN"

Summary

To host a FiveM server on Windows VPS:

  1. Connect to VPS via Remote Desktop
  2. Install prerequisites - Visual C++, 7-Zip
  3. Download FiveM server artifacts
  4. Generate license key from CFX.re
  5. Configure firewall - Open ports 30120, 40120
  6. Start server - Run FXServer.exe
  7. Setup txAdmin - Link account, choose recipe
  8. Deploy server - Enter license, configure settings
  9. Customize - Add resources, edit server.cfg
  10. 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

Default Ports

  • FiveM Server: 30120 (TCP/UDP)
  • txAdmin: 40120 (TCP)
  • MySQL: 3306 (TCP)

Your FiveM server is ready to create amazing multiplayer experiences!

Join our Discord community server

For any questions, suggestions, or just to chat with the community, join us on Discord!

900+Members