<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/9dhnfbcvp" -->

---
title: How I Deploy Production Next.js + FastAPI Apps on a VPS
description: A merge to main is enough to ship production for OutCallerAI, a Next.js, FastAPI, and Prefect app. GitHub Actions builds web, API, and worker container images...
canonical: https://daily.dev/posts/9dhnfbcvp
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How I Deploy Production Next.js + FastAPI Apps on a VPS | daily.dev
og:description: A merge to main is enough to ship production for OutCallerAI, a Next.js, FastAPI, and Prefect app. GitHub Actions builds web, API, and worker container images...
og:url: https://daily.dev/posts/9dhnfbcvp
og:image: https://api.daily.dev/og/posts/9dHNfBcVP.png
og:image:alt: Post cover image
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How I Deploy Production Next.js + FastAPI Apps on a VPS

**[WebDev](https://daily.dev/sources/webdev)** · [@falakgala](https://daily.dev/falakgala) · 18 upvotes · 7 comments

## Summary

A merge to main is enough to ship production for OutCallerAI, a Next.js, FastAPI, and Prefect app. GitHub Actions builds web, API, and worker container images on hosted runners and pushes them to GHCR. Dokploy pulls the pre-built images onto a DigitalOcean Droplet and runs them, while its bundled Traefik proxy routes each hostname to the right container. Database migrations run only from the API container to avoid races, and PostgreSQL stays on DigitalOcean's managed service rather than a container on the same Droplet. Dokploy maintains a library of 390+ pre-configured templates covering databases, analytics, CMSs, developer tools, and other open-source services.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://falakgala.dev/writing/zero-build-deployments-with-dokploy>

## Community discussion

Top comments from developers on daily.dev.

**@adiaga** · 1 upvotes

> Are you using self hosted runner or github runner?

**@ahmetozel** · 1 upvotes

> Building images on GitHub Actions runners and pushing to GHCR before Dokploy pulls them onto the Droplet avoids the classic VPS failure mode where a heavy Next.js build starves live FastAPI and Prefect workers of RAM. Pinning database migrations exclusively to the API container also prevents parallel startup races during rollouts.
>
>
> Keeping PostgreSQL on a managed instance instead of colocating it on the same Droplet is a smart boundary too. One extra safeguard worth pairing with Traefik routing is a pre-cutover readiness probe that verifies schema migration completion before traffic shifts...

**@ernestoporto** · 0 upvotes

> interesting food for thought

## Similar posts on daily.dev

- [Moving beyond CI/CD with Dokploy](https://daily.dev/posts/moving-beyond-ci-cd-with-dokploy-759dgdb3g) · LogRocket · 3 upvotes · 0 comments
- [I Deployed a .NET App to DigitalOcean with Dokploy](https://daily.dev/posts/i-deployed-a-net-app-to-digitalocean-with-dokploy-zffvxwruf) · Code with Mukesh · 7 upvotes · 0 comments
- [How to Containerize a Node.js Application with Docker and Deploy with GitHub Actions](https://daily.dev/posts/how-to-containerize-a-node-js-application-with-docker-and-deploy-with-github-actions-ndb3pz7zw) · freeCodeCamp · 1 upvotes · 0 comments

---

Tags: [#cicd](https://daily.dev/tags/cicd), [#docker](https://daily.dev/tags/docker), [#nextjs](https://daily.dev/tags/nextjs), [#fastapi](https://daily.dev/tags/fastapi)

[View this post on daily.dev](https://daily.dev/posts/9dhnfbcvp)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/9dhnfbcvp","headline":"How I Deploy Production Next.js + FastAPI Apps on a VPS","text":"Shared: How I Deploy Production Next.js + FastAPI Apps on a VPS","url":"https://daily.dev/posts/9dhnfbcvp","datePublished":"2026-11-24T10:41:28.845Z","dateModified":"2026-11-24T10:41:28.848Z","author":{"@type":"Person","name":"Falak Gala","url":"https://daily.dev/falakgala","image":"https://media.daily.dev/image/upload/s--dv1dLKC6--/f_auto,pg_1/v1794733237/avatars/avatar_XoNMNOgp8L6zSDzT5HiRH?_a=BAMAMiiw0","description":"Software engineer building AI products, production systems \u0026 dev tools. Writing hands-on dev guides.","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":80}},"image":"https://media.daily.dev/image/upload/s--CxzD6vbw--/f_auto/v1722860399/public/Placeholder%2005","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":18},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":7}],"sharedContent":{"@type":"WebPage","url":"https://api.daily.dev/r/O5LHjdXsl"},"comment":[{"@type":"Comment","text":"Are you using self hosted runner or github runner?","datePublished":"2026-11-25T06:13:03.818Z","url":"https://daily.dev/posts/9dHNfBcVP#c-DquapHYdC","author":{"@type":"Person","name":"Adi Agafitei","url":"https://daily.dev/adiaga","image":"https://avatars1.githubusercontent.com/u/338271?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"Building images on GitHub Actions runners and pushing to GHCR before Dokploy pulls them onto the Droplet avoids the classic VPS failure mode where a heavy Next.js build starves live FastAPI and Prefect workers of RAM. Pinning database migrations exclusively to the API container also prevents parallel startup races during rollouts.\nKeeping PostgreSQL on a managed instance instead of colocating it on the same Droplet is a smart boundary too. One extra safeguard worth pairing with Traefik routing is a pre-cutover readiness probe that verifies schema migration completion before traffic shifts to the new API container.","datePublished":"2026-11-25T05:15:33.113Z","url":"https://daily.dev/posts/9dHNfBcVP#c-1ibrJQkZD","author":{"@type":"Person","name":"Ahmet Özel","url":"https://daily.dev/ahmetozel","image":"https://avatars.githubusercontent.com/u/70992231?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"interesting food for thought","datePublished":"2026-11-25T13:55:20.635Z","url":"https://daily.dev/posts/9dHNfBcVP#c-8x9UyfF94","author":{"@type":"Person","name":"Ernest Oporto","url":"https://daily.dev/ernestoporto","image":"https://media.daily.dev/image/upload/s--5At_l6_K--/f_auto/v1789389230/avatars/avatar_WlGqx4f45NvFnLVg0Bn2R?_a=BAMAMicg0"}}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/webdev","name":"WebDev"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"WebDev","item":"https://daily.dev/squads/webdev"},{"@type":"ListItem","position":3,"name":"How I Deploy Production Next.js + FastAPI Apps on a VPS"}]}
```

