---
title: "Migrating an existing Next.js project to Netlify"
description: "If you"
source: "https://www.netlify.com/blog/2021/05/04/migrating-an-existing-next.js-project-to-netlify/"
last_updated: "2026-07-11T03:41:48.000Z"
---
Hellloooo!

So, you have a Next.js project that works flawlessly, and you want to put it on Netlify for the first time. Fun! Here’s some things you might have to do.

## Add a `netlify.toml` file

You’ll need a `netlify.toml` file added at the top level of your project to make sure everything is imported correctly.

```
[build]  command = "npm run build"  publish = ".next"
```

You can also do this in the Netlify UI if you don’t want to make this file by filling in the build command and publish directory!

![Basic build settings on Netlify, with command npm run build and directory .next](https://cdn.sanity.io/images/o0o2tn5x/production/669cdf83de6efed1cb6d42c9933da420c5ff99c4-1306x1002.png?w=450)

If you aren’t using the defaults for your Next.js publish or functions directory, you can change the values here! For example:

```
[build]  command   = "npm run build"  functions = "my_functions_dir"  publish   = "my_publish_dir"
```

If you would like to customize even more build settings, [check out the docs](https://docs.netlify.com/configure-builds/get-started/#basic-build-settings) for more information on this!

## Anything else?

Honestly, probably not. Each of these steps are optional, depending on your project! We [auto-install the Essential Next.js Build Plugin](https://github.com/netlify/netlify-plugin-nextjs) to all new Next.js projects on the platform, which will enable server-side rendering and other framework-specific features in your builds. If you have any problems with it, [you can uninstall it](https://docs.netlify.com/configure-builds/build-plugins/#remove-a-plugin), or file an issue on the repo, or ask questions in [our community](https://answers.netlify.com/)!

## What if I don’t have an existing Next.js project?

Been there! Here’s a starter project for ya to get going:

[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/netlify-templates/next-netlify-starter&utm_source=blog&utm_medium=nextmigration-cs&utm_campaign=devex-cs)

(Clicking this button will deploy a Next.js starter project to Netlify, and clone it to your chosen Git provider, PLUS because it’s brand new, you can completely ignore the previous parts of this post)

### Share

-   [X (fka Twitter)](https://twitter.com/intent/tweet?text=Migrating an existing Next.js project to Netlify&url=https://www.netlify.com/blog/2021/05/04/migrating-an-existing-next.js-project-to-netlify//)
-   [LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fwww.netlify.com%2Fblog%2F2021%2F05%2F04%2Fmigrating-an-existing-next.js-project-to-netlify%2F%2F)
-   [Facebook](https://www.facebook.com/sharer.php?u=https://www.netlify.com/blog/2021/05/04/migrating-an-existing-next.js-project-to-netlify//)
-   [Bluesky](https://bsky.app/intent/compose?text=Migrating an existing Next.js project to Netlify+https://www.netlify.com/blog/2021/05/04/migrating-an-existing-next.js-project-to-netlify//)

* * *

### Tags

-   [Next.js](/blog/tags/next.js/)
-   [migration](/blog/tags/migration/)

## Keep reading

![](/images/blog-fallback-thumbnail.svg)

Guides & Tutorials June 18, 2020

[

### Next.js 101: What you should know

](/blog/2020/06/18/next.js-101-what-you-should-know/)

-   ![Profile picture of Cassidy Williams](/_astro/a62099fab0f946e063c4b84ff4b4d9c94f9aa7a5-400x400_ZdakPa.webp)
    
    Cassidy Williams
    

![](/images/blog-fallback-thumbnail.svg)

News & Announcements March 16, 2021

[

### Try the new Essential Next.js plugin, now with auto-install!

](/blog/2021/03/16/try-the-new-essential-next.js-plugin-now-with-auto-install/)

-   ![Profile picture of Cassidy Williams](/_astro/a62099fab0f946e063c4b84ff4b4d9c94f9aa7a5-400x400_ZdakPa.webp)
    
    Cassidy Williams
    

## Recent posts

News & Announcements June 25, 2026

[

### Netlify Functions, designed for Agent Experience

](/blog/netlify-functions-designed-for-agent-experience)

-   ![Profile picture of Eduardo Bouças](/_astro/52958f21e8450baf6d8e60302341a984e220c0cd-512x512_13VDlu.webp)
    
    Eduardo Bouças
    

News & Announcements June 24, 2026

[

### How we measure Netlify’s Agent Experience

](/blog/how-we-measure-netlify-agent-experience)

-   ![Profile picture of Sean Roberts](/_astro/bbf2243f8171dbddd80ab2103622106cef84d125-512x512_Z1d2LKE.webp)
    
    Sean Roberts
    

Guides & Tutorials May 15, 2026

[

### How to build a real-time AI chatbot in minutes with Netlify Agent Runners (no backend)

](/blog/how-to-build-a-real-time-ai-chatbot-in-minutes-with-netlify-agent-runners-no-backend)

-   ![Profile picture of Nahrin Jalal](/_astro/f0e7c8f227a03fe58340c99ef5439d5a896c0733-272x272_Z23kDpD.webp)
    
    Nahrin Jalal
    

![](/_astro/3f255b372fa958df35802666ee33b4609b2d71bd-1200x1586_1VtE2D.webp)

### How do the best dev and marketing teams work together?

[Access the report](https://www.netlify.com/reports/2024-leadership-trend-report/access/)