//Servers

Managing ASP.NET Core & MSSQL on Plesk: A Complete Guide

Deploy an ASP.NET Core app with SQL Server on Windows Server using Plesk: install the .NET hosting bundle, create the database, publish code, configure IIS, and secure your site.

5 min read
Managing ASP.NET Core & MSSQL on Plesk: A Complete Guide

Deploying an ASP.NET Core application that uses Microsoft SQL Server on a Windows Server with Plesk can feel intimidating for newcomers. This guide walks you through every step—from creating the database to configuring IIS—so you can launch your site quickly and securely.

1. Prerequisites

  • Plesk 18.0 or newer on Windows Server (2016, 2019, or 2022).
  • A licensed Microsoft SQL Server instance (Express, Standard, or Enterprise) that is reachable from the server.
  • The .NET Core Hosting Bundle installed (provides the runtime, ASP.NET Core module for IIS, and the installer).
  • Administrative access to Plesk and the Windows Server (RDP or PowerShell).

2. Install the .NET Core Hosting Bundle

The bundle adds the ASP.NET Core module to IIS, letting IIS forward requests to Kestrel.

  1. Download the latest ASP.NET Core Hosting Bundle for Windows.
  2. Run the installer with administrative rights, accept the license, and let it finish.
  3. After installation, restart IIS so the new module is loaded:
    iisreset
    This command stops and starts the IIS service.

3. Create an MSSQL Database in Plesk

Plesk’s GUI makes database and user creation straightforward.

  1. Log in to Plesk and go to Databases → Add Database.
  2. Choose Microsoft SQL Server as the database type.
  3. Enter a name (e.g., MyAppDb) and click OK.
  4. Open the database’s details page.
  5. Under Database Users, click Add Database User:
    • Specify a username (e.g., myapp_user) and a strong password.
    • Assign the db_owner role for full access.
  6. Note the Server name (often localhost\SQLEXPRESS or your named instance) and the credentials you just created. You’ll use these in the connection string.

4. Deploy Your ASP.NET Core Application via Plesk

Plesk supports two common deployment methods: Git or a ZIP package.

4.1. Using Git

  1. Navigate to Websites & Domains → Git → Add Repository.
  2. Select Remote Git Repository and enter the repository URL (GitHub, GitLab, Bitbucket, etc.).
  3. Choose the branch to deploy (e.g., main) and set the deployment path to the domain’s httpdocs folder.
  4. Click OK. Plesk will clone the repo into the web root.

4.2. Using a ZIP Package

  1. Publish locally with:
    dotnet publish -c Release -r win-x64 --self-contained false
    This creates a publish folder with all DLLs and a web.config file.
  2. Compress the publish folder into a ZIP file.
  3. In Plesk, open Files, navigate to httpdocs, and choose Upload → Upload Files to upload the ZIP.
  4. After uploading, select the ZIP and click Extract Files to place the published files in the web root.

5. Configure IIS for ASP.NET Core

Each Plesk domain already has an IIS site, but you must enable the ASP.NET Core module and set the correct application pool.

  1. In Plesk, go to Websites & Domains → Hosting Settings for the domain.
  2. Under Web scripting and statistics, set ASP.NET support to Enabled. Plesk switches the site to Integrated pipeline mode, which is required.
  3. Scroll to Application Pool and choose .NET CLR version: No Managed Code. ASP.NET Core runs on Kestrel, not the CLR.
  4. Save changes; Plesk will recycle the pool automatically.

6. Set Up the Connection String

Store the connection string in appsettings.json or as a Windows environment variable. The latter is recommended for production.

6.1. Using appsettings.json

{
  "ConnectionStrings": {
    "DefaultConnection": "Server=localhost\\SQLEXPRESS;Database=MyAppDb;User Id=myapp_user;Password=StrongP@ssw0rd;Trusted_Connection=False;MultipleActiveResultSets=true"
  }
}

Replace the server name if it differs.

6.2. Using Environment Variables (recommended)

  1. Open the Plesk control panel, navigate to Domains → your domain → Apache & nginx Settings (this page allows environment variable configuration on Windows).
  2. In the Additional directives for IIS box, add:
    setx ASPNETCORE_ConnectionStrings__DefaultConnection "Server=localhost\\SQLEXPRESS;Database=MyAppDb;User Id=myapp_user;Password=StrongP@ssw0rd;Trusted_Connection=False;MultipleActiveResultSets=true"
    This creates a system-wide variable that .NET reads at startup.
  3. Restart the site’s application pool (via IIS Manager or iisreset) so the new variable is loaded.

7. Test the Deployment

  1. Open a browser and go to http://yourdomain.com. The default page of your ASP.NET Core app should appear.
  2. To confirm database connectivity, add a simple endpoint (e.g., /health) that queries a table and returns OK if successful.
  3. If you see an error, review the following logs:
    • IIS logs – %SystemDrive%\inetpub\logs\LogFiles
    • ASP.NET Core stdout log – enable by setting stdoutLogEnabled="true" in web.config and specifying a stdoutLogFile path.
    • SQL Server error log – C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Log\errorlog

8. Secure Your Application

  • Enable HTTPS in Plesk: go to Websites & Domains → SSL/TLS Certificates, install a certificate (Let’s Encrypt is free), and enable Force HTTPS.
  • Restrict SQL Server access by allowing only the local IP (127.0.0.1) or a specific IP range in the firewall.
  • Use Windows Authentication when possible. If IIS and SQL Server run under the same domain account, set Integrated Security=True in the connection string to avoid storing passwords.

Conclusion

Running an ASP.NET Core application with a Microsoft SQL Server backend on a Windows Server managed by Plesk requires a few clear steps: install the hosting bundle, create the database, deploy the code, configure IIS, and set a secure connection string. Following this guide gives you a production-ready environment without deep Windows administration knowledge. Keep an eye on IIS and SQL Server logs, update the .NET runtime when new releases appear, and apply security patches to maintain a stable platform.

asp.net coremicrosoft sql serverwindows serverpleskiisdeployment.net hosting bundlesecurity

Try it on your own server

Follow along on a Cloud VPS with full root access, or read the step-by-step knowledge base guides.

Guides: VPS for WordPress · Node.js hosting · VPS or dedicated server · Paying by UPI