---
title: "Deploy Next.js on your own server - Deplo"
description: "Push a Next.js app and Deplo builds it, runs it as a Node server and puts a certificate in front of it, on a server you own."
url: "https://deplo.build/frameworks/nextjs"
image: "https://deplo.build/api/media/file/og_cover.png"
updated: "2026-10-09"
---

# Deploy Next.js on your own server

Push a Next.js app and Deplo builds it, runs it as a Node server and puts a certificate in front of it, on a server you own.

## From repo to live in three steps

1. Connect the repository that holds your Next.js app.
2. Deplo detects Next.js and sets the install, build and start commands and the port.
3. Push to the branch: every push builds and rolls out a new version.

## What Deplo sets up

- Detected from the next dependency in package.json or a next.config file at the root.
- Install, build and start commands chosen for you, with port 3000 already set.
- NEXT\_PUBLIC\_ variables reach the build, so client values are baked in as usual.
- HTTPS through Traefik as soon as the domain points at the server.

Detection runs on every deploy and is never stored, so a change to the project is picked up by the next push.

[Learn more](https://deplo.build/docs/concepts/what-happens-on-a-deploy#the-framework-is-detected)

## Next.js on Deplo

Short answers to what comes up before moving a Next.js app onto your own server.

### Do server rendering and API routes work?

Yes. The app runs as a Node server in its own container, so server components, route handlers and middleware behave as they do locally.

### Where do environment variables go?

In the app's settings, per environment. They are available during the build too, and secret values are write only: nothing reads them back.

### Is there downtime when I push?

No. The new container has to pass its health check before the old one is retired.

```json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "Organization",
      "@id": "https://deplo.build/#organization",
      "name": "Deplo",
      "url": "https://deplo.build",
      "description": "Deploy apps from Git, Docker images or Compose on your own servers with Deplo. Open source, automatic HTTPS, backups and no per-seat fees.",
      "logo": {
        "@type": "ImageObject",
        "url": "https://deplo.build/api/media/file/og_logo.png",
        "width": 824,
        "height": 824
      },
      "sameAs": [
        "https://ds.deplo.build",
        "https://x.com/deplocloud",
        "https://www.instagram.com/deplocloud",
        "https://github.com/DeploCloud/deplo"
      ]
    },
    {
      "@type": "WebSite",
      "@id": "https://deplo.build/#website",
      "name": "Deplo",
      "url": "https://deplo.build",
      "description": "Deploy apps from Git, Docker images or Compose on your own servers with Deplo. Open source, automatic HTTPS, backups and no per-seat fees.",
      "publisher": {
        "@id": "https://deplo.build/#organization"
      }
    }
  ]
}
```

```json
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "position": 1,
      "name": "Frameworks",
      "item": "https://deplo.build/frameworks"
    },
    {
      "@type": "ListItem",
      "position": 2,
      "name": "Deploy Next.js on your own server",
      "item": "https://deplo.build/frameworks/nextjs"
    }
  ]
}
```

```json
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "Do server rendering and API routes work?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes. The app runs as a Node server in its own container, so server components, route handlers and middleware behave as they do locally."
      }
    },
    {
      "@type": "Question",
      "name": "Where do environment variables go?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "In the app's settings, per environment. They are available during the build too, and secret values are write only: nothing reads them back."
      }
    },
    {
      "@type": "Question",
      "name": "Is there downtime when I push?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "No. The new container has to pass its health check before the old one is retired."
      }
    }
  ]
}
```
