Skip to main content
Prisma Documentation Docs

Search documentation

Type to search this documentation.

On this pageOverview

Deploy to Fly.io (Prisma ORM v7) (/docs/orm/v7/prisma-client/deployment/traditional/deploy-to-flyio)

For the complete Prisma documentation index, see llms.txt. A markdown version of any docs page is available by appending .md to its URL.

Learn how to deploy a Node.js server that uses Prisma ORM to Fly.io

Location: ORM > v7 > Prisma Client > Deployment > Traditional > Deploy to Fly.io

This guide explains how to deploy a Node.js server that uses Prisma ORM and PostgreSQL to Fly.io.

The Prisma Render deployment example contains an Express.js application with REST endpoints and a simple frontend. This app uses Prisma Client to fetch, create, and delete records from its database. This guide will show you how to deploy the same application, without modification, on Fly.io.

fly.io is a cloud application platform that lets you deploy and scale full-stack applications that start on request, on machines near your users. For this example, it's helpful to know:

  • Fly.io lets you deploy long-running, "serverful" full-stack applications in 35 regions around the world. By default, applications are configured to auto-stop when not in use, and auto-start as needed as requests come in.
  • Fly.io natively supports a wide variety of languages and frameworks, including Node.js and Bun. In this guide, we'll use the Node.js runtime.
  • Fly.io can launch apps directly from GitHub. When run from the CLI, fly launch will automatically configure applications hosted on GitHub to deploy on push.
  • Sign up for a Fly.io account

Download the example code to your local machine.

Bash
curl https://codeload.github.com/prisma/prisma-examples/tar.gz/latest | tar -xz --strip=2 prisma-examples-latest/deployment-platforms/render
cd render

Before deploying, review the example code.

The logic for the Express app is in two files:

  • src/index.js: The API. The endpoints use Prisma Client to fetch, create, and delete data from the database.
  • public/index.html: The web frontend. The frontend calls a few of the API endpoints.

The Prisma components of this app are in three files:

  • prisma/schema.prisma: The data model of this app. This example defines two models, User and Post. The format of this file follows the Prisma schema.
  • prisma/migrations/<migration name>/migration.sql: The SQL commands that construct this schema in a PostgreSQL database. You can auto-generate migration files like this one by running prisma migrate dev.
  • prisma/seed.js: defines some test users and postsPrisma, used to seed the database with starter data.

Your web service will be live at its fly.dev URL as soon as the deploy completes. Optionally scale the size, number, and placement of machines as desired. fly console can be used to ssh into a new or existing machine.

More information can be found on in the fly.io documentation.

  • Deploy to Heroku: Learn how to deploy a Node.js server that uses Prisma ORM to Heroku
  • Deploy to Koyeb: Learn how to deploy a Node.js server that uses Prisma ORM to Koyeb Serverless Platform
  • Deploy to Railway: Learn how to deploy an app that uses Prisma ORM and Prisma Postgres to Railway
  • Deploy to Render: Learn how to deploy a Node.js server that uses Prisma ORM to Render
  • Deploy to Sevalla: Learn how to deploy a Node.js server that uses Prisma ORM to Sevalla
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu