Mac OS X Install wget Network Downloader Utility

I recently learned that “wget” can continue getting a partially-downloaded (resume download) file. I am unable to find wget command on Mac OS X. How do I install install wget on Mac OS X (Mountain Lion/ Mavericks / Snow Leopard / Big Sur)? How can I install wget in Mac OS X without 3rd-party repo such as Homebrew or MacPorts?

Tutorial details
Difficulty level Easy
Root privileges No
Requirements macOS and xcode
Est. reading time 6 minutes
You can install the latest version of GNU/wget and many other open source software without using Homebrew or MacPorts. The steps are as follows to install wget on macOS Sierra using either Homebrew or source code:

  1. Easy method #1: Install Homebrew and type command ‘brew install wget‘ on macOS Sierra.
  2. Source code method #2:
    1. Download, compile and install OpenSSL
    2. Download, compile and install wget on macOS Sierra

Let use see both methods in detailed.

Method #1: Install wget using brew (recommended method)

Trust me this is the best and easy method to install wget using Homebrew. First install Homebrew on macOS.

Install Homebrew

$ /usr/bin/ruby -e "$(curl -fsSL"

Install wget

$ brew install wget
Sample outputs:

Updating Homebrew...
==> Downloading
######################################################################## 100.0%
==> Pouring wget-1.19.1.sierra.bottle.tar.gz
?  /usr/local/Cellar/wget/1.19.1: 10 files, 1.6MB

Use wget

$ /usr/local/bin/wget url
$ /usr/local/bin/wget url/file.tar.gz
$ /usr/local/bin/wget

That is all, and you need to stop reading the rest. Please note that the rest of the following tutorial covers wget command installation using the source code method.

Method #2: Install wget using source code (recommended for advanced users only)

You need to install a free app called Xcode. It includes command line development tools such as gnu/gcc and friends. See how to install GCC Compiler with Xcode for more information.

Fig.01: Install gcc compiler on Mac OS X

Fig.01: Install gcc compiler on Mac OS X

I installed command line tools using the following command:
$ xcode-select --install

Step #1: Download gnu/wget source code

Use curl command as follows to download the latest gnu/wget from the official project site. Open the Terminal and than type the following commands:
$ cd /tmp
$ curl -O
$ ls -l

Sample outputs:

Fig.02: Downloading wget source code with the curl utility

Fig.02: Downloading wget source code with the curl utility

Step #2: Extract files

Use the tar command to extract files on OS X as follows:
$ tar xvf wget-1.15.tar.gz
Sample outputs:

x wget-1.15/
x wget-1.15/doc/
x wget-1.15/doc/stamp-vti
x wget-1.15/doc/
x wget-1.15/doc/
x wget-1.15/NEWS
x wget-1.15/configure
x wget-1.15/ChangeLog
x wget-1.15/MAILING-LIST

Step #3: Configure, Compile and Install GNU/wget on OS X

First, cd to the wget-1.15 directory using cd command:
$ cd wget-1.15
To configure wget, enter:
$ ./configure --with-ssl=openssl
Sample outputs:

Configure: configuring for GNU Wget 1.15
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating doc/Makefile
config.status: creating util/Makefile
config.status: creating po/
config.status: creating tests/Makefile
config.status: creating tests/
config.status: creating lib/Makefile
config.status: creating src/config.h
config.status: executing depfiles commands
config.status: executing po-directories commands
config.status: creating po/POTFILES
config.status: creating po/Makefile

To compile wget on OS X, enter:
$ make
Sample outputs:

/Applications/  all-recursive
Making all in lib
rm -f alloca.h-t alloca.h && \
	  cat ./; \
	} > alloca.h-t && \
	mv -f alloca.h-t alloca.h
