Self-Host a Framer Site with Docker

Summary

Pixel shares a practical guide to self-hosting a converted Framer site as a Node.js app with Docker, a domain, and a Caddy or nginx reverse proxy for HTTPS. It compares Next.js, TanStack Start, Astro, and React Router setup details, including build commands, ports, and host settings.

DEV Community

Self-host a Framer site with Docker on your own server

To self-host a Framer site with Docker, convert the published site to a code project, build it into a Docker image, run the container on your server, and put a reverse proxy such as Caddy or nginx in front for HTTPS. Framer itself can't be self-hosted, because it doesn't export files; a converted project can, because it's a standard Node.js app. Next.js is the most common choice, and the TanStack Start, Astro and React Router targets work the same way with a different start command. Deframer is an independent tool and is not affiliated with, endorsed or sponsored by Framer. Downloads are for sites you own or have the owner's permission to convert. What you need A Linux server (any VPS provider) with Docker and Docker Compose installed. A domain whose DNS you control. The converted project. Paste your published Framer address on deframer.co, pick a framework, verify the site is yours and download. Converting is free; a verified download costs 1 credit (pricing). For a fully independent site, choose Assets in the project when converting, so images, fonts and videos are served from your server instead of Framer's CDN. If you don't want a server at all, a static Vite export on any static host is simpler. This guide is for when you want the box to be yours. Which target, and how it starts Target Build Start Node.js Default port Next.js npm run build npm start (next start) 20.9 or later 3000 TanStack Start npm run build (Rsbuild) npm start (srvx) 22.18 or later see srvx's docs Astro npm run build (prerenders every page) npm start (the project's server.ts) 22.18 or later 4321 React Router npm run build, then prerender npm start (the project's server.ts) 22.22 or later 3000 The Astro and React Router server.ts read HOST and PORT; their default host is localhost, so inside a container set HOST=0.0.0.0 or the proxy can't reach them. For Next.js in standalone mode, set HOSTNAME=0.0.0.0 for the same reason; the Dockerfile below does. Step 1: Build and run locally npm install
npm run build
npm start
Open the site and click through the routes in the README. Fix anything here first; Docker won't make a broken build better. Step 2: Write the Dockerfile Next.js, with standalone output Next.js can trace exactly the files a production server needs into .next/standalone, which makes a much smaller image. Add one line to next.config.ts (the converted config doesn't set it): const nextConfig: NextConfig = {
output: "standalone",
// … the rest stays as converted
};
Then add a Dockerfile at the project root: FROM node:22-slim AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM node:22-slim
WORKDIR /app
ENV NODE_ENV=production
ENV HOSTNAME=0.0.0.0
ENV PORT=3000
COPY --from=build /app/.next/standalone ./
COPY --from=build /app/.next/static ./.next/static
COPY --from=build /app/public ./public
USER node
EXPOSE 3000
CMD ["node", "server.js"]
The standalone server doesn't copy public/ or .next/static itself, which is why the two extra COPY lines are there. Without them, styles and assets are missing. TanStack Start, Astro or React Router These run with npm start, so copy the whole built app: FROM node:22-slim AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM node:22-slim
WORKDIR /app
ENV NODE_ENV=production
ENV HOST=0.0.0.0
ENV PORT=3000
COPY --from=build /app ./
USER node
EXPOSE 3000
CMD ["npm", "start"]
node:22-slim installs the newest Node.js 22 release, which satisfies 22.18 and 22.22. Pin a specific tag if you want reproducible images. .dockerignore Add a .dockerignore so local files stay out of the image: node_modules
.next
dist
.env
.env*.local
.git
Step 3: Compose the app and Caddy Caddy gets and renews TLS certificates on its own, which makes it a good default. Create compose.yaml: services:
site:
build: .
restart: unless-stopped
env_file: .env.production
expose:
- "3000"

caddy:
image: caddy:2
...
Self-Host a Framer Site with Docker
Powered by Readybot.io

The latest from Pixel

Incident Response: Look Beyond the Red Alert

Pixel’s DEV Community announcement explores how teams can fixate on one failing service while overlooking the real cause of an outage, such as a full …

Sach: AI Fact-Checks WhatsApp Forwards in India

Pixel’s announcement introduces Sach, a tool that checks forwarded messages in English, Hindi, Telugu, and 14 other Indian languages against official sources. It gives cited …

Java 25 Removes SecurityManager: What to Fix

Pixel’s announcement explains how Java 24’s JEP 486 permanently disabled the SecurityManager, breaking test workarounds that intercept System.exit. It recommends returning exit codes or throwing …