Reference
Deployment
Ship your Crescent.js application to production.
Overview
Because Crescent.js is a standard Node.js application, you can deploy it to any platform that runs Node.js — a VPS, a container, or a PaaS.
Building
Create an optimized production build of your app:
bash
crescent buildThe build step bundles your pages, layers, and functions into a single production artifact ready to serve.
Serving
Run the production build with the same CLI you use in development. Configure the port through the PORT environment variable:
bash
PORT=8080 crescent run build/Environment Variables
| Variable | Description |
|---|---|
PORT | Port to listen on |
AUTH_SECRET | Secret used to sign auth tokens |
DATABASE_FILE | Path to the database file |
Persistent storage
If your host uses ephemeral filesystems, mount a persistent volume for the database file so data survives restarts.
Docker
Here is a minimal Dockerfile for deploying your app:
Dockerfile
FROM node:20-alpine
WORKDIR /app
COPY package.json ./
RUN npm install
COPY . .
RUN npx crescent build
EXPOSE 8080
CMD ["node", "build/server.js"]Deployment Platforms
- VPS / Cloud VM — run the production build behind a reverse proxy
- Docker — use the Dockerfile above on any container platform
- PaaS — most Node.js platforms detect the build and start commands automatically
Next Steps
- API Reference — explore every method
- Configuration Guide — finalize your config