Setup & Installation
Complete guide to setting up and installing ESX framework.
This guide covers the complete installation and initial setup of ESX framework for your FiveM server.
Prerequisites
Before installing ESX, ensure you have:
- FiveM Server: A properly configured FiveM server
- MySQL Database: MySQL 8.0+ or MariaDB 10.6+
- Git: For cloning repositories
- Basic Command Line Knowledge: Comfort with terminal commands
Installation Methods
Method 1: ESX Legacy (Recommended)
ESX Legacy is the modern, updated version of ESX with improved performance and security.
1. Database Setup
Create a new MySQL database:
2. Server Structure
Create the proper directory structure:
3. Core Framework Installation
4. Database Dependencies
Install required database resources:
5. Database Import
Import ESX database structure:
Method 2: ESX Template (Alternative)
For a quicker start, use the ESX server template:
Configuration
1. Database Connection
Configure your database connection in es_extended/config.lua
:
2. Server.cfg Configuration
Add ESX resources to your server.cfg
:
3. Resource Loading Order
Proper loading order is crucial for ESX:
Verification & Testing
1. Server Startup
Start your server and verify ESX loads properly:
2. Database Verification
Check that database tables were created:
3. In-Game Testing
- Connect to Server: Join your server
- Character Creation: Test the multicharacter system
- Basic Functions: Try commands like
/me
,/job
,/money
- Job System: Test changing jobs with
/setjob [job] [grade]
Common Installation Issues
Database Connection Errors
Error: Failed to execute query: Access denied
Solution:
Resource Loading Errors
Error: Resource [es_extended] couldn't be started
Solutions:
- Check resource path: Ensure resources are in
[esx]
folder - Verify manifest: Check
fxmanifest.lua
syntax - Dependencies: Ensure database connector loads before es_extended
Shared Object Errors
Error: ESX object is nil
Solution:
Post-Installation Steps
1. Admin Setup
Add yourself as admin:
2. Basic Server Configuration
Configure basic server settings:
3. Job Configuration
Add or modify jobs in the database:
4. Society Configuration
Set up societies for jobs:
ESX vs ESX Legacy
ESX Legacy Advantages
- Better Performance: Optimized code and reduced resource usage
- Security Improvements: Better protection against exploits
- Modern Code: Updated to use newer FiveM features
- Active Development: Regular updates and bug fixes
- Compatibility: Better compatibility with modern resources
Migration from Old ESX
If migrating from old ESX to ESX Legacy:
- Backup Everything: Database and server files
- Update Resources: Replace old ESX resources with Legacy versions
- Database Migration: Run migration scripts if provided
- Test Thoroughly: Verify all functionality works
Next Steps
After successful installation:
- ESX Development - Learn about ESX development
- ESX Troubleshooting - Common issues and solutions
- Resource Management - Managing and updating ESX resources
Congratulations! You now have a working ESX server. Take time to familiarize yourself with the framework before adding custom resources.
Always backup your database and server files before making major changes or updates.