Run the site without Docker
Install and start the site with Node.js and Yarn, in development or as a production build.
Before you start: install Node.js 20.9 or newer; 22 or 24 is recommended. No database and no .env file are needed for a first run.
Download and unzip the template as in the Docker guide, then open a terminal in the Nextjs-landing-page-template-2 folder.
Start the development server
Turn on Corepack
Corepack runs the Yarn version the project pins, Yarn 4.8.1. You only need to do this once per computer.
Terminalcorepack enableHaving trouble?Install the dependencies
TerminalinNextjs-landing-page-template-2yarn installExpected result: Yarn finishes with
Having trouble?Doneand anode_modulesfolder appears.Start it and open the site
TerminalinNextjs-landing-page-template-2yarn devA port is already in use?
If it stops with
A port is already in useEADDRINUSE: address already in use :::3030, another program uses port 3030. Stop it, or start on another port withyarn dev -p 3041and open localhost:3041/enLocal.Expected result: localhost:3030/enLocal opens the home page. It reloads by itself when you save a file.
Having trouble?
Stop the server with Ctrl+C in its terminal.
Run a production build
The development server is for editing. To check the site the way visitors get it, build it once, then serve the build:
Nextjs-landing-page-template-2yarn build
yarn startIt also answers on localhost:3030/enLocal. If port 3030 is taken, use yarn start -p 3041. Run yarn build again after every change: yarn start serves the last build as it was.
The scripts
| Script | What it does |
|---|---|
yarn dev | Development server on port 3030 |
yarn build | Production build |
yarn start | Serves the production build on port 3030 |
yarn lint | Checks the code with ESLint and the Next.js rules |
yarn typecheck | Checks the TypeScript types |
Your own settings
Every setting is optional. To change one, copy .env.example to .env.local and edit it there. The values are read when the app starts in development and when it builds, so restart yarn dev, or run yarn build again, after a change.
Nextjs-landing-page-template-2cp .env.example .env.local