Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
[Windows 7] CNTLM and NPM behind NTLM proxy

CNTLM and NPM behind NTLM proxy on Windows 7


  • Install CNTLM in a folder where you have full rights to run it as administrator.

  • Open cntlm.ini and fill it :

Domain      YOUR_DOMAIN
Listen      53128


  • Open a console to generate password hashes :
> cd c:\the_install_directory_of_cntlm
> cntlm –c cntlm.ini –H
Password: ...type proxy password here...
PassLM          D6888AC8AE0EEE294D954420463215AE
PassNT          0E1FAED265D32EBBFB15F410D27994B2
PassNTLMv2      91E810C86B3FD1BD14342F945ED42CD6

Copy those tree lines behin Domainfield. !!! AGAIN, DON'T FILL THE PASSWORD FIELD !!!

  • Run the console as administrator and copy the following line to determine if the settings work :
    cntlm –c cntlm.ini –I –M You should have a success message. If not, check the previous steps.

  • (Optional, only if the "Start CNTML proxy" shortcut does not exist yet) Create start_cntlm.bat file where you want :

cd c:\the_install_directory_of_cntlm
cntlm -v -f -c "cntlm.ini"
  • Run start_cntlm.bat as administrator to start CNTLM service. Keep the console open. Closing it will stop the service.


  • Open a console and copy those 3 lines :
> npm config set proxy http://localhost:53128
> npm config set https-proxy http://localhost:53128
> npm config set registry
  • Start CNTLM service.

  • Every nmp command should work. You can try with :
    > npm view qunit

  • Enjoy.


[] []


This comment has been minimized.

Copy link

@genotrance genotrance commented Mar 31, 2017

Just use Px:

No need to provide any credentials - Px just authenticates as the logged in user. Super easy to setup and use and no worries of locking out your account cause you forgot to update the CNTLM.ini password hashes.


This comment has been minimized.

Copy link

@alflanagan alflanagan commented May 4, 2017

Thanks, worked like a charm!


This comment has been minimized.

Copy link

@rozaydin rozaydin commented Nov 17, 2017

Works great :) Thanks a lot


This comment has been minimized.

Copy link

@johnyesberg johnyesberg commented Apr 10, 2019

I was getting "I'm a teapot" errors until I changed the registry to use https instead of http as discussed at stackoverflow

npm config set registry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.