Install the JavaScript API for use with ArcGIS for Server

Last Published: April 25, 2020


When using ArcGIS for Server in an isolated or secure environment, it may not be possible to access the hosted Esri JavaScript API libraries. This article provides a walkthrough for installing a local copy of the JavaScript API and configuring it for use with ArcGIS for Server.


This document assumes that Microsoft IIS is being used as the web server. If using a different program, some steps may not apply or may be different based on that configuration. Please consult that software’s documentation if needed.

Download and install the JavaScript API

  1. Navigate to the ArcGIS API for JavaScript page.
  2. Sign in using Esri Global Account credentials.
  3. Under the ArcGIS Web SDKs (Download for Hosting Locally) section, download both the API and Documentation.
At time of publishing the current JSAPI release is 3.16 and all subsequent folder paths include this information. If using an alternate version adjust the paths accordingly.
  1. Extract both files to a temporary location such as the following:
  1. Create a new folder in the IIS root virtual directory called arcgis_js_api as shown below:
  1. Copy the extracted library and sdk subfolders from their temporary locations into the newly created arcgis_js_api folder:

Modify JavaScript files

Please note in the following two steps, do not include 'http://' with the fully qualified host name as this is already defined in the two files.
  1. Open the following file in a text editor:
  1. Search for the text [HOSTNAME_AND_PATH_TO_JSAPI] and replace this text with:
  1. Open the following file in a text editor:
  1. Search for the text [HOSTNAME_AND_PATH_TO_JSAPI] and replace this text with:
  Edit ArcGIS services
  1. In a web browser on the server, navigate to the following location:
  1. Log in with administrator credentials.
  2. Copy or take a screenshot of the current Services Directory settings in case it is necessary to revert to the default settings.
  3. Click Edit to modify settings.
  4. Replace each of the following fields with the path to the local installation of the JavaScript API using the fully qualified host name in place of the following examples:
Javascript API URL:
Javascript API SDK URL:
Javascript API CSS URL:
Javascript API CSS2 URL:
If the server is configured to use HTTPS only, modify the examples above to use HTTPS instead of HTTP as the URL connection.
  1. Clear the browser cache to complete installation.
To confirm that ArcGIS for Server is using the correct settings for the JavaScript API, open a web debugging program and preview a map service using the ArcGIS JavaScript viewer from the Services Directory (REST). If configured correctly, the viewer should load successfully and all URLs listed in the web debugger are from the local web server and not from ''

Article ID:000011974

  • ArcGIS Server

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options