In this article, you'll learn how to publish your first ASP.NET web app to various locations including a local web server such as IIS and a remote cloud environment such as Azure App Service.
This article supports ASP.NET and ASP.NET Core.
If you're publishing this web app for the first time, next you see the Publish wizard.
Publish your web app to Docker Container Registry
You can publish your web app as a Docker container to any compatible Docker Container Registry.
![Screenshot showing the Publish wizard, with Publish to Docker Container Registry highlighted.](media/publish-docker-container-registry-highlighted.png?view=vs-2022)
Click Next and choose from the available options, such as Azure Container Registry or Docker Hub.
![Screenshot showing the Publish to Docker Container Registry options.](media/publish-docker-container-registry-options.png?view=vs-2022)
Azure Container Registry
Next, for Azure Container Registry, either select an existing instance or create a new one.
![Screenshot showing the option to publish to Azure Container Registry.](media/publish-acr-select-instance.png?view=vs-2022)
Docker Hub
Next, for Docker Hub, provide the publish credentials.
![Screenshot showing the option to publish to Docker Hub.](media/publish-dockerhub-details.png?view=vs-2022)
Other Docker Container Registry
Next, for other Docker container registries, provide the URI and publish credentials.
![Screenshot showing the option to publish to another Docker Container Registry.](media/publish-custom-docker-registry-details.png?view=vs-2022)
Finish the Publish wizard
Next, you see the summary page for the new publish profile that you just created using the Publish wizard. Click Publish and Visual Studio deploys your web app to the specified Docker Container Registry.
![Screenshot showing the summary page.](media/publish-docker-container-registry-summary-page.png?view=vs-2022)
Note
The above screenshot is showing a publish profile targeting Azure Docker Registry, but the same Publish button is available for all three Docker Container Registry options.
Publish your web app to a folder
You can publish your web app to both local and network folders.
![Screenshot showing the option to publish to a folder highlighted.](media/publish-folder-highlighted.png?view=vs-2022)
First, provide the path and click Finish to complete the Publish wizard.
![Screenshot showing the Publish wizard screen to publish to folder.](media/publish-folder.png?view=vs-2022)
Next, you see the summary page for the new publish profile that you just created using the Publish wizard. Click Publish and Visual Studio deploys your web app to the provided path.
![Screenshot showing the publish to folder summary page.](media/publish-folder-summary-page.png?view=vs-2022)
You can come back to this summary page after you close it. Next time you right-click and choose Publish, Visual Studio opens this summary page. (To get back to the Publish wizard just click New in the summary page.)
To view or change the settings, select the Show all settings link, or click on any of the pencil icons. The Settings page appears. Here, you can change the configuration to publish, the target framework, the deployment mode, or the target Runtime ID (RID) (see .NET RID catalog). You can choose to delete all the existing files in the target folder every time you publish, or not. If you expect to add files that aren't part of what Visual Studio deploys, clear the checkbox.
Publish your web app to an FTP/FTPS server
You can publish your web app using FTP or FTPS.
![Screenshot showing the publish to FTP or FTPS Server option.](media/publish-ftp.png?view=vs-2022)
Provide the necessary connection details and choose Finish.
![Screenshot showing the Publish wizard screen to publish to FTP or FTPS Server.](media/publish-ftp-details-latest.png?view=vs-2022)
Next, you see the summary page for the new publish profile that you just created using the Publish wizard. Click Publish and Visual Studio deploys your web app to the provided FTP or FTPS Server.
![Screenshot showing the completion of the process to publish to FTP or ftps server, summary page.](media/publish-ftp-summary-page.png?view=vs-2022)
You can come back to this summary page after you close it. The next time you right-click and publish, Visual Studio opens this summary page. (To get back to the Publish wizard just click New in the summary page.)
Publish your web app to Web Server (IIS)
You can publish your web app to IIS.
![Screenshot showing the option to publish to IIS.](media/publish-iis.png?view=vs-2022)
Pick the desired deployment mode. Choose Web Deploy to immediately deploy the application to the specified server. Choose Web Deploy Package to create a packaged zip file that contains the deployment artifacts for later use by you or someone else.
![Screenshot showing the option to publish to IIS, showing the choice of deployment mode.](media/publish-iis-deployment-mode.png?view=vs-2022)
Web Deploy
Provide the necessary connection details and choose Finish.
![Screenshot showing the Publish wizard screen to publish to IIS with the Web Deploy option.](media/publish-iis-web-deploy-latest.png?view=vs-2022)
On the remote computer, make sure that Web Deploy is installed and that the Web Management Service is started. See Web Deploy error codes.
Web Deploy Package
Click Browse... to open a Select Package Location dialog box and enter the path to where you want the package to be created, including the .zip file name.
![Screenshot showing the Publish wizard screen to publish to IIS with the Web Deploy Package option.](media/publish-iis-web-deploy-package.png?view=vs-2022)
Finish the Publish wizard
Next, you see the summary page for the new publish profile that you just created using the Publish wizard. Click Publish and Visual Studio deploys your web app to the specified IIS server.
![Screenshot showing the Publish wizard, publish to IIS summary page.](media/publish-iis-web-deploy-package-summary-page.png?view=vs-2022)