gcc  -O2 -Wall   -o wget cmpt.o connect.o convert.o cookies.o ftp.o css_.o css-url.o ftp-basic.o ftp-ls.o hash.o host.o html-parse.o html-url.o http.o init.o log.o main.o netrc.o progress.o ptimer.o recur.o res.o retr.o spider.o url.o warc.o utils.o exits.o build_info.o  version.o ftp-opie.o openssl.o http-ntlm.o ../lib/libgnu.a -liconv  -lssl -lcrypto -lz -ldl -lz -lz  
Making all in doc
./ -D VERSION="1.15" ./wget.texi wget.pod
/usr/bin/pod2man --center="GNU Wget" --release="GNU Wget 1.14" wget.pod > wget.1
Making all in po
Making all in tests
make[2]: Nothing to be done for `all'.
Making all in util
make[2]: Nothing to be done for `all'.
make[2]: Nothing to be done for `all-am'.

To install wget, enter:
$ sudo make install

Find out wget location on OS X

By default wget will be installed at the /usr/local/bin/wget. You can use the whereis utility (or type -a) to check the wget location, enter:
$ whereis wget
$ type -a wget
If you do not see output, edit $HOME/.bash_profile or $HOME/.bashrc and add/edit/append PATH as follows:
export PATH=${PATH}:/usr/local/bin
Save and close the file.

How do I use wget command?

The basic syntax is:
wget url
wget ftp://url/

To see wget version, type:
$ wget --version
Sample outputs:

Installed wget on macOS Sierra

Installed wget on macOS Sierra

How do I update installed gnu/wget on OS X?

Warning: The following method only works if you installed gnu/wget earlier using source code based method as described above. Do not use the following method if you installed wget using Homebrew or MacPorts.

A note about installing wget on macOS Sierra using source code

You need to first install the latest version of openssl:
### Step #1: Grab and install latest openssl version 1.19.1 using source code ###
$ cd /tmp/
$ curl -O
$ tar -zxvf openssl-1.1.0e.tar.gz
$ cd openssl-1.1.0e
$ ./config
$ make
$ sudo make install

Finally install wget using the following method:
### Step #2: Grab and install wget version 1.19.1 using source code ###
$ cd /tmp
$ curl -O
$ tar -zxvf wget-1.19.1.tar.gz
$ cd wget-1.19.1
$ export OPENSSL_CFLAGS="-I/usr/local/include"
$ export OPENSSL_LIBS="-L/usr/local/lib -lssl -lcrypto -lz"
$ ./configure --with-ssl=openssl
$ make
$ sudo make install
$ /usr/local/bin/wget url

See also

I recommend the following resources for usage and examples on both wget and curl commands:

And there you have it, gnu/wget installed from directly source code without using 3rd party repos.

This entry is 5 of 6 in the Linux/Unix install wget Tutorial series. Keep reading the rest of the series:
  1. Freebsd Install wget Utility To Download Files From The Internet
  2. How to install wget on RHEL 8 using the dnf command
  3. Debian or Ubuntu Linux install wget
  4. RHEL/CentOS 7 install wget using yum
  5. Mac OS X Sierra Install wget Network Downloader Utility
  6. CentOS 8 install wget

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 15 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
15 comments… add one
  • Johan Dec 10, 2013 @ 7:01

    Worked like magic on my OSX 10.6.8 ! More PLZ!

    • wakou Dec 10, 2013 @ 14:53

      I don’t use a MAC but would like to thank and congratulate the poster on his excellent and comprehensive reply.. Great work!

  • Johan Dec 11, 2013 @ 7:39

    I was inspired so i looked up something else – today successfully compiled Nmap from source. ( link – )
    I also tried mtr, but that failed. May look into it later.

    • Johan Dec 11, 2013 @ 7:39

      This also on OSX 10.6.8 of course.

  • Deep Sukhwani Feb 21, 2014 @ 17:12

    Awesome, thanks so much for helping!…

  • Jason Feb 27, 2014 @ 18:57

    Alternatively, one could have Macports ( installed and simply install wget via the CLI:

    sudo port install wget

    Then create a link to wget, and use it from the CLI like on any other posix box:

    sudo ln -s /opt/local/bin/wget /usr/bin/wget
    • Runuply Sep 2, 2016 @ 2:40

      It came to me with below?
      sudo ln -s /opt/local/bin/wget /usr/bin/wget
      ln: /usr/bin/wget: Operation not permitted
      tkx302:rgtdata ye.liu$

  • john Feb 28, 2014 @ 2:46

    curl can also resume a partially downloaded file, even on mac os x. I see why you need wget for this…

    just do:
    $ curl -C –

  • Sheharyar Mar 21, 2014 @ 11:34

    A better way would be to install Homebrew and then install wget through it.

    $ brew install wget
    • Jason Mar 22, 2014 @ 20:08

      Why is this way better than any of the others suggested?

      • R_Monster Apr 1, 2017 @ 18:35

        It only take 2 minutes provided that you *trust Homebrew devs* not to install backdoor in GNU wget. Having said that I used the ‘brew install wget’ method. As it was very easy and I am lazy af. I trust Homebrew devs :) YMMV.

  • blue phoenix Aug 5, 2015 @ 17:20

    configure: error: in `/Users/blue/wget-1.16.3′:
    configure: error: The pkg-config script could not be found or is too old. Make sure it
    is in your PATH or set the PKG_CONFIG environment variable to the full
    path to pkg-config.

    Alternatively, you may set the environment variables OPENSSL_CFLAGS
    and OPENSSL_LIBS to avoid the need to call pkg-config.
    See the pkg-config man page for more details.

    To get pkg-config, see .
    See `config.log’ for more details
    blue:wget-1.16.3 blue$ make
    There seems to be no Makefile in this directory.
    You must run ./configure before running ‘make’.
    make: *** [abort-due-to-no-makefile] Error 1

    I can’t use make… I even used just ./configure but same result, please help…

    • Jeannie Jun 25, 2016 @ 11:53

      I have the same issue here, still can’t figure it out how to do this. Any luck with “no Makefile” ?

      • 🐧 Vivek Gite Apr 1, 2017 @ 18:27

        Blue phoenix and Jeannie, I have updated the page to install latest version of wget 1.19.1 on macOS Sierra. Check it out and let me know.

  • Anonymous Apr 14, 2021 @ 19:06

    it works. TY

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum