How to deploy Node.js backend on Vercel?

2025-06-232 min read

In this blog post, we'll learn how to deploy a Node.js backend on Vercel using the Vercel CLI.

Make sure your project has a vercel.json configuration file in the root. If not, you can generate one manually or ask GPT to create it for you.

🛠 Steps to Deploy

Install the Vercel CLI globally:

npm install -g vercel

Login to your Vercel account:

vercel login

Deploy your project:

vercel

Configure your vercel.json:

{
  "version": 2,
  "builds": [
    {
      "src": "./index.js",
      "use": "@vercel/node"
    }
  ],
  "routes": [
    {
      "src": "/(.*)",
      "dest": "/"
    }
  ]
}

That's it! Your Node.js backend should now be deployed on Vercel.