This lesson is part of the "TAMING GAM7 - A practical guide to GAM7 and GAMADV-XTD3" course.
This lesson will guide you through setting up GAM7 on a macOS machine.
If you are trying to install GAM on another operating system, please refer to these articles:
GAMADV-XTD3 on Google Cloud Shell
Welcome back, Mac admins! Today we are looking at GAM7. Not GAM, not GAMADV-XTD3, just the all-powerful, unified GAM7 on macOS.
If you’ve been managing Google Workspace with the old tools, you might know that the standard GAM and the advanced GAMADV-XTD3 have merged into one super-tool. If you’re ready to upgrade or install it from scratch on your Mac to become a command-line wizard, you are in the right place.
I’m going to walk you through this step-by-step. We’ll tackle the installation, the configuration (the "pro" way), and the authorisation. Open up your Terminal, grab a coffee, and let’s get your GAM on!
Before we fire up the Terminal, let's make sure you have your supplies:
Nano works, but if you prefer Visual Studio Code or TextEdit, have those ready.We aren’t going to manually download files and drag them around. We’re going to use the official install script.
1. Open your Terminal.
2. Copy and paste the following command (this is the standard GAM install command):
<(curl -s -S -L https://gam-shortn.appspot.com/gam-install)
3. Hit Enter.
Heads Up: If this is a fresh Mac, you might get a pop-up saying "Python 3 command requires the command line developer tools."
Once the tools are installed, run that install command again. It will extract GAM7 to your home directory (usually ~/bin/gam7).
The installer will ask if you want to set up a project now. Say "No" (N) for a second. Why? Because we want to set up a clean, professional folder structure first, just like the pros do.
By default, GAM hides config files in a hidden .gam folder. We want them visible and manageable.
Create a Config Folder: In your terminal
mkdir -p ~/GAMConfig
Tell macOS where to look: We need to edit your shell profile (usually .zshrc on modern Macs). You can use nano.
Add this line to the bottom of the file
export GAMCFGDIR="~/GAMConfig"
Save and close the file.
Reload your profile so the Mac knows about the change
source ~/.zshrc
Next, let’s make a "Working" directory. This is where you’ll keep your CSVs for bulk uploads and where GAM will save reports. It keeps your actual program files clean.
Run this command to make the folder
mkdir -p ~/GAMWork
Now, initialize GAM with this new path
gam config drive_dir ~/GAMWork verify
GAM will now generate a gam.cfg file inside your new ~/GAMConfig folder. You are now officially configured!
Now it’s time to introduce GAM to Google.
Run:
gam create project
Enter your Super Admin email address.
GAM will open a browser tab. Sign in.
Create the Project: Click the "Create Project" button when prompted.
Create the Client:
Go to "APIs & Services" > "Credentials".
Click Create Credentials > OAuth client ID.
Select Desktop App .
Name it something cool like "GAM7 Mac".
Click Create.
You will see a pop-up with your Client ID and Client Secret.
Important: Treat that Client Secret like a password. Don't share it!
GAM will now ask for permission to manage your domain.
c to continue with the default full access.This is the final boss battle. We need to give a Service Account permission to act on behalf of your users.
Back in your Terminal, tell GAM to check everything one last time. It might verify the time sync (your Mac needs to be within 1 second of Google's time servers!) and check the scopes.
Once it says "Pass," you are ready to roll. Test it with:
gam info domain
If you see your domain details pop up, congratulations! You have successfully installed GAM7 on macOS.
echo $0 in your terminal. If it says -zsh, use the .zshrc instructions above.gam.cfg file in ~/GAMConfig to set defaults. For example, add default_user = your_email@domain.com so you don't have to type it every time.pwd (Print Working Directory) to see exactly where you are in the file system.Q: Can I install GAM7 if I already have the old GAM?
A: Yes! The installer will detect it. However, creating the new GAMConfig folder structure (Step 2) helps keep the new installation clean and separate from legacy data.
Q: Do I need to use Terminal every time?
A: Yes, GAM is a command-line tool. But don't worry, you can copy and paste commands from a text editor if you prefer drafting them there first.
Q: Why did the install "fail" on the Service Account step?
A: That is expected! GAM tries to check for access before you grant it. It fails to show you exactly what is missing, which prompts you to go to the Admin Console and add the scopes.
Q: I'm getting a "command not found" error.
A: Ensure you reloaded your profile using source ~/.zshrc or restart your Terminal completely after installing.
How was that? Easier than you thought, right? Happy GAM-ing!