Guides
Deployment
Running Bklar in production.
Deployment
Bklar apps are just Bun apps. You can deploy them anywhere Bun is supported.
Docker
The most robust way to deploy is using Docker.
FROM oven/bun:1 as base
WORKDIR /usr/src/app
# Install dependencies
COPY package.json bun.lockb ./
RUN bun install --frozen-lockfile --production
# Copy source
COPY . .
# Run
USER bun
EXPOSE 3000/tcp
ENTRYPOINT [ "bun", "run", "src/index.ts" ]Build and run:
docker build -t my-api .
docker run -p 3000:3000 my-apiRailway / Render
Platforms like Railway and Render support Bun natively.
- Connect your GitHub repository.
- Set the Build Command to
bun install. - Set the Start Command to
bun run src/index.ts.
VPS (Ubuntu/Debian)
If managing your own server:
- Install Bun:
curl -fsSL https://bun.sh/install | bash - Clone your repo.
- Install deps:
bun install --production - Use a process manager like PM2 (Bun works well with it):
bun add -g pm2
pm2 start src/index.ts --name "api" --interpreter ~/.bun/bin/bun