# How to Deploy Bolt.new Apps With xCloud

> Deploy a Bolt.new app on your own server with xCloud: push the project to GitHub, let xCloud detect Vite, add your .env values and redeploy on every push.

You can host an app you built in **Bolt.new** on your own server with **[xCloud](/)**. Connect the Bolt project to GitHub, then create a site with **Deploy via Git**. xCloud reads the repository, recognizes the framework (for example Vite with React), builds the app and serves it with free SSL. After that, every change Bolt commits to GitHub can publish a new version.

This guide uses a real Bolt.new export: a Vite and React project with Bolt's `.bolt` folder in its repository.

## Before you begin

- A Bolt.new project that runs in Bolt without errors.
- A GitHub account to hold the project's code.
- An xCloud server with the **Nginx** or **OpenLiteSpeed** stack. You can also create one during these steps.
- For a private repository, [connect GitHub to xCloud](/docs/how-to-integrate-a-git-provider-with-xcloud/) first. A public repository needs no setup.

Looking for the self-hosted Bolt editor instead? That is **bolt.diy**, a separate One Click App. See [bolt.diy hosting](/bolt-diy-hosting/).

## Step 1: Push your Bolt.new project to GitHub

In Bolt, open your project and click the **GitHub icon** in the top-right corner. Click **Log in to GitHub**, **Authorize** and **Install the GitHub App**, then enter a repository name and click **Create repository**. Bolt's [GitHub guide](https://support.bolt.new/integrations/git) has the full steps.

The new repository is private and starts on the `main` branch. From then on, Bolt creates a commit for each change that doesn't break the project, so your repository stays up to date.

## Step 2: Open Deploy via Git

In xCloud, open **Sites** and click **Add New Site**. On **What would you like to host today?**, click the **Deploy via Git** card.

![Click the Deploy via Git card on the "What would you like to host today?" screen in xCloud](/_landing/docs/deploy-bolt-new-applications-with-xcloud-image-1.png)

There is no separate Bolt.new card. A Bolt project is a normal JavaScript project, and Deploy via Git detects its framework from the code.

## Step 3: Pick the server

Under **Where should it run?**, click the server for your app, then click **Continue**. If you have no Nginx or OpenLiteSpeed server yet, choose **Deploy on a new server** and xCloud brings you back here once the server is ready.

![Select a server under "Where should it run?" and click Continue](/_landing/docs/deploy-bolt-new-applications-with-xcloud-image-2.png)

## Step 4: Add your repository

In **Deploy Any App From Git**, click the tab with your connected GitHub account name (it says **Private Repository** until you connect one) and pick the repository. For a public repository, stay on **Public Repository**, paste its URL and press Enter.

xCloud reads the repository and shows what it found. For a Bolt project made with Vite, you see **Native app** with a **Vite** label, and **App Type** is set to **Node.js**.

![xCloud detects the Bolt.new repository as a Native app with the Vite label](/_landing/docs/deploy-bolt-new-applications-with-xcloud-image-3.png)

Detection is a suggestion. If your project uses another framework, check the label before you go on. A Bolt project built with Next.js shows a Next.js label; follow [Deploy a Next.js App on xCloud](/docs/deploy-nextjs-app-on-xcloud/) for its settings.

## Step 5: Check domain, branch and build settings

Keep the free **Staging domain (no DNS)** to test first, or click **Use a live domain instead** to use your own domain. Check that **Branch** is the branch Bolt pushes to, usually `main`.

Under **Build & serving**, **Serving mode** is **Static build** and **Web root** is `dist` for a Vite app. Leave them as they are. No Node.js process runs after the build: the web server serves the built files.

![Build & serving shows Static build with dist as the web root for the Bolt.new app](/_landing/docs/deploy-bolt-new-applications-with-xcloud-image-4.png)

Turn on **Release mode (zero-downtime deploys)** if you see it (Nginx servers) to be able to go back to an earlier version in one click.

## Step 6: Add your environment variables

Bolt keeps values such as your database address and public key in the project's `.env` file. Check whether that file is in your GitHub repository. If it isn't, your app needs those values in xCloud before it builds.

