Skip To Content

Tutorial: Publishing a map service

Complexity: BeginnerData Requirement: Use your own dataGoal: Publish a map service to ArcGIS Server and consume it over the web using Map Viewer Classic.

This tutorial gives you the steps for publishing a map service to ArcGIS Server using ArcMap. A map service is the way that you make maps, features, and attribute data available to the web using ArcGIS. If you're new to map services and want to learn more about them before attempting this tutorial, see map services.


ArcGIS Enterprise 10.9.x, including ArcGIS Server, is the last release of ArcGIS Enterprise to support services published from ArcMap. Beginning with the ArcGIS 2022 releases, it will no longer be possible to publish services from ArcMap (including ArcPy code based in ArcMap) to ArcGIS Server sites.

Esri highly recommends that all customers transition all publishing workflows to ArcGIS Pro at this time.

This tutorial demonstrates publishing a map service to ArcGIS Server from ArcMap. The equivalent workflow in ArcGIS Pro depends on whether your ArcGIS Server site is federated with an ArcGIS Enterprise portal. Users can share a web layer from ArcGIS Pro to a portal, which automatically publishes a map service to a federated ArcGIS Server site. You can also publish a map service to a stand-alone ArcGIS Server site from ArcGIS Pro.

Before beginning this tutorial

If you've just installed ArcGIS Server, you need to complete some preparatory steps before you can connect to the server and publish services:

Publish your map as a service

To publish your map as a service, follow these steps.

  1. Open your map document in ArcMap and choose File > Share As > Service from the main menu.
  2. In the Share as Service window, choose Publish a service. Click Next.
  3. In the Publish a Service dialog box, click Connect to ArcGIS Server Add ArcGIS Server to create a connection to the server.
  4. In the Add ArcGIS Server window, choose Publish GIS Services. Click Next.
  5. For the Server URL text box, type the URL of the ArcGIS Server site you want to connect to, for example,
  6. From the Server Type drop-down list, choose ArcGIS Server.

    During the publishing process, a service definition file is created and temporarily stored locally on disk. When the publishing process completes, the service definition is uploaded to the server and the local file is deleted.

  7. For the purposes of this tutorial, accept the default staging folder and continue.
  8. If your server administrator has enabled security for your site, enter your User Name and Password. Click Finish.
  9. Optionally, in the Publish a Service window, enter a new name for the service. Click Next.

    The name cannot be more than 120 characters long and may contain only alphanumeric characters and underscores.

    By default, services are published to the root folder (root) of ArcGIS Server. Services can be organized into subfolders under the root folder.

  10. Choose the folder where you want to publish the service, or create a folder to contain the service. Click Continue.

    The Service Editor window appears. You can use the Service Editor window to choose what users can do with your map service and take fine-grained control of how the server will expose your service.

  11. Click the Capabilities tab.

    By default, mapping and KML are enabled.

  12. Click Mapping and review the following properties:
    • URL—This is the URL clients use to access the map service. The URL is formatted as follows:
    • Data—Selecting this option allows client applications to perform attribute searches on the features in your map service.
    • Map—Selecting this option allows client applications to view the map layers in your map service.
    • Query—Selecting this option allows client applications to query the features in your map service.
  13. Click Analyze Analyze.

    This examines your map document to see if it can be published to the server.


    To give yourself more viewing area when configuring your map service, click the Collapse Collapse button at the top of the Service Editor window.

  14. Fix any Errors Error in the Prepare window before you publish. Optionally, fix the warnings and informational messages to further improve the performance and appearance of your map service.

    For more information about resolving these issues, see Analyzing your GIS resource.


    You can register folders and geodatabases with your ArcGIS Server site, ensuring that the server can recognize and use your data. If you proceed with the following steps, any data referenced by your map document originating from an unregistered folder or geodatabase is copied to the server at the time that you publish. This is a precautionary measure to ensure that the server can access all the data used by the service. For full instructions on registering a folder or geodatabase with your ArcGIS Server site, see Registering your data with ArcGIS Server using ArcGIS Desktop.

  15. Optionally, in the Service Editor window, click Preview Preview.

    This can give you an idea of how your map will look when viewed on the web. See Previewing your map for more information.

  16. Once you've fixed the errors in your map document, click Publish Publish.

Your map service is published to ArcGIS Server. When the publishing process completes, you are ready to consume your map service in a web map.

Consume the map service in a web map

In this section of the tutorial, you'll use Map Viewer Classic to view and interact with your map service on the web. Map Viewer Classic is hosted on and is deployable directly through the ArcGIS Server Services Directory. It does not require any configuration or programming work to get Map Viewer Classic up and running.

In this section, you can visualize your published service with a readily available basemap from ArcGIS Online. To save and share your service in a web map or web app, you must sign in with an organizational or named user account.

You may also configure the ArcGIS Server Services Directory to open the map in ArcGIS Enterprise instead of ArcGIS Online. To see configuration steps, see Connect the ArcGIS Server Services Directory to your portal topic.

To get started, follow these steps.

  1. Open a web browser and browse to the ArcGIS Server Services Directory.

    Typically, this is located at You can also access the Services Directory by opening the shortcut installed with ArcGIS Server.

  2. In the services list, click the name of your map service. Typically, this is displayed as <map service name> (MapServer).

    If you don't see your map service, it may be located within one of the folders listed in the Services Directory.

  3. On the page describing your map service, click View In: ArcGIS Online Map Viewer.

    A new window (or tab) opens, displaying Map Viewer Classic. The Map Viewer Classic display is zoomed to the extent of your map service.

  4. Take some time to pan and zoom around your map service.

    You can also switch the basemap layer to more appropriately complement the context of your map.

  5. Optionally, save the web map.

Further reading

Now that you've successfully tested your map service using Map Viewer Classic, you may want to consider how you can use and share your map in other ArcGIS clients. See the following examples:

  • In ArcGIS Online and ArcGIS Enterprise, you can create a customized web mapping app using the Configurable Apps and App Builders.

    For more about these and other options, see Configurable Apps & App Builders topics on the ArcGIS for Developers site.

  • The ArcGIS API for JavaScript offers the most advanced web mapping capabilities and customization options. If you're comfortable programming using this API, you can create a rich experience for your users on the web using a map service identical to the one you created in this tutorial.

By exploring one or all of the ArcGIS clients listed above, you give yourself additional options that can help you tailor your web mapping scenario for a specific purpose, goal, or organizational strategy.