Overview
This guide covers deploying Blazor Server, Blazor WebAssembly, and Blazor Web App projects to your Windows hosting account via Plesk.
Before You Begin
- Ensure your project targets .NET 10 (or your desired .NET version)
- Test your application locally
- Have your Plesk login credentials ready
Publishing Your Blazor App
Using Visual Studio:
- Right-click your project in Solution Explorer
- Select Publish
- Choose Folder as the target
- Configure settings and click Publish
Using Command Line:
# For Blazor Server or Blazor Web App
dotnet publish -c Release -o ./publish
# For Blazor WebAssembly (standalone)
dotnet publish -c Release -o ./publish
Deploying Blazor Server / Blazor Web App
Step 1: Upload Files
- Log in to Plesk
- Go to Websites & Domains → File Manager
- Navigate to your document root (e.g.,
httpdocs) - Upload all files from your
publishfolder
Step 2: Configure .NET Core in Plesk
- Go to Websites & Domains → your domain
- Click .NET Core
- Set Application Root: your app folder (e.g.,
/httpdocs) - Set Application Startup File: your main DLL (e.g.,
MyBlazorApp.dll) - Click Enable
Deploying Blazor WebAssembly (Standalone)
Standalone Blazor WASM apps are static files and can be hosted without ASP.NET Core:
Step 1: Publish
dotnet publish -c Release
Published files are in: bin/Release/net10.0/publish/wwwroot
Step 2: Upload Static Files
- Upload contents of
publish/wwwrootto your document root - Ensure
index.htmlis in the root folder
Step 3: Configure URL Rewriting
Create or edit web.config in your document root:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Serve subdir for root" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.html" />
</rule>
</rules>
</rewrite>
<staticContent>
<remove fileExtension=".blat" />
<remove fileExtension=".dat" />
<remove fileExtension=".dll" />
<remove fileExtension=".json" />
<remove fileExtension=".wasm" />
<remove fileExtension=".woff" />
<remove fileExtension=".woff2" />
<mimeMap fileExtension=".blat" mimeType="application/octet-stream" />
<mimeMap fileExtension=".dat" mimeType="application/octet-stream" />
<mimeMap fileExtension=".dll" mimeType="application/octet-stream" />
<mimeMap fileExtension=".json" mimeType="application/json" />
<mimeMap fileExtension=".wasm" mimeType="application/wasm" />
<mimeMap fileExtension=".woff" mimeType="font/woff" />
<mimeMap fileExtension=".woff2" mimeType="font/woff2" />
</staticContent>
</system.webServer>
</configuration>
Deploying Blazor WASM with ASP.NET Core Backend
- Publish the Server project (not the Client project)
- Upload all files from the
publishfolder - Configure .NET Core in Plesk as shown above
- The Client files are automatically included in
wwwroot
Environment Configuration
Set environment to Production in Plesk .NET Core settings:
ASPNETCORE_ENVIRONMENT=Production
Verifying Deployment
- Visit your domain in a browser
- Check browser console for errors (F12)
- Verify all static files load correctly
- Test interactive features