Click **Advance** and paste them into **Environment file (.env)**, one per line. For a Vite app, only names that start with `VITE_` reach the code in the browser (see the [Vite guide to env variables](https://vite.dev/guide/env-and-mode)).

![Paste VITE_ values into the Environment file (.env) field under Advance](/_landing/docs/deploy-bolt-new-applications-with-xcloud-image-5.png)

Never put a secret key in a `VITE_` variable: Vite copies it into files every visitor downloads. Bolt keeps real secrets for its server functions outside the project, and those stay on Bolt. To change values after the first deploy, see [environment variables (.env) and Git deployments in xCloud](/docs/environment-variables-and-git-deployments-in-xcloud/).

## Step 7: Deploy and check the app

Check the **Summary** and click **Deploy**. xCloud pulls your code, installs the dependencies, runs `npm run build` and publishes the `dist` folder. When it finishes, open **Deployments** on the site. The latest deployment shows **LIVE**.

![The Deployments page shows the first Bolt.new deployment as LIVE](/_landing/docs/deploy-bolt-new-applications-with-xcloud-image-6.png)

Click **Visit Site** to open the app. Client-side routes work too: when a visitor opens a path such as `/about` that is not a real file, xCloud serves your `index.html` and your router loads the page.

## If the build fails

Open the failed deployment on the **Deployments** page and read **Build steps** to see which step stopped. Common causes for a Bolt project:

- **A type check error.** Some projects run `tsc` before `vite build`. Fix the error in Bolt, let it commit, and deploy again.
- **A missing environment variable.** The app builds but shows a blank page or can't reach its database. Add the missing `VITE_` value in **Environment file (.env)** and click **Deploy Now**.
- **The wrong Node.js version.** If a dependency needs a newer Node.js, see [How to Change Node Version with xCloud](/docs/how-to-change-node-version-with-xcloud/).

[Troubleshooting Git Deployments](/docs/troubleshooting-git-deployments-stuck-failed-or-not-triggering/) covers deployments that are stuck or don't start on push.

## Keep the site in step with Bolt

Once the site is live, you can keep building in Bolt:

1. Turn on **Auto-deploy on push (webhook)** for repositories from a connected Git provider. xCloud can add the webhook for you when your GitHub account has admin access to the repository.
2. Keep working in Bolt. Each commit Bolt makes on the deployed branch starts a new build and publishes it.
3. To deploy without a new commit, click **Deploy Now** at the top of the site.

Your data doesn't move. If the app uses Bolt Database, it keeps running on Bolt's side, and your xCloud site connects to it with the values from Step 6.

## Add your own domain and SSL

If you started on a staging domain, add your own domain from the site's **Domain** menu, point its DNS to your server, and xCloud sets up a free SSL certificate. [How to Deploy Git Projects in One Click with xCloud](/docs/deploy-git-projects-in-one-click-with-xcloud/) shows the DNS options. For more on how xCloud builds Vite projects, see [How to Deploy a Vite App from Git on xCloud](/docs/deploy-vite-app-on-xcloud/). Built your app in Lovable instead? See [How to Deploy Lovable Applications with xCloud](/docs/deploy-lovable-applications-with-xcloud/).

## Frequently asked questions

### Does xCloud have a Bolt.new option in the app list?

No. A Bolt.new project is a normal JavaScript project in a Git repository, so you deploy it with Deploy via Git. xCloud reads package.json and picks the settings for the framework it finds, such as Vite or Next.js.

### Do I need a Node.js process running for a Bolt.new app?

Not for a Vite app. xCloud runs npm run build during each deploy and the web server serves the built files from dist. A Next.js app that renders pages on the server does run as a Node.js process.

### Will my Bolt Database still work after I move the app to xCloud?

xCloud hosts your app's files. Bolt Database and Bolt's server functions stay where they are, and your app keeps connecting to them with the values in your .env file. Copy those values into the Environment file (.env) field in xCloud if they are not in your repository.

### How do changes I make in Bolt reach my xCloud site?

Bolt commits each working change to your GitHub repository. Turn on Auto-deploy on push (webhook) in xCloud, and every new commit on the deployed branch builds and publishes a new version. You can also click Deploy Now on the site.

That's it! Your Bolt.new app is live on your own server and updates whenever Bolt pushes a change.

Still stuck? Contact our **[dedicated support team](/docs/access-built-in-support-portal-in-xcloud/)** for any of your queries.
