Deploy your containerised Blazor app to Digital Ocean's App Platform

Published on

App Platform

App Platform is a Platform-as-a-Service solution which takes care of deployment, scaling and load balancing your apps for you.

If you’re packaging your app up as a container image, it’s a quick (and affordable) option for getting your .NET app into production.

You’ll need a Digital Ocean account - use the following link to get $200 credit (to be used within 60-days).

Try Digital Ocean with $200 free credit

(the above link will send a small amount of credit may way if you go on to use DO after your free credit expires, thank you for helping to keep this blog/newsletter free!)

Once you’re in you’ll see this screen:

Digital Ocean welcome screen

Scroll down to the bottom and hit the Explore our control panel link to continue.

To use App Platform you’ll need a Docker image for your app.

Deploying an existing image to App Platform

I’ve already created and pushed a simple Blazor demo app up to DockerHub, called DigitalOceanDemo.

So let’s see how we might deploy that.

In Digital Ocean’s control panel select Apps (from the left-hand Nav menu).

Digital Ocean Apps menu selection

Then click Create App.

If we were deploying a JavaScript app we could connect direct to GitHub or GitLab here, but because we’re using .NET we need to go down the Docker route.

In this case the demo app lives over on DockerHub (and is public).

Digital Ocean Docker setup screen

Next we see details of the App we’re about to deploy (with a temporary auto-generated name).

Digital Ocean app deployment details

Hit the Edit Plan button.

For this we can stick to Basic and change the Instance Size down to the $5 per month plan.

Digital Ocean basic plan selection

Fun fact - I’ve run several production sites using this “basic” plan without even coming close to running out of resources.

Hit the back button, then click Skip to Review and we’re ready to deploy this thing.

Digital Ocean deployment review screen

You can also set environment variables up at this point, but for this demo app they aren’t necessary.

Hit the big blue Create Resources button and let the magic happen.

You’ll see a new blue notification appear telling you that the app is Building….

After a few moments that should disappear to be replaced by a green success notification.

Digital Ocean successful deployment notification

With that your .NET web app is live, and ready to handle as many users as you can throw at it.

If the $5 per month instance doesn’t cut the mustard you can change the plan to something a bit bigger, and/or scale up to multiple instances using App Platform’s control panel.

Finally, it’s worth mentioning that most of my production apps also use their Managed PostgreSQL Databases, with the apps themselves running on App Platform.

I know you don't have endless hours to learn ASP.NET

Cut through the noise, simplify your web apps, ship your features. One high value email every week.

I respect your email privacy. Unsubscribe with one click.

    Next Up
    1. From Zero to Hero? Building a tiny app from scratch using Blazor and .NET 8
    2. Don't rush to build that re-usable Blazor component
    3. Exploring Blazor Changes in .NET 8 - Auto Render Mode