12 min read
Built a healthcare app with Supabase? Learn how to migrate your application and PostgreSQL database to Scalingo's HDS-certified hosting, including authentication, APIs, and other essential services.

Building a healthcare application has never been easier. With tools like Lovable and Supabase, you can turn an idea into a working prototype in just days, even without extensive technical expertise.
But moving from prototype to production brings new challenges.
Before your application starts handling real patient data, security, authentication, and, in many cases, HDS-certified hosting must be addressed. The tools that helped you get started may no longer meet all your needs.
The good news? You don't have to start from scratch.
With Scalingo, you can migrate your application and PostgreSQL database to a French cloud platform offering HDS-certified hosting, while adapting authentication and other services to your needs.
In this article, we'll outline the main steps of a Supabase-to-Scalingo migration, including which services you may need to move or replace. The detailed implementation depends on how your application was built.
Some steps may require technical adjustments, particularly around authentication and APIs. If you're new to these technologies, and don’t feel comfortable making these changes yourself, you may want to get help from a developer.
Does Your Healthcare App Need HDS-Certified Hosting?
Not every healthcare application requires HDS-certified hosting. So how do you know whether yours does, and when does it become mandatory?
Under French law, HDS-certified hosting is required when personal health data collected as part of prevention, diagnosis, care, or social and medico-social follow-up is hosted by a third party on behalf of the natural or legal persons who originally produced or collected the data, or the patient themselves.
For example:
HDS required: A patient monitoring application hosted by a third-party provider that stores diagnoses, treatment information or medical records on behalf of a healthcare organisation.
HDS generally not required: A fitness application that tracks daily step counts for personal wellness, without using that information for medical purposes.
HDS certification not required for self-hosting: A hospital that hosts and manages its own patients' medical records on its own infrastructure, without outsourcing the hosting activities to a third party.
HDS certification isn't the only requirement. French law also requires patients to be informed before their health data is hosted, with the possibility of objecting on legitimate grounds. The hosting service must also be covered by a written contract.
If you're unsure whether your application falls within the scope of HDS requirements, read our guide to HDS hosting requirements for a more detailed explanation.
Healthcare data hosting requirements vary by country. While France has its HDS certification framework, other countries have their own regulations and security requirements, such as HIPAA in the United States or BSI C5 requirements for certain healthcare cloud services in Germany. If your application operates internationally, you'll need to check which rules apply to your activities and hosting arrangements.
When do you need to migrate?
If HDS requirements apply to your application, the relevant hosting services must have the appropriate certification coverage before you start hosting real patient data. It's not something you can leave until after launch.
For example, you might have built and tested a prototype using Supabase with fictional patient data. But before deploying it for use by a healthcare organisation with real patient records, you need to ensure your hosting arrangement meets the applicable HDS requirements.
You may also need to reconsider your hosting setup if an existing healthcare customer introduces new contractual or compliance requirements.
Why Choose Scalingo for Health Data Hosting?
If you're used to Supabase, you probably don't want to start managing servers just because your application needs HDS-certified hosting. With Scalingo, you can keep the convenience of a managed cloud platform while meeting your healthcare application's hosting requirements.
HDS-Certified Hosting for Your Application and Database
Scalingo is a French cloud provider certified for all six activities covered by the HDS (Hébergeur de Données de Santé) framework, including application hosting, infrastructure management, and outsourced backups.
You can enable HDS coverage when creating your application and PostgreSQL database. Scalingo automatically applies the required infrastructure settings, including high-availability configurations.
This allows you to host your application and database on HDS-certified infrastructure without having to set up and maintain it yourself.
Keep in mind: HDS certification covers the hosting environment, not your entire application. Your team remains responsible for application security, access controls, and the processing of patients' health data.
Keep Things Simple with a PaaS
Scalingo is a Platform-as-a-Service (PaaS) and managed database provider (DBaaS) that takes care of the infrastructure behind your application.
You can deploy your code directly from Git, use managed PostgreSQL databases, and scale your application without having to configure and maintain your own servers.
If you're coming from Supabase, this means you can keep a familiar approach to development: focus on your application rather than the infrastructure running it. Some Supabase services, such as authentication, will need to be replaced or reconfigured though, as we'll explain in the migration steps.
Host Your Data in France under European jurisdiction
Where your healthcare data is hosted matters. But so does who hosts it.
Scalingo is a European cloud provider with hosting regions located in France, allowing you to keep your application and databases on French infrastructure.
This is important as HDS certification doesn't automatically protect data from foreign extraterritorial laws. For example, US providers such as AWS can offer HDS-certified hosting in France while remaining subject to US legislation, including the CLOUD Act.
Choosing a French provider like Scalingo can help reduce this exposure. The provider’s legal structure and subcontractors still matter, so French hosting should not be presented as absolute protection from foreign laws.
—> Learn more about sovereign cloud hosting
No Extra Fees for HDS Certification
Unlike many cloud-hosting providers Scalingo does not charge a separate HDS certification fee or require a dedicated support plan to enable HDS coverage.
An HDS-covered configuration costs the same as an equivalent non-HDS configuration.
Keep in mind that HDS hosting requires a high-availability setup, including at least two web containers and a Business or Enterprise database plan. These requirements affect the total infrastructure cost, but we apply no additional HDS surcharge.
—> See our pricing page to estimate the cost of the eligible resources
How to Migrate from Supabase to Scalingo
The steps below outline the migration path. Our linked tutorials show how to deploy individual components, but adapting your existing code, authentication and integrations may require additional development work.
Identify the Supabase Services Your Application Uses
Before migrating, it's important to understand which Supabase services your application relies on. Moving your PostgreSQL database alone may not be enough to keep everything working, as Supabase also provides authentication, file storage, APIs, Realtime and Edge Functions.
The table below outlines the main Supabase services, what they're used for and their possible alternatives when migrating to Scalingo.
Supabase service | What it does | On Scalingo |
|---|---|---|
Supabase PostgreSQL | Stores your application's data, such as patient records and questionnaire responses | |
Supabase Auth | Manages user accounts and logins | Keycloak deployed on Scalingo |
Supabase database API | Allows your application to read and update database records | PostgREST deployed on Scalingo |
Supabase Storage | Stores uploaded files, such as medical documents or images | Separate compatible storage solution |
Supabase Edge Functions | Runs custom backend code, such as integrations or automated processes | Application code or tasks, depending on the use case |
Supabase Realtime | Updates information in the application when database changes occur, without requiring a page refresh | Requires a separate implementation depending on your needs |
Not every application uses all these services. You only need to plan for the services your application actually uses. Check your Supabase dashboard and application integrations, or ask the person who built the application to review them. PostgREST, Keycloak and replacement storage are options for specific needs, not mandatory components of every migration.
Set Up Your HDS Environment on Scalingo
The next step is to create your application and PostgreSQL database on Scalingo. You can do this while keeping your existing Supabase application running, so you have time to prepare and test everything before switching over.
When creating your application and database, make sure to enable HDS coverage as shown on the screenshot below. This is important because you can't enable it later on resources that were created without it.

