Configuring a corporate proxy

When JHipster is used in a company, you probably will need to configure all tools to bypass the corporate proxy.

You can try to configure the HTTP_PROXY and HTTPS_PROXY environment variables or use a tool like Cntlm.

But this probably won’t be enough, so you will need to configure separately all the tools that are used with JHipster.


Supposing your proxy is defined with:

  • username
  • password
  • host
  • port

The resulting configuration is: http://username:[email protected]:port

If your use Cntlm, then your configuration would be: Otherwise, follow the next steps to configure each tool individually.

NPM configuration

Use these commands:

npm config set proxy http://username:[email protected]:port
npm config set https-proxy http://username:[email protected]:port

Or you can edit directly your ~/.npmrc file:

proxy=http://username:[email protected]:port
https-proxy=http://username:[email protected]:port
https_proxy=http://username:[email protected]:port

Yarn configuration

Use these commands:

yarn config set proxy http://username:[email protected]:port
yarn config set https-proxy http://username:[email protected]:port

Git configuration

Use these commands:

git config --global http.proxy http://username:[email protected]:port
git config --global https.proxy http://username:[email protected]:port

Or you can edit directly your ~/.gitconfig file:

        proxy = http://username:[email protected]:port
        proxy = http://username:[email protected]:port

Maven configuration

Edit the proxies session in your ~/.m2/settings.xml file:


Maven Wrapper

Create a new file .mvn/jvm.config inside the project folder and set the properties accordingly:


Gradle configuration

Add the below in your file and in your gradle/wrapper/ file if you are downloading the wrapper over a proxy

If you want to set these properties globally then add it in USER_HOME/.gradle/ file

## Proxy setup

## end of proxy setup


Native Docker

Depending on your OS, you have to edit a specific file (/etc/sysconfig/docker or /etc/default/docker).

Then, you have to restart the docker service with: sudo service docker restart.

It will not apply to systemd. See this page from docker to configure the proxy.

Docker with docker-machine

You can create your docker-machine with:

docker-machine create -d virtualbox \
    --engine-env HTTP_PROXY=http://username:[email protected]:port \
    --engine-env HTTPS_PROXY=http://username:[email protected]:port \

Or you can edit the file ~/.docker/machine/machines/default/config.json.