Deploy a Remix App

This tutorial walks you through deploying a Remix application on Temps. Remix runs on a Node.js server with full SSR, loaders, and actions.


What you will build

  • A Remix app deployed from a Git repository
  • Server-side rendering with loaders and actions
  • Automatic HTTPS and deployment on every push

Time required: 10 minutes.

Prerequisites:

  • A running Temps instance (install guide)
  • A Remix app in a Git repository
  • (Optional) A custom domain

Step 1: Prepare your app

Verify your package.json

Remix v2+ uses Vite as the build tool:

package.json

{
  "scripts": {
    "dev": "remix vite:dev",
    "build": "remix vite:build",
    "start": "remix-serve ./build/server/index.js"
  },
  "dependencies": {
    "@remix-run/node": "^2.0",
    "@remix-run/react": "^2.0",
    "@remix-run/serve": "^2.0"
  }
}

Add a health check

app/routes/health.tsx

import { json } from '@remix-run/node';

export function loader() {
  return json({ status: 'ok' });
}

Step 2: Create a project

  1. Open the Temps dashboard
  2. Click New Project
  3. Connect your repository
  4. Temps detects Remix automatically

Or via CLI:

bunx @temps-sdk/cli projects create -n "my-remix-app" -d "Remix application"
bunx @temps-sdk/cli projects git -p my-remix-app --owner yourorg --repo my-remix-app --branch main -y

Step 3: Create a Dockerfile (optional)

Temps auto-detects Remix, but you can customize:

Dockerfile

FROM node:22-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM node:22-alpine
WORKDIR /app
ENV NODE_ENV=production
COPY --from=builder /app/build ./build
COPY --from=builder /app/package.json .
COPY --from=builder /app/node_modules ./node_modules
EXPOSE 3000
CMD ["npm", "run", "start"]

Step 4: Configure environment variables

Remix loads environment variables on the server. Access them in loaders and actions:

// Available in loaders and actions
export function loader() {
  const apiKey = process.env.API_KEY;
  // ...
}

To expose variables to the client, pass them through a root loader.

Set variables in the Temps dashboard under Environment Variables.


Step 5: Deploy

Push to your connected branch, or deploy manually:

bunx @temps-sdk/cli deploy my-remix-app -b main -e production -y

Temps will:

  1. Detect your Remix project
  2. Build the Docker image
  3. Run remix vite:build
  4. Start remix-serve on the configured port
  5. Run health checks and route traffic

Database integration

If your Remix app needs a database, provision one in Temps:

bunx @temps-sdk/cli services create -p my-remix-app -t postgres -n "remix-db"

The DATABASE_URL is automatically injected. Use Prisma or Drizzle to connect:

app/db.server.ts

import { drizzle } from 'drizzle-orm/postgres-js';
import postgres from 'postgres';

const client = postgres(process.env.DATABASE_URL!);
export const db = drizzle(client);

What to do next

Was this page helpful?