Setting up a custom domain
When you create a project, Lovable makes it easy to publish it with the click of a button.
If you want to have a custom domain, see below.
Using Netlify
You can host on Netlify for free with a custom domain.
The steps are:
- Create a Github repository: Open your project in Lovable and click GitHub then “create repository” if you haven’t already done so.
- Grab the URL of your Github repository
- Go to: https://app.netlify.com/start/deploy?repository=REPLACE_WITH_GITHUB_REPOSITORY_URL and follow instructions
- Configure a custom domain for your Netlify site, instructions here
Using Vercel
-
Create a Github repository: Open your project in Lovable and click GitHub then “create repository” if you haven’t already done so. This will commit your code to the
main
branch and create a repository. Once you do this, all changes made to code in your app will automatically be commited to your Github repository on each change. -
Set up Vercel: Go to the Vercel website and create an account. Configure your domain and set the necessary GitHub permissions (make sure to handle DNS settings properly).
-
Automatic deployments: Vercel will automatically deploy the latest changes from the
main
branch each time it is updated. You can make one or two small changes to your app on Lovable and then visit Vercel deployments to ensure updates are being redeployed frommain
. Once confirmed, do the next step: -
Create a Development branch: In your GitHub repository settings in Lovable, commit all new changes to a second branch called
dev
(or whatever you want). -
Configure Vercel Builds: Go back to Vercel and adjust your settings to ensure it only builds production deployments from the
main
branch.
-
Make changes in Development: Work on your app in the Lovable. Any changes will go to the
dev
branch now and wont automatically be deployed via Vercel. -
Deploy new changes: When you’re ready to push new changes to your domain, go to GitHub and perform a pull request from
dev
todev
. Once you complete and merge the pull request, Vercel will automatically deploy the updates in about one minute.
Notes:
- If you hit the 100/day deployment limit in Vercel (it builds your
dev
branch but doesn’t deploy it). You can ask Lovable chat to build you vercel.json file which will force Vercel to not build development builds at all. - Supabase Consideration: Currently, you can only utilize one Supabase instance. So, if you make extensive SQL changes, it could potentially break production. Unfortunately, we can’t yet provide specific guidelines for this scenario as it’s complex. Frequently test your production environment if you make changes related to Supabase.