All postsnext.jsdeploymentvps

Deploy Next.js on a VPS with Postgres, Redis and HTTPS

Run a full-stack Next.js app with Postgres, Redis and a worker on one private VPS: a tested aria.yaml, what changes from Vercel, and what size you need.

Can KosmazUpdated 1 November 20266 min read

You can run a full-stack Next.js app on a private VPS with Postgres, Redis and HTTPS without writing Dockerfiles, Nginx config or systemd units. On Aria Cloud, Aria AI writes one aria.yaml (or your coding agent does, over MCP), Aria builds the app from your repository, runs it as a long-lived Node service, connects the databases and sets up HTTPS. By Aria’s estimate, a Next.js app with Postgres needs 4,032 MB, which fits the 4 GB Starter plan (£15 a month ex VAT) with very little room. With Redis, use Developer (8 GB, £25). This post covers why people move, a file that passes Aria’s checks and what changes from Vercel. The step-by-step reference is the Next.js docs.

Next.js can run anywhere Node runs. The official self-hosting guide says so. The choice is not only between paying per seat on a front-end platform and spending a weekend on a raw server. There is a middle path.

Why do people move Next.js onto a VPS?

Front-end platforms are built around stateless functions and edge caching. That suits marketing sites. Full-stack products with Server Actions, API routes, background jobs and a relational database tend to hit three things.

  1. Your database is one hop away. When Next.js and Postgres run on the same server, queries do not cross the internet.
  2. Long jobs and workers. Streaming responses, generating PDFs, handling webhooks and running scheduled work are ordinary processes on a server. A worker runs next to the web service from the same repository.
  3. A flat bill. You pay for the server, not for seats or requests. Prices start at £15 a month ex VAT, and there is no charge per seat, app, database or request.

For the cost arithmetic, see Vercel versus a VPS.

What does the aria.yaml look like?

This file passes Aria’s schema check. Aria AI writes something like it from your repository. In the Mac app it uses the subscription you already pay for, and in the browser it uses your API key. A coding agent outside Aria writes the same file over MCP:

version: 1
name: my-nextjs-product
services:
  web:
    type: web
    framework: nextjs
    port: 3000
    healthcheck: /
    domain: "@"
  worker:
    type: worker
    start: node dist/worker.js
databases:
  main:
    type: postgres
  cache:
    type: redis
env:
  DATABASE_URL:
    services: [web, worker]
    from: main.url
  REDIS_URL:
    services: [web, worker]
    from: cache.url
  SESSION_SECRET:
    services: [web]
    generate: secret

The env block is what connects your services to the databases. from: main.url hands each service its database address. Without it, Aria’s check warns that nothing reads the database. generate: secret creates a secret for you, so it never sits in your repository. domain: "@" asks for your main domain once you connect one. Every field is explained in the aria.yaml reference, and the full Next.js example with migrations is in the Next.js docs.

When you deploy:

  • Aria builds from your Dockerfile, or detects your framework.
  • Postgres and Redis are created on the same server and wired into the services that list them.
  • HTTPS is set up for your address and for a domain you connect (domains).
  • If a release misbehaves, you can roll back to the last good version.
  • A push redeploys only the services the commit touched.

How big a server does it need?

Aria’s sizing tool, estimateStack, gives these estimates. They are estimates from typical memory use, not measurements, and Aria checks your real aria.yaml before you pay.

Stack Total need Plan
Next.js and Postgres 4,032 MB Starter (4 GB), with 64 MB to spare
Next.js, Postgres and Redis 4,186 MB Developer (8 GB). It misses Starter by 90 MB
Next.js, a worker, Postgres and Redis (the file above) 4,647 MB Developer (8 GB)
Next.js with Supabase 7,719 MB Developer, with 473 MB spare

The big number in each is the build. The estimate for a Next.js build is 2,048 MB, while the running app is a fraction of that. Starter is a fine place for a small app with Postgres. Anything beyond that wants Developer.

Which Next.js features work on your own server?

Running Next.js as a Node server supports the framework. These notes come from the official guide and from how Aria runs services.

Feature On a server
App Router and React Server Components Run in the Node process
Server Actions and Route Handlers Run in the Node process, with no platform function time limit
ISR and the image cache Work as on any Node server. Files written while the app runs are reset on each deploy unless you keep them in a volume
next/image Works with next start and no extra setup. Watch memory use on glibc Linux
Proxy (middleware) Works with next start, in front of your routes
Streaming and Suspense Works if your proxy does not buffer responses
WebSockets and long-lived connections Supported, because it is a real server

Two cautions. If you run more than one instance of the app, ISR and revalidation need a shared cache handler, and every instance needs the same Server Actions encryption key. Both are in the official guide, and our Vercel versus VPS post has the full table. On one server with one instance, most of that does not apply.

What changes from Vercel?

  • Where it runs. An Aria plan is one private VPS in a place you choose. Putting the server beside the database and most of your users is a good trade.
  • Previews. Vercel gives every branch its own URL. On Aria, a staging app on the same server is the substitute.
  • How you work. You work through aria.yaml, Aria AI, the command line and your coding agent.
  • Sizing. A server has a set amount of memory: 4 GB on Starter, 8 GB on Developer, up to 32 GB on Scale Plus. Aria’s check tells you whether your stack fits before you deploy, and a bigger plan needs one restart.
  • Front ends too. Aria hosts static sites and front ends as well, so a marketing site can sit on the same server as your app.

For the alternatives side by side, read Vercel alternatives and when to own the server. For the head-to-head, see Aria versus Vercel.

FAQ

How do I deploy Next.js to my own server without Docker or Nginx?

Connect your repository to Aria and let Aria AI write aria.yaml. Aria builds the app, creates the database, wires DATABASE_URL through the env block and sets up HTTPS. The quickstart has the steps.

Do next/image and ISR work on a self-hosted server?

Yes. The official guide says image optimisation works with next start and no extra setup, and ISR uses the server’s cache. On Aria, files written while the app runs are reset on each deploy unless you keep them in a volume.

Which Aria plan fits a Next.js app with Postgres?

Starter (4 GB) fits a Next.js app with Postgres by Aria’s estimate, with little room. Add Redis or a worker and use Developer (8 GB, £25 a month ex VAT).

Can I run multiple Next.js apps on one Aria server?

Yes, as far as memory allows. Nothing is charged per app. See running several apps on one VPS.

Can I use a custom domain?

Yes. Connect one you own or buy one through Aria. An address with HTTPS is included at no extra cost. See domains.

Deploy your Next.js app. See pricing or get started.

Keep reading

Your own cloud. Without the DevOps.

One server that’s yours alone, set up and run by Aria, at one flat monthly price.

Account · Terms

We’ve updated our terms.

Please read and accept the current terms of service and privacy policy to keep using Aria.