> ## Documentation Index
> Fetch the complete documentation index at: https://www.orionjs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploying

> How to deploy your Orionjs application

Orionjs comes with a built-in CLI tool that helps you start your application in production mode.

## Deploying with Bun (Default)

Bun runs TypeScript directly, so no build step is needed.

1. **Install dependencies**
   ```bash theme={null}
   bun install
   ```

2. **Start the server**
   ```bash theme={null}
   bunx orion prod
   ```
   This will run `bun ./app/index.ts` directly in production mode.

## Deploying with Node.js

When deploying with Node.js, the CLI will automatically build your app before starting.

1. **Install dependencies**
   ```bash theme={null}
   npm install
   ```

2. **Start the server**

   ```bash theme={null}
   npx orion prod --node
   ```

   This will compile the app with esbuild and then run `node --import=tsx ./build/index.js`.

   If you have a pre-compiled build, you can skip the build step:

   ```bash theme={null}
   npx orion prod --node --path ./build
   ```

## Environment Variables

Remember that you must set the environment variables needed to load the `.env` file before starting the server:

* `ORION_ENV_SECRET_KEY`: The secret key used to decrypt your environment variables
* `ORION_ENV_FILE_PATH`: Path to your encrypted environment file
