How to Install Macros in Logitech G HUB, Configure or Create Your Own

A comprehensive guide for setting up macros in Logitech G HUB


Logitech GHUB

Using .lua scripts greatly extends what Logitech mice can do. These macros for Logitech G HUB let you automate actions like recoil control in Rust, CS 2, or PUBG. For instance, if you need a Logitech recoil macro for CS2 or Rust, you can either buy a ready-to-go solution or create one yourself, then import it into G HUB. Below is a step-by-step guide on how to make or install Logitech macros (ready-made or from scratch) using the official Logitech G HUB software.

1. Downloading & Installing Logitech G HUB

  1. Download G HUB from the Logitech website.
    If you’re setting up macros on a Logitech G102 mouse (or any other G-series model like G502, G402, G102, MX518, G900, G305, G403, G Pro, G603, G604, G703, G903) for the first time, start with the latest stable version. If you encounter problems, try an older release (e.g., 2021.10.8013Download G HUB (2021.10.8013)).
  2. Install G HUB as Administrator.
    This is crucial if you want Logitech mouse macros to compensate recoil in certain games, since some games block scripts unless run with elevated privileges. Running as administrator also prevents the common issue where macros work on the desktop but not in-game.
  3. Make sure to DISABLE “on-board memory” mode. In newer G HUB versions, you can toggle it on the main screen (to the right of the mouse image).

On-board memory mode in Logitech G HUB

2. How to Set Up a Macro on a Logitech Mouse

  1. Have your .lua script ready. You can create one yourself or purchase a pre-made solution at Topmacro.net.
    For example, if you plan on using Logitech G102 macros for Rust or PUBG, save the file to your desktop to easily find it during import.

  2. Desktop profile in GHUB
  3. Open G HUB and set the “Desktop” profile as your default (primary) profile.
    • Launch G HUB.
    • Go to “Games & Applications” or “Manage Profiles.”
    • Locate the “Desktop” profile and mark it as permanent (primary) in the profile’s details.

    Setting a persistent desktop profile in Logitech G HUB
    Always use the “Desktop” profile for scripts to avoid conflicts with specific game profiles.

3. Creating a Script and Importing a Lua Macro

  1. Activate the “Desktop” profile.
    This is the simplest way to test Logitech mouse macros, as there are no limitations or conflicts with other game profiles.

  2. Creating a script in Logitech G HUB
  3. Create a new script.
    • Look for a button labeled “Create New LUA Script” or something similar, and click it.
    • In the new window, go to “Script” → “Import” and choose your .lua file’s location.
    This is particularly handy if you want to add multiple lua macros for Logitech—say, for Rust, CS2, and other games.

  4. Importing a lua macro in Logitech G HUB
  5. Save and enable the script.
    After importing, open the “Script” menu and select “Save and Run.” This activates your macro so you can immediately see if it works as intended in G HUB.

4. Verifying Macro Functionality

  1. Assign a button.
    Our Logitech G102 macros (and those for other G-series models) often default to a side button (like G5). You can change the button either in the script itself or within G HUB.
  2. Test on the Desktop profile.
    Press or hold the assigned button. For example, if you installed a Logitech macro for CS2 or Rust, check whether recoil is being compensated correctly. If the cursor moves according to your script, you’re all set.

5. Adding Multiple Macros

If you need several different macros at once:

  1. Repeat the steps above—create a new script and import the relevant .lua file.
  2. Save and run each macro upon import.

Additionally, our site offers special Premium scripts that combine all weapon macros into one Lua script. You can switch between macros using hotkeys on your keyboard or mouse.


Premium macros in Logitech G HUB

6. Creating Your Own Macro in G HUB Logitech

If you want to build your own script from scratch, you’ll need at least some basic programming knowledge. G HUB does include a built-in “Lua Scripting” interface with its own documentation, so you can experiment and learn how to write your own macros step by step.


Creating your own macro in G HUB Logitech

7. Macro Doesn’t Work in the Game

  • Ensure the “Desktop” profile is set as permanent in the profile’s details.
  • Completely close G HUB and relaunch it as Administrator.
  • Disable on-board memory mode if it’s on. Then reboot your PC.
  • If nothing helps, reinstall G HUB.

8. G HUB Won’t Start or Stays in Loading Loop

  • A reliable fix is to fully uninstall G HUB and install an older version, such as 2021.10.8013. After installation, it may prompt you to update to a newer release—agree to that. This method often restores stable performance.

9. Conclusion

Setting up macros for a Logitech mouse is typically straightforward if you follow the main steps:

  1. Install G HUB using Administrator rights.
  2. Select the “Desktop” profile as the main profile.
  3. Create a new script (aka Logitech G HUB macro) and import your .lua file.
  4. Save and run the macro to activate it.

We wish you productive work sessions and smooth gaming!

Video Tutorial