Run cURL commands from Windows console (2025)

9 Answers

Reset to default

74

Download cURL for Windows from here (and be sure to select it from Win32 - Generic way down on the page).

Run cURL commands from Windows console (1)

Then place it in a directory inside your PATH environment variable (ie: C:\Windows\System32) or run it with its full path preceding the executable name.

If you place it in a directory that's inside your PATH, make sure to close and then reopen command prompt to make the command available.

Improve this answer

edited Apr 10, 2015 at 11:47

slhck

234k7272 gold badges632632 silver badges607607 bronze badges

answered Apr 26, 2010 at 2:19

user1931user1931

3

  • 4

    You don't need to reopen the console if you put it in a directory on the path, you only need to do that if you change the PATH variable.

    Eltariel

    Commented May 11, 2012 at 3:24

  • One hard reboot later because I couldn't kill the task - um, you might wanna be careful with this.

    CAD bloke

    Commented Feb 26, 2013 at 9:51

  • Related; can you also install libraries for https?

    CodyBugstein

    Commented Oct 29, 2014 at 19:40

Add a comment |

101

If you install Git for Windows you get Curl automatically too. There are some advantages:

  • Git takes care of the PATH setup during installation automatically.
  • You get the GNU bash, a really powerful shell, in my opinion much better than the native Windows console.
  • You get many other useful Linux tools like tail, cat, grep, gzip, pdftotext, less, sort, tar, vim and even Perl.

Run cURL commands from Windows console (3)

Improve this answer

answered Oct 5, 2012 at 18:25

fuxiafuxia

2,33122 gold badges1818 silver badges1313 bronze badges

5

  • 8

    I didn't know the git bash did the other stuff too :D Thanks a ton!

    BRogers

    Commented Dec 15, 2013 at 18:23

  • worked like a charm!

    pedrommuller

    Commented Apr 26, 2014 at 21:04

  • 1

    This is probably the best all around solution since git is useful for many of the things that curl does but source wise.

    cchamberlain

    Commented May 3, 2015 at 5:23

  • If you have Git, this is a great solution

    Diode Dan

    Commented Jul 29, 2017 at 0:47

  • 4

    Newer versions of git-for-windows do not come with curl in the path, you have to run /mingw64/bin/curl.

    dev0

    Commented Feb 21, 2018 at 15:23

Add a comment |

3

After installing OpenSSL Light, restart Windows, open Command Prompt, then do a test command like:

curl http://www.google.com

If you get HTML tags back, it worked.

Improve this answer

edited Apr 9, 2011 at 11:26

answered Apr 9, 2011 at 3:08

TimTim

3122 bronze badges

Add a comment |

3

How to setup cURL:

  • Download and unzip 64-bit cURL with SSL.
  • Copy the curl.exe file into your Windows PATH folder. By default, this is C:\Windows\System32.
  • Download and install the Visual Studio 2010 C++ Runtime Redistributable 64 bit here.
  • Download the latest bundle of Certficate Authority Public Keys from mozilla.org here.
  • Rename this file from cacert.pem to curl-ca-bundle.crt.
  • Move this file into your Windows PATH folder.

How to test it:

  • Run cmd.exe to open your command prompt.
  • For both commands, you should see a couple pages of the HTML source code. If you see this, cURL is up and running!

Improve this answer

edited Feb 28, 2013 at 21:01

Kazark

3,48933 gold badges2828 silver badges3737 bronze badges

answered Feb 28, 2013 at 20:31

Nur RonyNur Rony

13133 bronze badges

Add a comment |

3

For folks that don't literally need the curl executable, but rather just need to e.g. see or save the results of a GET request, can use powershell directly. From a normal command prompt, type:

powershell -Command "(new-object net.webclient).DownloadString('http://example.com')"

which, while a bit wordy, is similar to typing

curl http://example.com/

in a more Unix-ish environment.

More information about net.webclient is available here: WebClient Methods (System.Net).

Improve this answer

answered Mar 5, 2016 at 18:33

mattymatty

16155 bronze badges

1

  • 1

    Exactly what I was looking for! I actually used the DownloadFile method: powershell -Command "(new-object net.webclient).DownloadFile('http://.../somefile', 'file.txt')". You also just taught me how to use the PowerShell without opening its prompt. Thank you matty!

    Armfoot

    Commented Dec 10, 2017 at 21:25

Add a comment |

3

Tar and Curl are available on Windows beginning in Insider Build 17063, as part of the Windows toolchain: curl and bsdtar.

Tar: A command line tool that allows a user to extract files and create archives. Outside of PowerShell or the installation of third party software, there was no way to extract a file from cmd.exe. The implementation uses libarchive.

Run cURL commands from Windows console (9)

Curl: Command line tool that allows for transferring of files to and from servers.

Run cURL commands from Windows console (10)

Note: PowerShell does already offer similar functionality (it has curl and it’s own file extraction utilities).

More info:Tar and Curl Come to Windows!

Improve this answer

edited Jan 19, 2018 at 13:31

answered Jan 19, 2018 at 10:51

Matija GrcicMatija Grcic

1,42311 gold badge1111 silver badges1515 bronze badges

Add a comment |

1

You can install this "cURL for Windows":cURL for Windows is an MSI installer for cURL, the popular command-line web transfer tool.http://www.confusedbycode.com/curl/

Improve this answer

answered Nov 21, 2013 at 21:32

Lenin MezaLenin Meza

11133 bronze badges

Add a comment |

No need to restart windows but restarting CMD is necessary.

  1. Install cURL from curl.haxx.se.
  2. Set Path environment variable according to location of curl.exe in your machine, something like C:\Users\You\cURL
  3. Download the certificate file from mozilla.org as linked in one ofthe answers above, and move it to system32 folder.

Improve this answer

answered Jan 2, 2015 at 20:51

Syed PriomSyed Priom

10133 bronze badges

Add a comment |

I used the answer provided by fuxia to run some bash scripts I had written in Linux on the Windows platform. It works very nicely.

A word of caution though with cURL. I had an issue where I could not use Console interaction when authenticating as described here: https://stackoverflow.com/questions/50724407/curl-command-in-git-bash

If your cURL command requires authentication and you do not want to have the password visible in the command line or stored in your script, you will have to use another solution, like using a password file:https://stackoverflow.com/questions/2594880/using-curl-with-a-username-and-password

Improve this answer

answered Jun 7, 2018 at 14:30

CyrilCyril

10155 bronze badges

Add a comment |

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

  • windows
  • command-line
  • console
  • curl

See similar questions with these tags.

Run cURL commands from Windows console (2025)

References

Top Articles
Latest Posts
Recommended Articles
Article information

Author: Patricia Veum II

Last Updated:

Views: 5656

Rating: 4.3 / 5 (64 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Patricia Veum II

Birthday: 1994-12-16

Address: 2064 Little Summit, Goldieton, MS 97651-0862

Phone: +6873952696715

Job: Principal Officer

Hobby: Rafting, Cabaret, Candle making, Jigsaw puzzles, Inline skating, Magic, Graffiti

Introduction: My name is Patricia Veum II, I am a vast, combative, smiling, famous, inexpensive, zealous, sparkling person who loves writing and wants to share my knowledge and understanding with you.