Samuel Aguilar
Back to the blog
June 21, 2026·Development·1 min read

Deploying a Next.js app with a database (Vercel + Neon)

A simple, free recipe to put a full-stack application online with its database.

Getting a full-stack app into production used to be complicated. Today, with the right tools, it's a matter of minutes and free to start.

The stack

  • Next.js for the application (front + API in the same project).
  • Neon as serverless PostgreSQL (free tier, hosted in the EU).
  • Vercel for hosting, with automatic deploys from GitHub.

Steps

  1. Push the code to GitHub.
  2. Create the database on Neon and copy its connection string.
  3. In Vercel, import the repo and add the environment variables (including DATABASE_URL).
  4. Deploy. From here on, every push publishes itself.

A detail that saves headaches

For migrations use Neon's direct connection (DIRECT_URL) and keep the pooled one for runtime. And never commit your .env: let .gitignore protect it.

This very site is built this way. The hard part is no longer the deploy; it's having something worth deploying.

#nextjs#vercel#neon#postgresql#deploy