
Selfhost Open Lovable
Open Lovable isn't just a simple script; it's a "stack" that uses several services to perform its magic
"Open Lovable" is a fantastic example of a modern, open-source project that puts the power of AI-driven development into your hands. This project lets you clone websites and turn them into modern React apps, giving you a powerful starting point for your own projects. Let's walk through how to get it set up and running locally.
The Core Concept of Open Lovable
Before we dive in, it's important to understand the components. Open Lovable isn't just a simple script; it's a "stack" that uses several services to perform its magic:
-
Firecrawl: This service is used to scrape and convert websites into clean, structured data that an AI can understand.
-
An AI Provider: You'll use your own API keys for an AI model from a provider like Groq (which is very fast), OpenAI, or Anthropic. This is the "brain" that generates the React code.
-
E2B Sandbox: This provides a secure, cloud-based environment to execute the generated code. This is a critical security feature that prevents malicious code from running directly on your machine.
-
Next.js: The entire Open Lovable application is a Next.js frontend, providing the user interface to interact with these services.
How to Build Your Own Open Lovable
The great thing about this project is that the setup is straightforward, thanks to its npm and git-based workflow.
Step 1: Clone the Repository and Install Dependencies
The first step is to get a copy of the project's source code from GitHub and install all the necessary packages.
-
Open your terminal.
-
Clone the repository:
git clone https://github.com/mendableai/open-lovable.git
-
Navigate into the new directory:
cd open-lovable
-
Install the Node.js dependencies. This command will read the package.json file and download everything the project needs to run:
npm install
Step 2: Configure Your API Keys
Open Lovable needs to connect to the external services we discussed. You'll store your API keys in a local environment file.
-
In the project's root directory, create a new file named
.env.local. -
Add your API keys to this file. Crucially, do not commit this file to a public repository!
# Required services E2B_API_KEY=your_e2b_api_key_here FIRECRAWL_API_KEY=your_firecrawl_api_key_here # Optional AI providers (you must include at least one) # The Groq API is very fast and recommended for beginners GROQ_API_KEY=your_groq_api_key_here # ANTHROPIC_API_KEY=your_anthropic_api_key_here # OPENAI_API_KEY=your_openai_api_key_here -
Go to the websites for each service (E2B, Firecrawl, and your chosen AI provider) to get your free API keys. The free tiers for these services are more than sufficient for getting started.
Step 3: Run the Application
With the code and your keys in place, you can now start the application.
-
Run the development server from your terminal:
npm run dev
-
Open your web browser and navigate to
http://localhost:3000.
You should see the Open Lovable interface. You're now ready to start generating!
Your First Project: Cloning a Website
Now for the fun part. Let's try cloning a simple website.
-
In the Open Lovable UI, you'll see an input field. Enter the URL of a website you want to clone, like
https://example.com. -
In the prompt, tell the AI what you want it to do, for example: "Recreate this website as a modern React app with a dark theme."
-
The workflow will now begin: Firecrawl will scrape the site, the AI will generate the React code, and the E2B sandbox will show you a live preview of the generated code.
-
Once the process is complete, you can download the generated React code and run it locally with
npm startto have a full, working copy of your new website.
This is a great, beginner-friendly way to see how multiple modern web development tools and AI can be combined to create powerful automations.

