Next.js on Deno Deploy
Here’s a step-by-step guide on how to deploy your Next.js app to Deno Deploy.
Create a new Next.js app
npx create-next-app@latestℹ️
Or use an existing Next.js project.
Check your Deno installation
Make sure you have Deno installed:
deno --version
# deno should be >=2.0.0, if not run `deno upgrade`
# if the command was not found, head to https://deno.com/You should be able to run the app locally in development mode:
deno run devBuild the app
Let’s build the app:
deno run buildDeno Deploy(ment)
You’ll need deployctl to deploy to Deno Deploy:
# check if you have it installed
deployctl --version
# if not, you can install it with
deno install -gArf jsr:@deno/deployctlAlright, let’s actually deploy our Next.js app.
⚠️
The process differs slightly based on the version of Next.js you’re using.
Pick one of the commands below.
# For Next.js 15
deployctl deploy --include=.next --include=public jsr:@deno/nextjs-start/v15
# For Next.js 14
deployctl deploy --include=.next --include=public jsr:@deno/nextjs-startThat’s it!
By the way, you’ll see that a deno.json file is created in the root of the project.
It will be used in the future to know where to deploy the app.
You can find the full example repo on github.com/olegkorol/deno-nextjs .