Contents
Next.js doesn’t deploy in one shape. Depending on the features you use, the build is either a folder of static files that runs on any host, or a Node.js app that has to stay running to render pages on request. Decide which first, because the right plan and the steps differ.
Choose the deployment first
| Feature | Static export | Full deployment (SSR) |
|---|---|---|
Static pages, generateStaticParams |
Yes | Yes |
Per-request rendering, cookies(), headers() |
No | Yes |
| Dynamic Route Handlers, Server Actions | No | Yes |
Middleware, ISR, revalidate |
No | Yes |
Built-in next/image optimization |
No | Yes |
| Plan needed | Any plan | AI/Developer plans |
What Next.js needs in production
- Node.js version: Next.js 16 needs 20.9 or newer; Next.js 15 runs from 18.18. Versions 20 and 24 are available here; use 24.
- A build step:
next buildis memory-hungry, so run it on your computer or in GitHub Actions. - A startup file: Passenger needs a JavaScript file rather than the
next startcommand, so you add a smallserver.jsthat does the same job. - Environment variables: anything prefixed
NEXT_PUBLIC_is inlined at build time; secrets are set on the server. - Database: MySQL or MariaDB through Prisma, Drizzle or the
mysql2package.
Static export on any plan
Add these settings to next.config.mjs:
const nextConfig = {
output: "export",
trailingSlash: true,
images: { unoptimized: true },
};
export default nextConfig;
Run npm run build and the result lands in out. Zip its contents, upload to public_html and extract. trailingSlash makes /about/ open directly without rewrite rules.
Full deployment on AI/Developer plans
Add a server.js to the project root:
const { createServer } = require("http");
const next = require("next");
const app = next({ dev: false, dir: __dirname });
const handle = app.getRequestHandler();
app.prepare().then(() => {
createServer((req, res) => handle(req, res)).listen(process.env.PORT || 3000);
});
Then:
- Run
npm ci && npm run buildon your computer. - Upload the project with its
.nextfolder, leaving outnode_modulesand.next/cache. - In Setup Node.js App, create an app on Node.js 24 with
server.jsas the startup file, in Production mode. - Add your secret environment variables, then click Run NPM Install and Restart.
Full steps for both routes, with fixes for common errors, are in the Next.js deployment guide. If you see an error page instead of your site, read the app’s log (Passenger error).
What every account includes
- LiteSpeed, which serves static files directly, and free SSL issued automatically.
- Each account isolated in CloudLinux CageFS, daily JetBackup backups and Imunify360 security.
- On AI plans: SSH, Git, Node.js 20 and 24, and Claude Code or Codex on the server.
- Deploys from GitHub, or from Claude and Cursor through Araby MCP, and the Araby AI assistant reading your error logs.
Limits to know
- SSR and Route Handlers need an AI/Developer plan. On shared hosting only the static export works.
- Building on the server can exceed the plan’s memory and stop (heap out of memory).
- Vercel platform services, such as
vercel.jsoncron jobs, Blob and KV storage, don’t exist outside Vercel. Replace them with cron and MySQL. - No root access, no Docker, no custom public ports and no per-account Redis.
- The first request after a quiet spell can be slower while Passenger starts the app again.
On ArabyHost
If your site works as a static export, any hosting plan on the pricing page will do. If you need SSR or Route Handlers, pick one of the AI/Developer plans and follow the guide. For a React project without Next.js, see React hosting.
FAQ
Can I host Next.js on shared hosting?
Yes, as a static export: the build is plain HTML, CSS and JavaScript that any plan serves. SSR, Route Handlers and middleware need a Node.js process, which the AI/Developer plans provide.
Should I build on the server or on my computer?
On your computer or in GitHub Actions. next build needs a lot of memory and CPU for a short time and can be stopped on the server by your account's resource limits.
Do Server Actions work with a static export?
No. Server Actions, dynamic Route Handlers and ISR need a running Next.js server, so choose the full deployment on an AI/Developer plan if your project relies on them.