Should I use Turborepo in production or only during build time?

I have two options:

1. Keep turbo on my final image and call

turbo run @myapp#start

2. Remove turbo and just run

bun run start

What’s the best approach and why? Does it matter in any way?

Hey, @pedromigacz! Welcome to the Vercel Community :waving_hand:

You should keep Turbo in your production image and use turbo run @myapp#start.

Turbo provides several benefits even in production.

  • Turbo’s intelligent caching can still be beneficial for production operations
  • If your start command depends on other tasks or has complex dependencies, Turbo handles the orchestration properly
  • Using the same tool across development and production reduces potential issues
  • If you later add production tasks that benefit from Turbo’s features, you’re already set up

The overhead of keeping Turbo in your production image is minimal compared to the benefits. If you’re already using Turborepo for your monorepo setup, it makes sense to leverage it consistently across all environments.

However, if your production start command is truly simple (just starting a single app with no dependencies), option 2 could work fine and would result in a slightly smaller image. But for most cases, the consistency and robustness of option 1 is worth it.

Feel free to let us know more about your set-up and we’re happy to weigh in! Tagging @anthony-shew in case he had any other thoughts to contribute :slight_smile:

1 Like

@pawlean has the right idea - though I’ll add one nuance.

We do not recommend using Turborepo in the calling stack for the final production call that runs the application in production. Turborepo is a build-time tool, not a production runner.

It won’t necessarily hurt to be calling turbo but its not needed, so removing the layer of abstraction should be your preference.

2 Likes

Thank you, I appreciate the welcome and the responses. It for sure helps me understand how everything works around turbo. Is there a way to mark the post as solved?

2 Likes

Just did that for you! Thank you for being part of the community and starting this discussion :slight_smile:

Hey @pedromigacz! Just checking in to see if you still have questions about using Turborepo in production or if you found a solution that works for you. Let me know if you need any more assistance!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.