Unifying the Strength of Linux and GitHub to Streamline Server Management in FiveM
Unifying the Strength of Linux and GitHub to Streamline Server Management in FiveM
We have established a streamlined development workflow for FiveM servers, utilizing the Debian-based Linux distribution as our server environment and GitHub for version control and access management.
This infrastructure promotes a structured, secure, and efficient development lifecycle. Security is enhanced through direct administrative oversight and redundant backups, achieved via repository clones maintained on individual developer accounts.
By leveraging a terminal-based Linux system and hosting the repository on GitHub, the workflow minimizes server resource consumption and eliminates the need for costly Windows server rentals, resulting in both technical and financial efficiencies
We call this the FiveCore Workflow
✅ Step 1: Create a GitHub Account
Go to https://github.com
Click Sign Up and follow the prompts to create your account
📂 Step 2: Create a New Repository
Once logged in, navigate to your GitHub Dashboard
Click the New button to start a new repository
📝 Step 3: Configure Your Repository
Repository Name: Enter a name for your project
Visibility: Select Private to restrict access
Click the green Create Repository button to finalize
✅ Step 1: Open PowerShell and Connect via SSH
ssh username@server-ip
Replace username with your server’s login name
Replace server-ip with your server’s IP address
You’ll be prompted to enter your password
⚠️ You may receive a security warning about the host key.
You can safely allow this exception to proceed.
💻 Step 2: Access the Server Terminal
After entering your password, you should see the server’s terminal interface
You are now logged into your server remotely
📁 Step 3: Navigate to the Root Directory
cd /
This command places you in the root (/) directory
You can verify this by running:
ls
You should see folders like: bin, dev, lib, lib64, media, opt, etc, etc.
🔑 Step 4: Set a New Root Password
sudo passwd root
This command begins the process of setting a new password for the root account
You may be prompted to:
Enter your current password
Enter the new root password
Retype the new password for confirmation
✅ Once complete, your root account will have a new password set.
✅ Step 1: Navigate to the Root Directory
cd /
This command places you in the root (/) folder.
Verify by running:
ls
You should see folders like: bin, dev, lib, lib64, media, opt, etc, etc.
Your terminal prompt should end with :/ confirming you're in root.
📁 Step 2: Create the FXServer Directory
mkdir ./FXServer
mkdir creates a new folder.
./ ensures the folder is created in your current directory (root).
📂 Step 3: Confirm Folder Creation
ls
This lists all folders in the current directory.
You should now see FXServer listed.
📌 Step 4: Enter the FXServer Directory
cd FXServer
cd stands for "change directory."
🔗 Step 5: Clone Your GitHub Repository
Go to your GitHub repo and copy the HTTPS link.
In Linux terminals, paste using:
Ctrl + Shift + V (not just Ctrl + V)
git clone https://github.com/yourusername/your-repo-name.git
🛠️ Step 6: Install Git (If Needed)
If you see command not found when running git, install Git:
sudo apt update
sudo apt install git -y
Confirm installation by typing y when prompted.
Verify Git is installed:
git --version
🔐 Step 7: Authenticate with GitHub Using a Personal Access Token
Log into GitHub
Click your profile (top right) → Settings
Scroll down left sidebar → Developer Settings
Expand Personal Access Tokens → Select Fine-grained tokens
Click Generate new token
Configure Your Token:
Name: Choose something like "Terminal login"
Expiration: Select "No expiration"
Repository Access: Choose "Only select repositories" → Select your repo
Permissions:
Click Add permissions
Check all boxes
Change all Read permissions to Read and Write where possible
Some may be locked to Read only—this is fine
Click Generate Token
Copy the token immediately (you won’t see it again)
🔁 Step 8: Retry the Clone Command
If your terminal cleared during token setup, re-run:
git clone https://github.com/yourusername/your-repo-name.git
When prompted:
Username: Your GitHub username
Password: Paste your Personal Access Token
🎉 Final Confirmation
If successful, the terminal will confirm the repo is cloned.
It may say the repo is empty—this is expected if you haven't added files yet.
You're now ready to install FXServer into this location.
📝 Step 1: Create the .gitignore File in GitHub
Navigate to your GitHub repository page
Click the blue link labeled “creating a new file”
A blank file editor will appear
📋 Step 2: Add Contents to the File
Open this document:
.gitignore file
Copy the contents to your clipboard
Paste them into the GitHub file editor
🏷️ Step 3: Name and Commit the File
At the top of the editor, name the file:
.gitignore
Click the green “Commit changes” button
In the popup:
Add a title and description for the commit
Click “Commit changes” again to finalize
💻 Step 4: Pull the .gitignore File to Your Server
Open your terminal and verify you're in the repository directory:
The path should end with your repository name.
If not, navigate using:
cd /FXServer/your-repo-name
Pull the latest changes:
git pull
You’ll be prompted for GitHub credentials:
Enter your GitHub username
Use a personal access token as your password
Tokens are one-time use but can be regenerated anytime.
Name this token something like "Terminal user login" for future reference.
🔍 Step 5: Verify the .gitignore File
By default, .gitignore is hidden in Linux. To confirm it exists:
ls -a
This command lists all files, including hidden ones.
✅ Final Step: Ready for FXServer Installation
With your .gitignore file in place, your repository is now optimized to track only essential code files. You’re ready to proceed with installing FXServer into this location.
📦 Step 1: Update Package List
sudo apt update
Updates your system’s package index to the latest versions.
🧩 Step 2: Install MariaDB Server
sudo apt install mariadb-server -y
The -y flag auto-confirms the installation prompt.
🔐 Step 3: Log Into MariaDB
sudo mariadb
Opens the MariaDB console.
👤 Step 4: Create a Database User
CREATE USER 'new_username'@'localhost' IDENTIFIED BY 'your_strong_password';
Replace new_username and your_strong_password with your desired credentials.
🗂️ Step 5: Create a Database
CREATE DATABASE database_name;
Replace database_name with your preferred name.
✅ Step 6: Grant User Permissions
GRANT ALL PRIVILEGES ON database_name.* TO 'new_username'@'localhost'; FLUSH PRIVILEGES;
Replace database_name and new_username with your actual values.
🚪 Step 7: Exit MariaDB
exit
Closes the MariaDB console.
🌐 Step 8: Install phpMyAdmin
sudo apt install phpmyadmin -y
During setup:
Select Apache when prompted
Choose Yes for dbconfig-common
Create and confirm a new password
🔧 Step 9: Enable phpMyAdmin in Apache
sudo nano /etc/apache2/apache2.conf
Scroll to the bottom and add:
Include /etc/phpmyadmin/apache.conf
Then:
Press Ctrl + X to exit
Press Y to save
Press Enter to confirm
🔄 Step 10: Restart Apache
sudo systemctl restart apache2
🌍 Step 11: Access phpMyAdmin
Open your browser and go to:
http://yourserverip/phpmyadmin
Log in using the new database user and password you created earlier.
If successful, you’ll see your database listed in the sidebar.
🔐 Step 12: Set Root Password
Log back into MariaDB:
sudo mariadb
Set a password for the root user:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
Replace new_password with a strong password of your choice.
🔧 Step 1: Verify Directory
Ensure you're in the correct directory:
The path should end with /FXServer.
If not, navigate back using:
cd /FXServer
📥 Step 2: Download FXServer Artifacts
Visit the FiveM Linux Artifacts page
Right-click the topmost version and copy the download link
In your terminal, run:
wget paste-your-link-here
Use Ctrl + Shift + V to paste the link.
📦 Step 3: Extract the Artifact
Confirm the file downloaded:
ls
You should see fx.tar.xz
Install extraction utilities:
sudo apt install xz-utils -y
Extract the archive:
tar xf fx.tar.xz
Confirm extraction:
ls
You should see Alpine/ and run.sh
Remove the original archive:
rm fx.tar.xz
Confirm deletion:
ls
▶️ Step 4: Launch FXServer
Navigate to the FXServer directory:
cd /FXServer
Start the server:
bash ./run.sh
🌐 Step 5: Access TxAdmin
Remote access: Use the IP address shown in the terminal
Local access: Open your browser and go to:
your-server-ip:40120
🔗 Step 6: Link Your CFX Account
Enter the PIN shown in the terminal
Log into your CFX account
Authorize TxAdmin
Provide the following:
Discord User ID (click your profile > scroll down > Copy User ID)
Backup password
Agree to terms
📋 Step 7: Deploy QBCore/Qbox Recipe
Name your server
Select Popular Recipes > QBCore/Qbox(This workflow has only been tested with these two frameworks. Attempt other frameworks at your own peril)
Set data location to:
/FXServer/your-repo-name/server
To confirm your repo name, open a second terminal and run:
cd /FXServer ls
Click Save
Click Go to Recipe Deployer
Review the recipe and click Next
🔑 Step 8: Generate Keymaster Token
Visit Keymaster
Sign in and click Generate Key
Enter a display name
Complete the captcha
Click Generate and copy the key
🛠️ Step 9: Configure Database
In the Recipe Deployer tab:
Enter your Keymaster token
Click Show Database Options
Enter:
MariaDB username
MariaDB password
Database name
Click Run Recipe
Wait for deployment to complete
Click Next
⚙️ Step 10: Finalize Server Setup
Review the server.cfg file
Scroll to the bottom and click:
Save and Run Server
✅ Final Notes
Allow the server to fully boot for 1 minute on first launch
Then, restart the server to ensure all scripts initialize properly
1. Open a New Terminal
Open a new Windows PowerShell window (not the one running FXServer).
2. Navigate to Your Repository Folder
cd /FXServer/your-repo-name
Replace your-repo-name with the actual name of your Git repository folder.
3. Stage Your Changes
git add .
This command stages all modified files in the current directory for commit.
4. Commit Your Changes
git commit -m "Your commit title here"
The -m flag allows you to include a commit message directly without opening a prompt.
5. Push to GitHub
git push origin main
This command pushes your committed changes to the main branch of your GitHub repository.
6. Authentication Prompt
You’ll be asked to enter your GitHub username and password.
Your password is your personal access token (not your GitHub account password).
✅ Confirmation
Once complete, your development files will appear on your GitHub repository page.
1. Create the Service File
Open a new service file using nano:
sudo nano /etc/systemd/system/myprogram.service
Replace myprogram with a recognizable name for your FXServer launcher.
2. Add Service Configuration
Paste the contents of this FXServer-Launcher.service file configuration into the newly opened file.
3. Save and Exit Nano
Press Ctrl + X to exit
Press Y to confirm saving
Press Enter to close the file
4. Reload systemd
Refresh systemd to recognize the new service:
sudo systemctl daemon-reload
5. Enable the Service
Enable the service to run on startup:
sudo systemctl enable myprogram.service
Again, replace myprogram with the name you assigned earlier.
6. Reboot the Server
reboot
7. Verify the Service is Running
After reboot, log back into the terminal and check the service status:
sudo systemctl status myprogram.service
Look for green text indicating:
The service is active (running)
The preset is enabled
If you see these, your FXServer is now configured to start automatically when the server box restarts.
1. Create a New Linux User
Open your terminal and run:
sudo adduser username
Replace username with your desired name (must be all lowercase).
You will be prompted to:
Enter a password
Confirm the password
Fill in optional user details (you can enter 0 or leave blank)
Confirm the information
Once complete, the user will be created.
2. Configure SSH Access for the New User
Open the SSH configuration file:
nano /etc/ssh/sshd_config
Scroll to the bottom and paste the contents of this sshd_config file into the file.
Make sure to:
Replace username with the new user you created
Replace the jail path with:
/FXServer/your-repo-name/server
To save and exit:
Press Ctrl + X
Press Y to confirm
Press Enter to close the file
Restart the SSH service to apply changes:
sudo systemctl restart sshd
🛠️ Install WinSCP for File Access
Download WinSCP from:
https://winscp.net/eng/index.php
Install the application and open it.
3. Connect to Your Server Using WinSCP
Enter the following credentials:
Host name: Your server’s IP address
Port number: 22 (default)
Username: The Linux user you created
Password: The password you set
Before logging in:
Click Save
Give your server connection a recognizable name
Click Login
You may receive a security warning—approve access.
You may be prompted again for your password—re-enter it.
✅ Success
You should now see the server folder of your repository.
It’s ready to be modified as needed. (Refer to owner responsibilities for when and only when this access should be used.)
1. Download GitHub Desktop
Each developer, including yourself, should download GitHub Desktop from:
https://desktop.github.com/download/
2. Add Collaborators to Your Repository (Owner Only)
If you don’t have other developers yet, you can skip this step.
To add collaborators:
Go to your repository page on GitHub
Click Settings at the top of the page
Click Collaborators in the left sidebar
If prompted, confirm your GitHub login
Click the Add People button in the center of the page
Note:
The person you're adding must already have a GitHub account.
If they don’t, you can invite them via email using the same method.
Once you find the person:
Click their name
Click the green Add "username" button
They will receive an invitation to access your repository.
Once accepted, they will have read and write access.
3. Set Up GitHub Desktop
Once GitHub Desktop is installed:
Open the application
Sign in with your GitHub account
On the left sidebar, you’ll see a list of repositories linked to your account.
Select the repository you created for FXServer
Click the Clone button at the bottom
You can:
Edit the local path to choose where the files will be stored
Or leave it as the default location
Click Clone to proceed.
✅ Local Repository Setup Complete
You now have a local copy of your GitHub repository on your computer.
If you open the folder where you stored it, you’ll see an exact copy of your repository files.
Editing these files locally is how you make changes to the repository.
Further instructions will be provided in the GitHub Desktop Operations section.
📝 Step 1: Modify Files Locally
Go to the folder you just cloned (using File Explorer)
Open any file you want to edit (e.g., in Notepad, VS Code, etc.)
Make your changes and save the file
🔍 Step 2: View Changes in GitHub Desktop
Return to GitHub Desktop
You’ll see a list of changed files on the left
Click on each file to preview the changes
💬 Step 3: Write a Commit Message
This is a short note describing what you changed.
In the bottom-left box labeled Summary, write a brief message (e.g., “Updated homepage text”)
Optionally, add a Description for more detail
✅ Step 4: Commit Your Changes
Click the Commit to main button (or whatever branch you're working on)
🧠 This saves your changes locally but doesn’t send them to GitHub.com yet.
🚀 Step 5: Push Your Changes to GitHub
After committing, click the Push origin button at the top
This sends your changes to the GitHub repository online
🌐 Step 6: Confirm Your Changes on GitHub.com
Go to github.com
Open your repository
You’ll see your updated files and commit message
🧭 Bonus Tips
Want to add a new file? Just drop it into the local folder — GitHub Desktop will detect it.
Want to pull updates from GitHub? Click Fetch origin to sync changes others made.
Want to switch branches? Use the branch dropdown in the top-left corner.
🔐 Untracked Access Guidelines
Untracked access should be granted only to individuals you trust completely. This level of access allows direct interaction with server files that are not managed by Git, and misuse could compromise the integrity of your server.
1. Linux Terminal User
Responsible for logging into the server via terminal.
Executes the git pull command within the repository folder.
This action pulls the latest tracked changes from GitHub into the live server environment.(Requires an FXServer restart from the TxAdmin page for changes to take effect. Some scripts can be started/restarted directly, but this is generally not a recommended procedure as it can cause bugs.)
2. SFTP (WinSCP) User
Responsible for uploading and managing files not tracked by Git.
This includes:
Vehicle models
Clothing assets
Map files (MLOs)
Image and audio files
Important Note
Only Linux Terminal Users and SFTP Users will have visibility into untracked files on the server.
If you do not see these files in your local Git clone or on the GitHub repository, do not panic—this is expected behavior. Git does not manage or display untracked assets such as models, textures, or media files.
📁 Tracked Access Guidelines
Tracked access is suitable for contributors who assist in server development. This level of access involves working with files managed by Git and poses minimal risk—any misuse can be reverted easily.
1. GitHub Desktop User
Primary developer role for FXServer.
Handles all general coding activities.
Responsible for:
Script installation and configuration
Editing text-based files, including server.cfg
Important Notes
Only users with Server Box Access will be able to view files on the server that are not tracked by Git.
If you don’t see image, audio, or model files in your local Git clone or on GitHub, do not panic—this is expected. These assets are excluded from version control.
🚫 Git Limitations
Attempting to add untracked assets (e.g., images, audio, models) to the GitHub repository directly or through your local clone will not work.
These files will appear only on your local machine and will not sync to the repository.
To include these assets on the server, contact a user with SFTP access—they are responsible for uploading untracked files via WinSCP.