Deploying Lovable Projects on Scalingo
Lovable is an AI app builder that helps you create web applications from natural language prompts. It generates frontend code built with the Vite, Nitro and TanStack frameworks.
Planning your Deployment
-
Sizing your application vastly depends on your use-case and the amount of traffic it needs to handle. We usually recommend to start with an M container, and adjust later depending on the metrics of your application.
-
If your project uses a database (e.g. Supabase), you may want to also migrate it to Scalingo. We usually advise to opt at least for a PostgreSQL® Starter or Business 512 addon for this purpose, and change for a bigger plan later if need be.
Migrating your Application
- On your workstation, clone your GitHub repository:
git clone <url_of_your_repo> - Create the application on Scalingo:
scalingo create my-app - Create a
Procfileat the root of your project with the following content:web: node .output/server/index.mjsThis instructs the platform to start the Node.js server generated by
Nitro. The server listens on the port provided by thePORTenvironment variable. -
Configure Vite to build a Node.js server for production. In your
vite.config.ts, add the Nitro node-server preset:import { defineConfig } from "@lovable.dev/vite-tanstack-config"; export default defineConfig({ nitro: { preset: "node-server", }, });If your
vite.config.tsfile already contains other options, keep them and only add the nitro section. - Commit and push the files you just updated:
git add vite.config.ts Procfile git commit -m "Migrate to scalingo" git push - Deploy to Scalingo:
git push scalingo
Migrating your Supabase Database to Scalingo
If your Lovable project uses Supabase, you may also want to migrate your database to Scalingo.
Dumping your Lovable Database
To download a backup from the Supabase dashboard:
- Open your Supabase project.
- Go to Database in the left sidebar.
- Navigate to the Backups section.
- Download the latest available backup file.
You can also use the Supabase CLI to create the database dump. To do so, please follow Supabase’s instructions.
Importing your Database to Scalingo
Once the backup is downloaded, import it into your Scalingo PostgreSQL database by following the Scalingo PostgreSQL documentation.
Updating your Application
If you update your project from Lovable later, the changes will be sync with your GitHub repository, make sure the following files still contain the changes described in this tutorial:
Procfilevite.config.ts
If necessary, reapply the changes, then commit and push them:
git add vite.config.ts Procfile
git commit -m "Update Lovable project for Scalingo"
git push
And deploy on Scalingo:
git push scalingo