How to Install a Custom QBCore Server on Any Linux VPS/Dedicated Server Using TXAdmin

This guide will help you install and run a custom QBCore FiveM server on any Linux VPS or dedicated server using TXAdmin. It covers everything from installing dependencies to setting up your database,

Prerequisites

Before you begin, make sure you have:

  • ✅ A Linux VPS or Dedicated Server (Ubuntu 20.04/22.04 or Debian recommended).

  • Root SSH access to your server.

  • ✅ A custom QBCore server package (your own server files).

  • ✅ Your MySQL database credentials.

  • Port 30120 open for public access.

🔹 Step 1: Update Linux & Install Dependencies

  1. Connect to your server via SSH:

    ssh root@YOUR-SERVER-IP
  2. Update the system:

    apt update && apt upgrade -y
  3. Install required dependencies:

    apt install screen unzip git curl wget xz-utils tar -y

🔹 Step 2: Install MariaDB (MySQL Alternative)

  • Install MariaDB:

    apt install mariadb-server -y
  • Start and enable MariaDB:

    systemctl enable mariadb
    systemctl start mariadb
  • Run the security script to set up a secure database:

    mysql_secure_installation
    • Set a strong root password.

    • Remove anonymous users.

    • Remove test databases.

🔹 Step 3: Create a MySQL Database for QBCore

  1. Log into MySQL:

    mysql -u root -p
  2. Create a new database:

    CREATE DATABASE qbcore;
    CREATE USER 'qbuser'@'localhost' IDENTIFIED BY 'strongpassword';
    GRANT ALL PRIVILEGES ON qbcore.* TO 'qbuser'@'localhost';
    FLUSH PRIVILEGES;
    EXIT;

(Replace strongpassword with a secure password.)

🔹 Step 4: Install FiveM (FXServer) and TXAdmin

  1. Create a server directory:

    mkdir -p /home/qbcore && cd /home/qbcore
  2. Download the latest FiveM artifacts:

    wget https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/6000-6200/fx.tar.xz
    tar xvfJ fx.tar.xz
  3. Download TXAdmin’s default files:

    git clone https://github.com/citizenfx/cfx-server-data.git server-data
    cd server-data

🔹 Step 5: Upload Your Custom QBCore Server Files

  1. Use SFTP (FileZilla or WinSCP) to upload your custom QBCore server files to /home/qbcore/server-data.

  2. Extract the server files:

    unzip qbcore_server.zip -d /home/qbcore/server-data

🔹 Step 6: Configure Server Settings

  • Open the server.cfg file:

    nano /home/qbcore/server-data/server.cfg
  • Edit the database connection:

    set mysql_connection_string "mysql://qbuser:strongpassword@localhost/qbcore?charset=utf8mb4"

    (Replace qbuser and strongpassword with your actual database credentials.)

  • Save and exit: CTRL + X, then Y, then Enter.

🔹 Step 7: Import QBCore Database

  1. Run the following command to import your QBCore SQL file:

    mysql -u qbuser -p qbcore < /home/qbcore/server-data/qbcore.sql
  2. Enter the database password when prompted.

🔹 Step 8: Start TXAdmin and FiveM Server

  • Navigate to your FiveM folder:

    cd /home/qbcore
  • Start the FiveM server:

    ./run.sh +exec server.cfg
  • TXAdmin will start, and you can access it in your browser:

    http://YOUR-SERVER-IP:40120
  • Log in and create a new server profile.

  • Select "Manual Setup" and point TXAdmin to your custom server directory.

  • Save and start the server.

🔹 Step 9: Port Forwarding (If Hosting Publicly)

To allow external players to connect, open port 30120:

On Ubuntu/Debian

ufw allow 30120/tcp
ufw allow 30120/udp
ufw reload

On CentOS/RHEL

firewall-cmd --permanent --add-port=30120/tcp
firewall-cmd --permanent --add-port=30120/udp
firewall-cmd --reload

Restart your server for the changes to apply.

Final Step: Connect & Play

  1. Open FiveM and press F8.

  2. Type:

    connect YOUR-SERVER-IP:30120
  3. If everything is set up correctly, you will successfully join your QBCore server! 🎉

Troubleshooting

  • Server not starting?

    • Check TXAdmin logs:

      tail -f /home/qbcore/server-data/citizen/logs/fxserver.log
    • Ensure FiveM artifacts are correctly installed.

  • Database connection issues?

    • Verify MySQL credentials in server.cfg.

  • Players can't join?

    • Ensure port 30120 TCP/UDP is open.

🔄 Enable Auto-Restart on Reboot (Optional)

To make the server auto-restart when the VPS reboots:

crontab -e

Add the following line:

@reboot cd /home/qbcore && screen -dmS qbcore ./run.sh +exec server.cfg

This will automatically start your server on reboot.

🎉 Your Custom QBCore Server is Now Running on Linux TXAdmin!

Now your custom QBCore server is running on any Linux VPS/Dedicated server with TXAdmin hosting! 🚀

Let me know if you need modifications! 😊

Last updated