Get Rewarded! We will reward you with up to €50 credit on your account for every tutorial that you write and we publish!

Deploy Next.js on a Webhosting or Managed Server

profile picture
Author
just-read-the-instructions
Published
2025-03-26
Time to read
3 minutes reading time

Introduction

In this tutorial we will deploy a Next.js application on a Hetzner Webhosting or Managed Server.

Prerequisites

  • Managed Server or Webhosting L/XL
  • SSH access

Step 1 - Set Node.js version

Depending on which Node.js version your application requires, execute one of the following commands:

# for v20
echo 20 > ~/.nodeversion

# for v22
echo 22 > ~/.nodeversion

# for v24
echo 24 > ~/.nodeversion

Use v24 if you create a new application.

You can check the currently used version via node -v.

Step 2 - Create Next.js application

Change into your home directory and create a new Next.js application via the following command:

cd "$HOME"
npx create-next-app@latest
cd example-app/ # Replace example-app with the name of your app

Alternatively, you can upload your existing application via FTP, SFTP or clone it from your Git repository.

Step 3 - Build your Next.js application

Create a production build via

npm run build

Step 4 - Configure the application in konsoleH

Configure the application in the Node.js menu of konsoleH. Enter the following values in the form:

Script path: node_modules/.bin/next
Working directory: example-app/
Log path: example-app/log.txt
Memory limit: 1024 MB
Version: 24

Add start as an Argument.

Finally, click the Enable button.

Step 5 - Test

Open your domain in the browser and you should see your Next.js application.

Conclusion

You now have a production-ready deployment of your Next.js application.

License: MIT
Want to contribute?

Get Rewarded: Get up to €50 in credit! Be a part of the community and contribute. Do it for the money. Do it for the bragging rights. And do it to teach others!

Report Issue

Discover our

Managed Servers

Get €20/$20 free credit!

Valid until: 31 December 2026 Valid for: 3 months and only for new customers
Get started
Want to contribute?

Get Rewarded: Get up to €50 credit on your account for every tutorial you write and we publish!

Find out more