Next.js hosting

Deploy a Next.js app with its server, without Vercel

Makofy runs a Next.js app as a long-lived Node.js server: it installs your dependencies, runs next build, then starts next start on port 8080, so server-side rendering, API routes, server actions and middleware all work. A small site runs on Starter for $3.50 a month; most production Next.js apps are more comfortable on Basic (1 GB, 1 vCPU) for $6 a month, a flat price with no per-request billing.

Last updated · By the Makofy team (Muncar Ventures LLC)

How Makofy builds a Next.js repo

If your repository has no Dockerfile and package.json lists next, Makofy treats it as a Next.js server app. It installs with the package manager your lockfile implies (npm, yarn, pnpm or bun), runs the production build, and starts the server with next start -p 8080. Every web service listens on port 8080 unless you change it, so there is nothing to configure for a standard app.

Next.js featureWorks on Makofy?Notes
Server-side rendering (App or Pages Router)YesRendered by the running next start server.
API routes and route handlersYesSame process, same URL.
Server actionsYesRun on the server like any other request.
MiddlewareYesRuns inside the Node.js server.
Static and ISR pagesYesServed by the same server; the page cache lives in the container and starts fresh after each deploy.
next/image optimisationYesDone by the server, so give it enough memory (Basic or larger for image-heavy sites).
Edge runtime on a global networkNoMakofy runs your app in one region, Helsinki (EU).

Deploy a Next.js app, step by step

  1. Check that package.json has the standard scripts ("build": "next build", "start": "next start") and commit your lockfile.
  2. Start the 7-day free trial at makofy.com (card required, no charge until it ends).
  3. Create an app from the GitHub repository and branch. Choose Basic if the app renders a lot on the server or optimises images; Starter is enough for a small marketing site or docs.
  4. Add environment variables such as DATABASE_URL, NEXTAUTH_SECRET or API keys. They are applied on the next deploy.
  5. Deploy. The build runs on Makofy, then the app goes live at https://<app>--<workspace>.makofy.sh with HTTPS.
  6. Attach your domain in the dashboard (see custom domains); the HTTPS certificate is issued automatically.

Prefer the terminal? makofy deploy uploads the current folder (skipping what .gitignore excludes) and builds it the same way. See the CLI reference.

Environment variables and NEXT_PUBLIC_ values

Server-side code reads process.env at request time, so secrets like database URLs work as normal environment variables. Values prefixed with NEXT_PUBLIC_ are different: next build copies them into the browser bundle. Treat them as build-time constants. If a public value has to differ between deployments, read it on the server (for example in a server component or route handler) and pass it down, or set it in a Dockerfile so it is present during the build.

A smaller image with output: standalone

The detected build ships your whole node_modules. If you want a leaner image, enable Next.js standalone output and add a multi-stage Dockerfile. The standalone server reads PORT and HOSTNAME from the environment, which matches what Makofy provides.

// next.config.mjs
const nextConfig = {
  output: 'standalone',
};

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

FROM node:22-alpine
WORKDIR /app
ENV NODE_ENV=production HOSTNAME=0.0.0.0
COPY --from=build /app/.next/standalone ./
COPY --from=build /app/.next/static ./.next/static
COPY --from=build /app/public ./public
CMD ["node", "server.js"]

Makofy uses a Dockerfile as written whenever it finds one, which is also the way to choose a Node.js version other than the detected build’s Node.js 20. The Docker guide covers the details.

What it costs compared with Vercel-style pricing

On Makofy the price is per app and per month, whatever the traffic: Starter $3.50, Basic $6, Pro $12 (2 GB, 2 vCPU). A typical full-stack setup (a Next.js app on Basic plus managed Postgres at $3) is $9 a month. There are no function invocations or execution time to meter, because the app is one long-running server. The trade-off is that it runs in a single region rather than at the edge.

SetupInstance typesMonthly price
Small marketing site or blogStarter$3.50
Side project that can sleep when idleNap$1.50
SaaS app with a databaseBasic + Postgres$9
Busy app plus a background job workerPro + Starter worker + Postgres$18.50

Health checks and safe deploys

Makofy checks that the new server accepts connections on its port (or answers an HTTP health-check path you set). If the new version is not healthy within about two minutes, the previous healthy version is redeployed automatically. Any earlier deploy can be restored in one click from the dashboard, without rebuilding.

FAQ

Frequently asked questions

Can I host Next.js with server-side rendering outside Vercel?

Yes. Makofy runs next build and next start, so SSR, API routes, server actions and middleware work, for a flat $3.50 to $12 per month depending on size.

How much memory does a Next.js app need on Makofy?

Small sites run on Starter (512 MB). For server rendering under real traffic or image optimisation, start on Basic (1 GB, $6/month) and move up if the app restarts under load.

Do I need a Dockerfile to deploy Next.js?

No. Makofy detects Next.js and builds it for you. Add a Dockerfile only if you want standalone output, a different Node.js version or extra system packages.

Does Makofy support Next.js API routes and a database?

Yes. API routes run in the same server, and you can add managed Postgres for $3/month and connect to it with the connection URL from the dashboard.

Is there a free plan for Next.js hosting?

No. There is a 7-day free trial with a card required; after that the cheapest option is Nap at $1.50/month.

Related

Deploy your app in a few minutes.

Connect a GitHub repo or run makofy deploy. Flat price per app, 7-day free trial, card required.

Start free trial