How to deploy bolt.new applications to your Hostinger VPS

Getting started with bolt.new tool on your VPS

Updated 2 weeks ago

Deploying your Bolt.new application to a Hostinger VPS is straightforward. Follow this step-by-step guide to get your site up and running quickly.

We also prepared a video tutorial for deploying your bolt.new application.

Step 1 – Create and download your application in bolt.new.

Bolt.new homepage with prompt box and app template buttons for building web apps

For this guide, we will use their suggestion for creating a Vitepress application, but the process should be similar to all projects.

Bolt editor showing StackBlitz project import and terminal running npm install

Once the code is generated, you can download the source code with a single click. Simply click the Download button located in the top-right corner, and a ZIP file will be downloaded for you.

Bolt editor with the Download button highlighted in the top toolbar

Step 2 – Install Ubuntu 24.04 with CloudPanel in Hostinger

Hostinger VPS Change OS dialog with Ubuntu 24.04 with CloudPanel selected

Step 3 – Access your CloudPanel account

Enter https://your_vps_ip:8443/

Replace your_vps_ip with the IP address of your VPS.

Enter the login credentials provided during the CloudPanel setup:

VPS login screen with username field filled as admin and Log In button

Once logged in, navigate to the “Sites” tab.

Click “Add Site” and select Node.js.

CloudPanel Sites page with the + Add Site button highlighted

Enter your domain (e.g., domain.tld) and complete the setup.

Hostinger VPS new Node.js site form with domain, Node 22 LTS, port 3000, and Create button

Note: You can use your hostname as your domain name for this guide

Step 4 – Upload Your Source Code

  1. Go to your newly created site by clicking on the “Manage” button.

  2. Open the File Manager in CloudPanel.

  3. Navigate to /htdocs/your_domain_name/

  4. Upload your downloaded source code .zip file here and extract it. Make sure all files are in your_domain_name folder.

Step 5 – Install Dependencies

  1. Connect to your VPS via SSH:

    ssh example@your_vps_ip

  2. Navigate to your project directory:

    cd /home/your_username/htdocs/your_domain_name/

  3. Install Node.js dependencies:

    npm install

Step 6 – Build the Application

  1. Run the build command to generate static files:

    npm run build

  2. Install the serve package globally:

    npm install -g serve

  3. Use PM2 to keep the server running:

    npm install -g pm2
    pm2 start "serve ./docs/.vitepress/dist" --name "vitepress"
    pm2 save
    pm2 startup

  4. Check Your Application
    Open your domain in a browser (e.g., http://domain.tld) to confirm the application is running.

Step 7 – Enable SSL (Optional)

  1. In CloudPanel, go to the SSL/TLS tab.

  2. Click ActionsNew Let’s Encrypt Certificate.

  3. Verify that SSL is installed by visiting your domain via HTTPS (e.g., https://domain.tld).

That’s It!

Your Bolt.new application is now live on your Hostinger VPS. 🎉