Can I run Hugo Binary on Mac M1 silicon chip?

I recently upgraded my work laptop to Macbook M1 Pro max and during the setup of Hugo for mywebsite it has trouble running Hugo binary on my new m1 macbook.

So is it possible to run hugo binaries on Mac M1 or do i need to build the binary from source on my new M1 macbook?

I tried executing hugo_0.101.0_macOS-ARM64.tar.gz but hugo did not start?

Any inputs are highly appreciated?

//Rahul

Of course, you can. The easiest method is through Brew but if you running from binaries chmod +x binary after unpacking than just run like Hugo serve

Any more feedback what you get back when you trying to run it?

1 Like

+1 for Homebrew.

One thing you usually have to do on macOS when pulling a binary from the Hugo repo is to whitelist it. I’m using an Intel Mac, but assume it’s the same procedure on Apple Silicon. (The following assumes you don’t have Hugo otherwise installed via a package manager such as Homebrew.)

  1. Open the Security & Privacy section of System Preferences.
  2. Go to the General tab. Keep this open while you go to the next step.
  3. Download the binary and extract it to your system PATH. Make sure you’re replacing your existing Hugo binary. (If necessary, consult the Hugo installation documentation.)
  4. Open a Terminal window and enter hugo version. This will fail with a security warning because you haven’t yet whitelisted the new binary. Cancel out from the warning but keep the Terminal window open.
  5. Back in the System Preferences window, click the lock icon at the bottom and enter your admin password so you can make changes. This will “de-gray” the radio buttons under Allow apps downloaded from, and you’ll see the Hugo binary mentioned as something you can give permission to run (i.e., whitelist).
  6. Click the button to allow Hugo to run. (You can now close the System Preferences window.)
  7. Back in the Terminal window, once again enter hugo version. You’ll get another dialog box asking if it’s OK to run this, so give permission. This will let hugo version run, and you’ll see the usual result — which will confirm that (a.) the whitelisting worked and (b.) the Hugo version you’re running is, indeed, the one you just obtained.

This sounds like a lot of trouble but, in fact, takes only a few moments once you’ve done it a couple of times and are familiar with the procedure. It avoids the wait for a package manager to get the latest Hugo version.

Sorry for the late reply and thanks for your inputs i really appreciate it.

So here is what worked for me ?

  1. Initially i was using hugo_0.101.0_macOS-ARM64.tar.gz and the arm version does not work on M1 chip
  2. I prefer installing with binary rather then homebrew so i downloaded hugo_0.101.0_macOS-ARM64.tar.gz and changed the mode to make it executable and it worked.

It’s working for me, just checked, but there are couple things that you need to remember,

  1. the hugo library will not work systemwide. you need to put extracted hugo file into folder where is your hugo website
  2. in terminal run chmod +x hugo
  3. in finder right-click on hugo and select open. There may be a warning from macOS etc., just hit Open.
    then
  4. from the terminal you doing ./hugo serve and is working fine.

Homebrew is better as hugo is installed system-wide, so you don’t need to copy file into each folder.