A detailed walkthrough of deploying a .NET 10 Web API and two React frontends to a DigitalOcean droplet using Dokploy, a free open-source self-hosted PaaS. The setup includes a managed PostgreSQL database, Valkey (Redis fork) for caching, Cloudflare R2 for zero-egress file storage, automatic SSL via Traefik/Let's Encrypt, and GitHub Actions for off-droplet builds. Key lessons include: exposing port 8080 for ASP.NET Core containers, moving builds to CI to avoid 90% CPU spikes on the droplet, hiding the origin behind Cloudflare's proxy, and persisting ASP.NET Core Data Protection keys across redeploys. Total cost is ~$40/month versus ~$110–170/month for an equivalent AWS setup.

39m read timeFrom codewithmukesh.com
Post cover image
Table of contents
What is Dokploy?Docker Guide for .NET DevelopersThe architecture I deployedPrerequisitesStep 1: Create the DigitalOcean dropletStep 2: Set up SSH and connect to your dropletStep 3: Install DokployStep 4: Connect GitHub to DokployStep 5: Provision the managed Postgres databaseStep 6: Deploy the .NET Web APIEnvironment-Based Configuration in ASP.NET CoreStep 7: Run Valkey as a caching containerDistributed Caching in ASP.NET Core with RedisStep 8: Wire up Cloudflare R2 for file storageWorking with Amazon S3 in ASP.NET CoreStep 9: Deploy the React frontendsCORS in ASP.NET Core (.NET 10) - Cross-Origin Done RightStep 10: Add domains and automatic SSLStep 11: Move builds to GitHub ActionsThe docker-compose file that ties it all togetherHow to secure the deploymentHow do I monitor the droplet and database?My take: self-hosted PaaS vs managed PaaSClean Architecture in .NETKey takeawaysFrequently Asked QuestionsTroubleshootingSummaryClaude Code for Beginners
5.9K Impressions