How to create and import a Lovable website on an OVHcloud VPS

Bazy wiedzy

How to create and import a Lovable website on an OVHcloud VPS


Icons/System/eye-open Created with Sketch. 250 wyśw. 18.08.2025 Cloud / Prywatne serwery wirtualne

Objective

Lovable is a tool you can use to generate websites from prompts. This guide explains how to import and publish a website generated via Lovable on an OVHcloud VPS.

Requirements

Instructions

Summary

Step 1: Build your website on Lovable.dev

  1. Go to https://lovable.dev.
  2. Create an account if you have not already done so.
  3. Enter your prompt to build your website.

Step 2: Export your website via GitHub and retrieve it

Once your website has been generated by Lovable, export it via GitHub. In the main Lovable interface, click on the GitHub icon (Sync your project to GitHub) in the top-right corner.

hosting

To connect your Lovable account to GitHub, follow the official documentation for Lovable.

Once the process is complete, a new repository containing your website’s code is present in your GitHub account.

From this GitHub repository, perform the following actions:

  1. Click Code then Download ZIP.
  2. This downloads a .zip file containing your project.
  3. Unzip it.

Step 3: Upload the archive to the VPS

In your terminal (where the .zip file is located), use this command:

scp my_website.zip <user>@<VPS_IP>:~

Replace:

  • my_website.zip by the name of the file downloaded from Lovable
  • <user> by your root username (e.g. debian, root, etc.)
  • <VPS_IP> by the public IP address or DNS name of your VPS

~ refers to the user's home directory.

Step 4: Install Node.js and the necessary tools

Log in to your VPS via SSH:

ssh <user>@<VPS_IP>

To build a Lovable website, you must compile the React project into an optimized version using the npm run build command. To do this, you will need the following elements on the VPS:

  • Node.js: The JavaScript environment required to run React.
  • npm: The JavaScript package manager that installs project dependencies.
  • curl: Allows you to download the Node.js installation script.
  • unzip: Used to extract the .zip archive from the exported site from Lovable.

Run these commands:

sudo apt update
sudo apt install curl unzip -y
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo bash -
sudo apt install -y nodejs

Verify the installation:

node -v
npm -v

Step 5: Unzip and build your website

Unzip the .zip archive into a destination folder (e.g.: lovable-src):

unzip my_website.zip -d lovable-src

Enter the destination folder:

cd lovable-src/my_site

Install the necessary dependencies:

npm install

This will install all React/Lovable libraries defined in the package.json file.

Generate optimized files (production build):

npm run build

This creates a dist/ folder containing the minified HTML, CSS and JS files.

Step 6: Deploy your website

Create the public folder:

sudo mkdir -p /var/www/lovable
sudo cp -r dist/* /var/www/lovable/

Step 7: Install and configure the web server

For this guide, we choose NGINX, but you are free to install the web server of your choice.

Install NGINX:

sudo apt install nginx -y

Create a configuration file for your website:

sudo nano /etc/nginx/sites-available/lovable

Paste the following content:

server {
    listen 80;
    server_name VPS_IP;

    root /var/www/lovable;
    index index.html;

    location / {
        try_files $uri /index.html;
    }
}

Replace VPS_IP with your VPS IP address or domain name.

Enable this configuration:

sudo ln -s /etc/nginx/sites-available/lovable /etc/nginx/sites-enabled/
sudo nginx -t

Restart NGINX to apply the configuration:

sudo systemctl start nginx

If the service is already active, use:

sudo systemctl reload nginx

Step 8: Access your website

In your browser, enter:

http://VPS_IP

or:

http://DOMAIN_NAME

Your Lovable website will then appear.

Conclusion

In just a few minutes, you built your website with Lovable, then put it online on your OVHcloud VPS. If you would like to secure it with HTTPS, please follow our guide on Installing an SSL certificate on a VPS .

Go further

Install a web development environment on a VPS

Secure a VPS

For specialized services (SEO, development, etc.), contact the OVHcloud partners

Join our community of users.

Powiązane artykuły