As we mentioned, HDS hosting comes with specific infrastructure requirements, such as running your application on at least two containers (instances of your application) and using a High Availability Business or Enterprise database plan.
You don't have to figure out these requirements on your own. Once HDS coverage is enabled, Scalingo automatically enforces the relevant restrictions, preventing you from choosing configurations that don't meet its HDS infrastructure requirements.
For the setup details, see the HDS resource documentation.
Move Your Application and PostgreSQL Database to Scalingo
Once your HDS environment is ready, you can start moving your application and data to Scalingo.
Migrate your app
Scalingo supports a wide range of programming languages and frameworks, allowing you to deploy any existing application directly from Git, Github or Gitlab. Check out our deployment documentation to get started.
If you built your application with Lovable, you can follow our dedicated deployment tutorial to deploy it from GitHub. You will be able to continue editing in Lovable and deploy synced changes to Scalingo!
Whatever tools you used to build your application, you can set up and test your new deployment on Scalingo while keeping your existing version running.
Migrate Your PostgreSQL Database
Now, let's move on to your Supabase database. Since Supabase uses PostgreSQL, you can transfer your existing data to Scalingo for PostgreSQL without having to change database technologies.
Our Supabase database migration guide explains the process, from exporting your Supabase database to importing it into Scalingo. Depending on your Supabase configuration, the export method may vary, so check your project's backup settings before getting started. Some projects may need a fresh logical export rather than a downloadable dashboard backup.
Once your data has been imported, you'll need to connect your application to the new database. Scalingo automatically provides a database connection URL when you attach a PostgreSQL database to your application.
If your application connects directly to PostgreSQL, you can configure it to use this URL. However, if it currently accesses the database through Supabase's API, you'll need to adapt that connection, for example by using PostgREST, as we'll explain later in this article.
Don't forget your uploaded files. If your application uses Supabase Storage, you'll need to transfer those files separately to an appropriate external storage service, as Scalingo doesn't provide a built-in equivalent. For healthcare data subject to HDS requirements, make sure the chosen storage service has the necessary certification coverage.
Configure Authentication After Supabase
If your application currently uses Supabase Auth, moving its database won't automatically migrate the way users sign in. You'll need to replace the authentication integration, update how your application handles sessions and tokens, and make sure existing accounts can still access the correct records.
One option is Keycloak, an open-source identity and access management solution you can deploy on Scalingo. Keycloak can authenticate patients with email and password, offer Google sign-in, and connect healthcare professionals through Pro Santé Connect. Importantly, your application integrates with Keycloak once, using OpenID Connect (OIDC), rather than implementing a different authentication protocol for each login method.
Deploy Keycloak and Connect It to Your Application
Start with our Keycloak deployment tutorial to deploy Keycloak on Scalingo. Please note, this guide covers the deployment process, not the migration of an existing Supabase Auth integration.
Once Keycloak is running, you'll need to configure two components: a realm to manage users and identities, and a client to represent your application.
Create a realm. In the Keycloak Admin Console, create a realm such as
app-auth. A realm isolates user accounts, authentication policies and external identity providers from those used by other applications.Register an OIDC client. Under Clients, create an OpenID Connect client called
scalingo-app. Enable Standard flow (the authorization code flow) and disable Direct access grants, so your application doesn't need to collect users' passwords. Register your application's exact HTTPS callback, such ashttps://my-app.osc-fr1.scalingo.io/auth/callback, under Valid redirect URIs. This restricts where Keycloak can return authentication responses.Choose the appropriate client configuration. A backend application can use Client authentication and a client secret stored server-side. For a browser-only application, disable client authentication and enable PKCE with the
S256method. Configure the permitted Web origins for browser applications.Update your application's authentication settings. Replace the Supabase Auth integration with an OIDC library supported by your framework and configure the following values:
Setting
Example or value
Issuer
https://auth.example.com/realms/app-authClient ID
scalingo-appRedirect URI
https://my-app.osc-fr1.scalingo.io/auth/callbackScopes
openid profile emailFlow
Authorization code
Client secret / PKCE
Client secret for a backend;
S256PKCE for a browser-only app
Here's what happens during sign-in: your application sends the user to Keycloak, Keycloak authenticates them, then redirects the browser back to the registered callback with an authorization code. Your OIDC library exchanges that code for tokens and establishes the application session.
You'll still have to adapt the parts of your code that relied on Supabase Auth for login, logout, sessions and user identity. The precise changes depend on your framework; see the Keycloak application integration documentation.
Set Up Email and Password Authentication
For patients or other users who need a conventional account, Keycloak can manage usernames, email addresses and passwords. In Realm settings → Login, enable login with email, email verification and forgotten-password recovery; disable duplicate email addresses so that an address doesn't refer to multiple accounts.
These settings need an SMTP service under Realm settings → Email: Keycloak uses it to send verification and password-reset messages. You should also define a password policy under Authentication → Policies → Password policy, which will apply when a user creates or changes a password.
Require Two-Factor Authentication for Password Logins
For more protection, you can require time-based one-time passwords (TOTP) alongside the user's password. An authenticator app generates a short code that changes regularly; a common configuration uses six digits and a 30-second validity period.
There is an important distinction between supporting 2FA and requiring it. To make it mandatory for password-based sign-in, you must adapt the authentication flow:
Under Authentication → Policies → OTP policy, configure time-based OTP with six digits and a 30-second period. Make sure the Configure OTP required action is enabled.
Under Authentication → Flows, duplicate the default
browserflow. Keep Username Password Form required; in its Conditional 2FA sub-flow, disable the conditional checks, make the sub-flow and OTP Form required, and disable other second-factor executions in that sub-flow. Bind the copy as the browser flow. This ensures users without an OTP credential are prompted to enroll rather than silently skipping 2FA.Keep the Cookie and Identity Provider Redirector paths available as alternatives. Password-based OTP enforcement should not unintentionally block existing sessions or externally authenticated users.
Password recovery needs attention too. To preserve the OTP credential during recovery, duplicate the reset credentials flow, disable Reset - Conditional OTP in the copy, and enable Force login after reset on Send Reset Email. As a result, users must sign in again with their password and OTP after resetting their password, rather than using recovery to bypass the second factor.
Add Google Sign-In
With Google, Keycloak works as an identity broker: the user chooses Google on Keycloak's login screen, authenticates with Google, and returns to Keycloak. Keycloak then completes its first-login checks and sends the user back to your application through the same OIDC client.
To set this up, add Google under Identity providers in Keycloak. Keycloak displays a callback URL resembling:
Create a Web application OAuth client in Google Cloud and register that exact URL as an authorised redirect URI. Copy the Google client ID and secret back into the Keycloak provider settings.
Set the provider scopes to openid profile email and use Keycloak's first broker login flow to create or link a Keycloak account at the user's first sign-in. Keep Trust Email disabled, and test the email-verification and account-linking journey rather than assuming that any Google email will automatically be trusted. Before production, also complete Google's publication and verification requirements, then test the entire flow in a private browser window.
Connect Pro Santé Connect for Healthcare Professionals
For a healthcare application used by professionals in France, Pro Santé Connect provides a dedicated authentication path. As with Google, the aim is to let Keycloak handle the external identity provider.
You need to request production access from the Agence du Numérique en Santé (ANS) and follow its Keycloak connector instructions. Plan for registration, configuration and testing before launch. The ANS technical documentation (in French) describes the applicable production requirements.
Whichever login methods you choose, test successful and failed sign-ins, email verification, password resets, first-time logins through external providers and user access to their own records before switching production traffic.
Keep in mind that Keycloak isn't a managed service on Scalingo. While Scalingo handles the underlying infrastructure, you'll be responsible for configuring, updating and maintaining Keycloak.
What About Existing Users?
If your application is still a prototype without real users or data to preserve, you can skip account migration.
If your application already has users, you will need to decide whether to migrate their account information or ask them to register again. Either approach requires a secure plan for any existing records linked to those accounts.
For example, if your users currently sign in with email and password, one approach is to export their email addresses and user IDs from Supabase and use Keycloak's Admin REST API to create corresponding accounts. Since passwords cannot simply be transferred in plain text, you can ask users to set a new password. Users authenticating through external providers may require a different approach.
You'll also need to preserve the connection between users and their existing data. For example, if patient records are associated with Supabase user IDs, developers can create a mapping between those IDs and the new Keycloak user IDs. They'll then need to update the application's database queries and access control rules to ensure each user can still access only their own records.
This process isn't an automatic migration and requires development work. Our Keycloak deployment tutorial covers the initial setup, but not these migration steps.
Before switching to the new system, test the migration using a few accounts. Check that users can sign in, access their existing information and cannot access records belonging to someone else
Reconnect the API and Other Services
Preserve Access Controls with PostgREST
Supabase automatically generates a REST API from your PostgreSQL database using PostgREST. If your application relies on this API, you can deploy PostgREST on Scalingo by following our step-by-step demo, which shows how to deploy and configure it with PostgreSQL and Keycloak.
In the demo example, Keycloak handles user authentication and issues an access token. PostgREST verifies the token, while PostgreSQL uses database roles and Row-Level Security (RLS) to control which data each user can access or modify.
When migrating from Supabase, you'll need to adapt your application's existing API calls and access control rules to work with the new setup, particularly any rules relying on Supabase-specific functions such as auth.uid().
Before going live, test with different user accounts to make sure each person can only access or modify the information they're authorized to.
Migrate Background Tasks and Edge Functions
If your application uses Supabase Edge Functions to run backend code, you'll need to decide how to handle these functions after migrating to Scalingo.
The right solution depends on what each function does. For example, tasks that take some time to complete, such as generating a medical report or processing documents, may suit Scalingo's on-demand one-off tasks.
These tasks run your application code in a temporary container and may take a few seconds to start. They're therefore better suited to longer operations than actions requiring an immediate response.
For functions that need to respond quickly, you can instead run the code as part of your application's backend on Scalingo. The best approach will depend on how your application is built. Also If your application relies on Supabase Realtime, you will need to plan a separate replacement.
Go Live on Scalingo
After checking that your application works correctly in its new environment, you are now ready to switch your application to Scalingo.
If you already have users, let them know when the migration will take place, whether they'll need to sign in again and where to get help if they encounter problems.
After switching, test the application's essential features once more before shutting down your previous Supabase services. Confirm that no remaining application components still depend on them.
Ready to Migrate?
If you're considering the move, contact our team to discuss your current architecture, the Supabase services you use and your HDS hosting requirements. We can help you identify which Scalingo services fit your project.
FAQ
Can GoTrue be deployed on Scalingo?
GoTrue can be deployed on Scalingo, but it requires modifying its database migration files to work on our platform. These changes can introduce compatibility and maintenance issues, which is one of the reasons we recommend using Keycloak instead.
Can we use BYPASSRLS and SECURITY DEFINER functions?
You can use
SECURITY DEFINERfunctions , but theBYPASSRLSattribute is not available because it requires superuser privileges.Is Supabase suitable for hosting healthcare data in France?
Supabase can be used to develop and test healthcare applications, but hosting real patient data in France may require HDS-certified infrastructure, depending on the nature and use of the data. While Supabase supports GDPR-compliant deployments and offers HIPAA-related controls, these do not replace French HDS certification. If your application falls within HDS requirements, Scalingo provides HDS-certified hosting for your application and PostgreSQL database.

Samir Akarioh
Samir is DevRel at Scalingo, a role that combines marketing and tech, two subjects he is passionate about. His goal? To share his knowledge with developers and Scalingo users.
Stay Updated
Get articles and platform updates in your inbox.
Ready to Deploy with Confidence?
Experience zero-downtime deployments, intelligent auto-scaling, and fully managed infrastructure. Start deploying your applications on Scalingo today.
No credit card required • Deploy in minutes • Cancel anytime




