The monorepo deployment problem
Monorepos solve real development problems: shared code, atomic cross-package changes, one place for CI config. But they create a specific deployment challenge: one repository, many deployable units. A typical monorepo might hold a web frontend, an API, a worker, and three shared libraries. The deployment platform needs to answer:
- 1Which directory is this service? (
apps/apivsapps/web) - 2When do I rebuild? Ideally only when *this* service or its dependencies changed — not on every commit.
- 3How do I install shared workspace dependencies? (
packages/uiconsumed byapps/web) - 4How do I run multiple services from one repo with separate scaling and env vars?
A platform that nails these turns a monorepo from a deployment headache into a superpower. One that doesn't makes you rebuild everything on every push.
The two hard parts: root directory and affected builds
Root / base directory
The platform must let you set a service root directory so it builds apps/api independently. Without this, you can't deploy more than one app from a repo. Every serious platform supports this now; verify how.
Build only what changed
The efficiency win is affected-only builds — rebuild a service only when its files or dependencies changed. Tools like Turborepo and Nx compute the dependency graph and cache build outputs so unchanged packages aren't rebuilt:
# Turborepo: build only what changed since main
turbo run build --filter='...[origin/main]'
# Nx: run targets only for affected projects
nx affected --target=buildPair these with your platform's build settings (ignore-build conditions / watch paths) so a change to apps/web doesn't trigger a rebuild and redeploy of apps/api.
The platforms
Vercel and Netlify
Strong monorepo support for frontend-heavy repos: per-project root directories, ignored-build-step scripts, and Turborepo integration for caching. If your monorepo is mostly Next/React/Astro apps, these are very smooth. The trade-off is they're frontend/serverless-oriented; long-running backend services and workers fit less naturally.
Render and Railway
Both let you create multiple services from one repo, each with its own root directory, build command, and env vars, plus watch paths so a service only rebuilds on relevant changes. Good for mixed frontend + backend + worker monorepos.
Nx Cloud / Turborepo remote cache
Not hosts, but worth naming: remote build caching dramatically speeds monorepo CI/CD by sharing cached artifacts across machines. Layer these *under* whatever host you choose.
PandaStack
Disclosure: my platform. PandaStack handles monorepos by letting each service point at its own root directory within the repo, with its own build, framework auto-detection, env vars, and scaling. Because PandaStack supports both container apps and static sites, a single monorepo can deploy, say, a static React frontend and a containerized API as separate services from the same repo:
my-monorepo/
apps/
web/ -> PandaStack static site (root: apps/web)
api/ -> PandaStack container app (root: apps/api)
packages/
ui/ -> shared, built via workspace installThe install command is overridable (npm/yarn/pnpm/bun), which matters because monorepos almost always use workspaces — set pnpm install at the repo root so workspace packages resolve. Each service gets live build/app logs, and a shared managed database can be attached with DATABASE_URL injected into whichever services need it.
Honest limits: PandaStack doesn't (today) ship a built-in affected-graph build orchestrator the way a Turborepo/Nx-native pipeline does — you get per-service root directories and builds, and you combine them with Turborepo/Nx for graph-aware caching. It's a newer platform with a growing ecosystem.
Patterns that keep monorepo deploys sane
- Set explicit root directories per service from day one.
- Use watch/ignore paths so unrelated changes don't trigger every service.
- Install at the workspace root so shared packages resolve; don't
npm installinside a sub-app that depends on a sibling package. - Adopt Turborepo or Nx for affected detection and caching — it pays off as the repo grows.
- Version env vars per service, not per repo —
apps/apiandapps/webneed different config.
References
- [Turborepo documentation](https://turborepo.com/docs)
- [Nx documentation](https://nx.dev/getting-started/intro)
- [pnpm workspaces](https://pnpm.io/workspaces)
- [Vercel monorepo guide](https://vercel.com/docs/monorepos)
- [Turborepo filtering](https://turborepo.com/docs/crafting-your-repository/running-tasks)
---
Deploying a monorepo with a static frontend and a containerized API? PandaStack lets each live as its own service from one repo, with a shared database wired in. Try it free at [dashboard.pandastack.io](https://dashboard.pandastack.io).