# Build an API in Next.js and deploy with Rancher

DevFeed: [Build an API in Next.js and deploy with Rancher](<https://devfeed.tech/articles/build-an-api-in-next-js-and-deploy-with-rancher-83283.md>)

Original publisher: [Read original article](<https://ngrok.com/blog/next-js-kubernetes-rancher>)

Author: Joel Hans

Published: 2023-11-30T00:00:00Z

Content type: tutorial

Language: en

Sources: [\[ngrok news\]](<https://devfeed.tech/sources/ngrok-news.md>)

Topics: [rancher](<https://devfeed.tech/topics/rancher.md>), [CI/CD](<https://devfeed.tech/topics/cicd.md>), [API](<https://devfeed.tech/topics/api.md>), [Service fabric](<https://devfeed.tech/topics/service-fabric.md>), [cloud-sql](<https://devfeed.tech/topics/cloud-sql.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [container](<https://devfeed.tech/tags/container.md>), [credentials](<https://devfeed.tech/tags/credentials.md>), [crud](<https://devfeed.tech/tags/crud.md>), [database](<https://devfeed.tech/tags/database.md>), [deployment](<https://devfeed.tech/tags/deployment.md>), [kubernetes](<https://devfeed.tech/tags/kubernetes.md>), [next-js](<https://devfeed.tech/tags/next-js.md>), [rancher](<https://devfeed.tech/tags/rancher.md>), [sdks](<https://devfeed.tech/tags/sdks.md>)

## AI overview

This tutorial builds a plant-tracking CRUD API with Next.js and MongoDB, then deploys it to Kubernetes managed by Rancher. It covers containerizing the app, configuring database storage and credentials, and exposing the service through the ngrok Kubernetes Operator. The deployment uses a single MongoDB replica for the local demo; the article recommends three or more for production.

## Source excerpt

See how to build and deploy a Next.js application in Kubernetes with Rancher