NetrunHome

How to put a Next.js app online

· 4 min read

Normally, to put a Next.js app online you have to rent a server, install Node.js on it, build the project with npm run build, run it as a long-lived process, put nginx next to it, get an SSL certificate and make sure everything comes back up after a reboot. For a pet project or a first site that is a lot of manual fiddling.

Netrun takes the infrastructure off your hands: you upload the app code, and we handle the build, launch, restarts, domain and HTTPS. Here is how to get your Next.js online in a few minutes.

  1. Check your package.json

    Make sure package.json has build and start scripts — usually next build and next start. Netrun uses them to figure out how to build and run the app. If you created the project with create-next-app, these scripts are already there.

  2. Do not set the port to a fixed number

    If your app has a server side — server-side rendering (SSR) or API routes in the app or pages folder — it runs through next start and needs to listen on a port from an environment variable. Next.js reads the port from the PORT variable by default, so you do not need to write it into your code: Netrun passes the right one in for you.

  3. Decide whether you need a server

    If the site is purely static — no server-side rendering and no API routes — it can be built as a set of ready-made files: add the static export setting to next.config (output: 'export'), and Netrun will serve the result as a plain static site. But if you have API routes or data loaded on the server, keep the normal mode with next start.

  4. Build a ZIP or connect GitHub

    You can upload the code in two ways: as a ZIP archive or by importing a GitHub repository, including a private one. You do not need to include the node_modules and .next folders — Netrun installs the dependencies and runs the build itself from your package.json, so the archive stays light.

  5. Provide your secrets during setup

    If the app talks to a database or external services, do not keep API keys, tokens and the connection string in your code. Netrun asks for them when you set up the project and passes them in as environment variables: in Next.js server-side values are available through process.env, while anything that should reach the browser is, by the Next.js rules, named with the NEXT_PUBLIC_ prefix.

  6. Deploy and watch the status

    Start the deploy — Netrun detects that it is Node.js, installs the dependencies, runs the build and gives you an HTTPS link. Logs and status show up in your dashboard in real time, so if the build trips on something you will see it right away. If the running project fails, it restarts automatically.

That is it: your Next.js app lives online at an HTTPS address, with no rented server and no nginx setup. The Free plan includes one project, and a web app sleeps when idle and wakes on the first request — it only responds a little slower the first time. If the site needs to be ready at all times, with no pauses, the paid plan with always-on running is a good fit, and extra projects are added as separate slots. Try Netrun.