Skip To Content

ArcGIS Server and ArcPy

ArcGIS includes the ArcPy site package that you can use for managing data store items and publishing service definitions with Python. ArcPy also allows you to run geoprocessing tools from ArcGIS Server machines using Python.

ArcPy complements the server administration operations in the ArcGIS REST API. For example, using ArcPy, you can convert map documents into service definitions and upload them to the server, change the paths of layers in a map document, or add more layers and publish a service.

The following are ways you can use ArcPy with ArcGIS Server:

  • Register databases and folders with ArcGIS Server.
  • Analyze your map documents and use them to create service definitions.
  • Analyze your imagery or geoprocessing model results and use them to create service definitions.
  • Publish a service definition as an ArcGIS Server service.
  • Publish all service definitions in a folder to ArcGIS Server.

Tip:

The Python installation location on an ArcGIS Server machine is <arcgis_server_installation_directory>/arcgis/server/tools/python.

This section of the documentation contains several examples of ArcPy code that accomplish various tasks in ArcGIS Server.