Deploying and hosting outside Lovable
You can take your code out of Lovable and run your app on your own web host or servers. How you host it depends on whether your project runs purely in the browser or needs a server to handle pages.
Teams or developers who need to move their production app to their own hosting platform, custom domain setup, or company servers.
Do this, in order
- 1
Check which framework your app uses by looking for @tanstack/react-start in package.json or asking Lovable in chat.
TanStack Start apps require a platform that runs a server, while older React and Vite apps only need static file hosting.
- 2
Connect your Lovable project to a Git repository using Git sync.
This gives your hosting platform access to your code and keeps your changes synchronized automatically.
- 3
Connect your Git repository to your chosen hosting provider (such as Vercel, Netlify, Cloudflare Pages, or Docker).
Your hosting provider needs to pull the source code to run the build process.
- 4
Configure the build command to npm run build, select Node.js 22, and set the publish directory (dist for static apps or Netlify/Cloudflare, automatic for Vercel).
The hosting provider needs these exact instructions to transform your code into working files.
- 5
Copy the required environment variables from your project's .env file into your hosting provider's settings panel.
Your app will fail to load or connect to its database and authentication if these keys are missing at build time.
- 6
If your app uses sign-in or social login, add your new hosting URL to your authentication provider's allowed redirect settings.
Logins will be rejected if the authentication system does not recognize your new web address.
- 7
Trigger a deployment and verify that pages, routes, and backend connections work properly.
Testing before switching users prevents downtime and catches missing variables or routing mistakes.
Paste this into your project
Which framework stack does this project use (older React + Vite or TanStack Start), and what exact environment variables and build settings do I need to copy when hosting it on my own platform?
Words decoded
- Static hosting
- A web hosting service that only delivers pre-built files (HTML, CSS, images) directly to visitors without running code on a server.
- Environment variables
- Secret keys and configuration values stored outside your code so your app can securely connect to external services.
- Reverse proxy
- A server that sits in front of your app to accept visitors, handle security certificates, and pass requests to your backend.
- Nitro
- A build tool that packages server code so it can run seamlessly across different hosting providers without rewriting code.
Where people get stuck
- Trying to host a TanStack Start app on static storage or a CDN alone: it will fail because it requires a server runtime.
- Forgetting that browser environment variables (prefixed with VITE_) are embedded at build time, meaning you must rebuild your app whenever you change them.
- Neglecting to configure Single Page Application (SPA) routing fallbacks on static hosts, which causes direct page reloads to show 404 errors.
- Forgetting to update OAuth redirect URLs, which completely breaks user sign-in on the new address.
The short version, steps, decoder and prompt on this page are written automatically from Lovable's own documentation and can lag or misread it. The official page is always the authority.